fetch_data_from_file¶
- pyrcs.utils.fetch_data_from_file(cls_instance, method, data_name, ext, update, dump_dir, verbose, data_dir=None, save_data_kwargs=None, **kwargs)[source]¶
Fetches or loads data from a backup file based on the specified parameters.
- Parameters:
cls_instance (object) – An instance of a class managing a specific data cluster.
method (str) – The name of the method in
cls_instance
used to collect the data.data_name (str) – The key identifying the data within a specific cluster.
ext (bool | str) – The file extension or a boolean indicating whether to save the data.
update (bool) – Whether to perform an update check on the package data; defaults to
False
.dump_dir (str | pathlib.Path | None) – The directory where the file is stored; defaults to
None
.verbose (bool | int) – Whether to print detailed information to the console.
data_dir (str | os.PathLike[str] | None) – The directory where the data is fetched from; defaults to
None
.save_data_kwargs (dict | None) – Additional parameters for
pyrcs.utils.save_data_to_file()
; defaults toNone
.kwargs – [Optional] Additional parameters for the
cls_instance.method
being called.
- Returns:
The fetched data for the specified cluster.
- Return type:
dict | None