dacapo.options

Attributes

logger

Classes

DaCapoConfig

Configuration class for DaCapo.

Options

A class that provides options for configuring DaCapo.

Module Contents

dacapo.options.logger
class dacapo.options.DaCapoConfig

Configuration class for DaCapo.

type

The type of store to use for storing configurations and statistics.

Type:

str

runs_base_dir

The path at DaCapo will use for reading and writing any necessary data.

Type:

Path

compute_context

The configuration for the compute context to use.

Type:

dict

mongo_db_host

The host of the MongoDB instance to use for storing configurations and statistics.

Type:

Optional[str]

mongo_db_name

The name of the MongoDB database to use for storing configurations and statistics.

Type:

Optional[str]

serialize()

Serialize the DaCapoConfig object.

type: str
runs_base_dir: upath.UPath
compute_context: dict
mongo_db_host: str | None
mongo_db_name: str | None
serialize()

Serialize the DaCapoConfig object.

Returns:

The serialized representation of the DaCapoConfig object.

Return type:

dict

Examples

>>> config = DaCapoConfig()
>>> config.serialize()
{'type': 'files', 'runs_base_dir': '/home/user/dacapo', 'compute_context': {'type': 'LocalTorch', 'config': {}}, 'mongo_db_host': None, 'mongo_db_name': None}
class dacapo.options.Options

A class that provides options for configuring DaCapo.

This class is designed as a singleton and should be accessed using the instance method.

instance()

Returns an instance of the Options class.

config_file()

Returns the path to the configuration file.

__parse_options_from_file()

Parses options from the configuration file.

__parse_options()

Parses options from the configuration file and updates them with the provided kwargs.

classmethod instance(**kwargs) DaCapoConfig

Returns an instance of the Options class.

Parameters:

kwargs – Additional keyword arguments to update the options.

Returns:

An instance of the DaCapoConfig class.

Examples

>>> options = Options.instance()
>>> options
DaCapoConfig(type='files', runs_base_dir=PosixPath('/home/user/dacapo'), compute_context={'type': 'LocalTorch', 'config': {}}, mongo_db_host=None, mongo_db_name=None)
classmethod config_file() upath.UPath | None

Returns the path to the configuration file.

Returns:

The path to the configuration file if found, otherwise None.

Examples

>>> Options.config_file()
PosixPath('/home/user/.config/dacapo/dacapo.yaml')