colrev.ops.load.Load¶
- class Load(*, review_manager, notify_state_transition_operation=True, hide_load_explanation=False)[source]¶
Bases:
Operation
Load the records
Methods
Check the operation precondition
Conclude the operation (stop Docker containers)
Decorator for operations
Ensure that the file was only appended to.
Loads and returns a list of active source endpoints from the settings.
Loads records from a specified source into the review manager's dataset.
main
- rtype:
Any
Notify the review_manager about the next operation
Prepares a search source for loading records into the review manager's dataset.
Attributes
type
- check_precondition()¶
Check the operation precondition
- Return type:
None
- conclude()¶
Conclude the operation (stop Docker containers)
- Return type:
None
- classmethod decorate()¶
Decorator for operations
- Return type:
Callable
- ensure_append_only(file)[source]¶
Ensure that the file was only appended to.
This method must be called for all packages that work with an ex-post assignment of incremental IDs.
- Return type:
None
- load_active_sources(*, include_md=False)[source]¶
Loads and returns a list of active source endpoints from the settings.
- Return type:
list
- Returns:
list: A list of active source endpoint objects.
- load_source_records(source, *, keep_ids)[source]¶
Loads records from a specified source into the review manager’s dataset.
This method prepares the source for loading by calling setup_source_for_load and then proceeds to load the records. It takes into account whether the IDs of the records should be kept as is or generated anew.
- Return type:
None
- Args:
source: The search source package endpoint interface from which records are loaded. keep_ids: A boolean flag indicating whether to keep the original IDs of the records.
- notify(*, state_transition=True)¶
Notify the review_manager about the next operation
- Return type:
None
- setup_source_for_load(source, *, select_new_records=True)[source]¶
Prepares a search source for loading records into the review manager’s dataset.
This method initializes the loading process by selecting new records from the source based on the select_new_records flag. It then prepares the source records for import by filtering out already imported records if select_new_records is True.
- Return type:
None
- Args:
source: The search source package endpoint interface to prepare for loading. select_new_records: A boolean flag indicating whether to filter out records
that have already been imported. Defaults to True.