sdq.io.HParams#

class scdiffeq.io.HParams(yaml_path: Path | str)[source]#

scDiffEq container for HyperParams

_yaml_path#

Path to the hparams file created by Lightning.

Type:

Union[Path, str]

_yaml_file#

Dictionary containing the contents of the yaml file.

Type:

dict

_attrs#

Formatted attribute dictionary from hparams.yaml.

Type:

Dict[str, Any]

Initialize the HParams object by providing a path to thecorresponding yaml file (created by Lightning)

Parameters:

yaml_path (Union[Path, str]) – Path to the hparams file created by Lightning.

Returns:

None

__init__(yaml_path: Path | str) None[source]#

Initialize the HParams object by providing a path to thecorresponding yaml file (created by Lightning)

Parameters:

yaml_path (Union[Path, str]) – Path to the hparams file created by Lightning.

Returns:

None

_read() None[source]#

Read path to yaml file and set as class attribute

Returns:

None

__configure__(kwargs, private=['yaml_path']) None[source]#

Set hparams as class attributes

Parameters:
  • kwargs (dict) – Dictionary of keyword arguments.

  • private (list, optional) – List of private attributes, by default [“yaml_path”]

Returns:

None

__getitem__(attr: str) Any[source]#

Format version key and return path

Parameters:

attr (str) – Attribute name.

Returns:

Any Attribute value.

__repr__() str[source]#

Return a readable representation of the discovered hyperparameters

Returns:

str Readable representation of the hyperparameters.

__call__() Dict[str, Any][source]#

Return formatted dictionary of attributes from the hparams.yaml

Returns:

Dict[str, Any] Dictionary of attributes.