monkey_wrench.chimp package

The package providing functionalities needed for performing a chimp retrieval.

class monkey_wrench.chimp.ChimpRetrieval(*, temp_directory_path: ~typing.Annotated[~pathlib.Path, ~pydantic.types.PathType(path_type=dir), ~pydantic.functional_validators.AfterValidator(func=~monkey_wrench.input_output._types.<lambda>)], model_filepath: ~typing.Annotated[~pathlib.Path, ~pydantic.types.PathType(path_type=file), ~pydantic.functional_validators.AfterValidator(func=~monkey_wrench.input_output._types.<lambda>), ~pydantic.functional_validators.AfterValidator(func=~monkey_wrench.input_output._types.ensure_path_does_not_end_with_slash)], sub_strings: str | list[str] | None = None, case_sensitive: bool = True, match_all: bool = True, parent_input_directory_path: ~typing.Annotated[~pathlib.Path, ~pydantic.types.PathType(path_type=dir), ~pydantic.functional_validators.AfterValidator(func=~monkey_wrench.input_output._types.<lambda>)], visitor_writer: ~monkey_wrench.input_output._models.Writer | None = None, visitor_callback: ~typing.Annotated[~typing.Callable[[...], ~typing.Any], ~pydantic.functional_validators.BeforeValidator(func=~monkey_wrench.generic.models._function.validate_function_path, json_schema_input_type=PydanticUndefined)] | ~typing.Callable[[...], ~typing.Any] | None = None, reverse: bool = False, recursive: bool = True, post_visit_transform_function: ~typing.Annotated[~typing.Callable[[...], ~monkey_wrench.input_output._models.ReturnType], ~pydantic.functional_validators.BeforeValidator(func=~monkey_wrench.generic.models._function.validate_function_path, json_schema_input_type=PydanticUndefined)] | ~typing.Callable[[...], ~monkey_wrench.input_output._models.ReturnType] | None = None, end_datetime: ~typing.Annotated[~pydantic.types.AwareDatetime, ~pydantic.functional_validators.AfterValidator(func=~monkey_wrench.date_time.models._base.<lambda>)] | None = None, start_datetime: ~typing.Annotated[~pydantic.types.AwareDatetime, ~pydantic.functional_validators.AfterValidator(func=~monkey_wrench.date_time.models._base.<lambda>)] | None = None, parent_output_directory_path: ~typing.Annotated[~pathlib.Path, ~pydantic.types.PathType(path_type=dir), ~pydantic.functional_validators.AfterValidator(func=~monkey_wrench.input_output._types.<lambda>)], datetime_format_string: str = '%Y/%m/%d', reset_child_datetime_directory: bool = False, device: ~typing.Literal['cpu', 'cuda'] = 'cpu', sequence_length: ~typing.Annotated[int, ~annotated_types.Ge(ge=0)] = 16, temporal_overlap: ~typing.Annotated[int, ~annotated_types.Ge(ge=0)] = 0, tile_size: ~typing.Annotated[int, ~annotated_types.Gt(gt=0)] = 256, verbose: bool = True)[source]

Bases: DateTimeDirectory, DateTimePeriod, DirectoryVisitor, ModelFile, TempDirectory

Pydantic model for CHIMP retrievals.

__input_filepaths_as_strings(batch: list[Annotated[Path, PathType(path_type=file)]]) list[str]

Convert paths to strings and ensure each batch includes the same number of items as sequence length.

__run_for_single_batch(batch: list[Annotated[Path, PathType(path_type=file)]], retrieve_function: Callable) None

Helper function to perform a single CHIMP retrieval for a single batch.

run_for_single_batch() None[source]

Perform a single CHIMP retrieval for a single batch.

run_in_batches() None[source]

Perform CHIMP retrievals in batches.

device: Literal['cpu', 'cuda']
sequence_length: Annotated[int, Ge(ge=0)]
temporal_overlap: Annotated[int, Ge(ge=0)]
tile_size: Annotated[int, Gt(gt=0)]
verbose: bool

Submodules