WriterAbstract#
- class WriterAbstract(params=None, **kwargs)#
Bases:
Generic[T_Source,T_Data],ModuleAbstract class of Writer plugin.
Manages metadata to (eventually) add to data before writing.
- Parameters:
params (t.Any | None)
- __weakref__#
list of weak references to the object
- add_git_metadata(script, meta)#
Add git information to meta dictionary.
- check_directories(calls)#
Check if directories are missing, and create them if necessary.
- check_directory(call)#
Check if directory is missing, and create it if necessary.
- check_overwriting_calls(calls)#
Check if some calls have the same filename.
- get_metadata(add_dataset_params=True, add_commit=True)#
Set some dataset attributes with information on how it was created.
Attributes are:
written_as_dataset: name of dataset class.created_by: hostname and filename of the python script usedcreated_with_params: a string representing the parameters,created_on: date of creationcreated_at_commit: if found, the HEAD commit hash.git_diff_short: if workdir is dirty, a list of modified filesgit_diff_long: if workdir is dirty, the full diff (truncated) atmetadata_max_diff_lines.
- Parameters:
- Return type:
- metadata_max_diff_lines = 30#
Maximum number of lines to include in diff.
- metadata_params_exclude: abc.Sequence[str] = ['dask.', 'log_']#
Prefixes of parameters to exclude from metadata attribute.
- send_calls(calls, **kwargs)#
Send multiple calls serially.
Check beforehand if there are filename conflicts betwen calls, and make sure the necessary (sub)directories are created if they not exist already.
- send_single_call(call, **kwargs)#
Execute a single call.
- write(data, target=None, **kwargs)#
Write data to file or store.