WriterAbstract#
- class WriterAbstract(params=None, **kwargs)#
Bases:
Generic[T_Source_contra,T_Data],ModuleAbstract class of Writer module.
- Parameters:
params (Any | None)
kwargs (Any)
- check_directories(calls)#
Check if directories are missing, and create them if necessary.
- Parameters:
calls (Sequence[tuple[T_Source_contra, T_Data]])
- Return type:
None
- check_directory(call)#
Check if directory is missing, and create it if necessary.
- Parameters:
call (tuple[T_Source_contra, T_Data])
- Return type:
None
- check_overwriting_calls(calls)#
Check if some calls have the same filename.
- Parameters:
calls (Sequence[tuple[T_Source_contra, T_Data]])
- Return type:
None
- get_metadata(**kwargs)#
Get information on how data was created.
Uses
metadata_generator.- Parameters:
kwargs (Any) – Options passed to
MetadataOptions- Return type:
- metadata_generator#
alias of
MetadataGenerator- Section options_cls#
Options for metadata generator.
- options_cls.methods: List[Unicode] | None#
-
Default value:
None
Manually specify methods to run. If left to None, all methods are run.
- options_cls.add_git_info: Bool#
-
Default value:
True
If True add information about git repository status.
- options_cls.params_exclude: List[Unicode]#
-
Default value:
['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.
- Not implemented:
implement in a module subclass.
- Parameters:
kwargs (Any) – Passed to the writing function.
call (tuple[T_Source_contra, T_Data])
- Return type:
- write(data, target=None, metadata_kwargs=None, **kwargs)#
Write data to file or store.
- Not implemented:
implement in a module subclass.
- Parameters:
target (T_Source_contra | Sequence[T_Source_contra] | None) – If None, target location(s) should be obtained via
DataInterface.get_source().metadata_kwargs (Mapping[str, Any] | None) – Passed to the
metadata_generator. SeeMetadataOptionsfor available options.kwargs (Any) – Passed to the writing function.
- Return type: