fetch_data_from_file

pyrcs.utils.fetch_data_from_file(cls, method, data_name, ext, update, dump_dir, verbose, data_dir=None, save_data_kwargs=None, **kwargs)[source]

Fetch/load desired data from a backup file, depending on the given parameters.

Parameters:
  • cls (object) – (an instance of) a class for a certain data cluster

  • method (str) – name of a method of the cls, which is used for collecting the data

  • data_name (str) – key to the dict-type data of a certain cluster

  • ext (bool | str) – whether to save the data as a file, or file extension

  • update (bool) – whether to do an update check (for the package data), defaults to False

  • dump_dir (str | os.PathLike[str] | None) – pathname of a directory where the data file is to be dumped, defaults to None

  • verbose (bool | int) – whether to print relevant information in console

  • data_dir (str | os.PathLike[str] | None) – pathname of a directory where the data is fetched, defaults to None

  • save_data_kwargs (dict | None) – equivalent of kwargs used by the function pyrcs.utils.save_data_to_file(), defaults to None

  • kwargs (Any) – [optional] parameters of the cls.``method`` being called

Returns:

data fetched for the desired cluster

Return type:

dict | None