NodeConfig#

class maize.utilities.io.NodeConfig(python: ~pathlib.Path = <factory>, modules: list[str] = <factory>, commands: dict[str, ~pathlib.Path | str] = <factory>, scripts: dict[str, dict[~typing.Literal['interpreter', 'location'], ~pathlib.Path]] = <factory>, parameters: dict[str, ~typing.Any] = <factory>)[source]#

Bases: object

Node specific configuration.

Parameters:
  • python (pathlib.Path) – Python interpreter to use to run the node

  • modules (list[str]) – Map from callables to modules

  • scripts (dict[str, dict[Literal['interpreter', 'location'], pathlib.Path]]) – Map from callables to interpreter - script pairs

  • commands (dict[str, pathlib.Path | str]) – Paths to specific commands

  • parameters (dict[str, Any]) – Default parameter settings

__init__(python: ~pathlib.Path = <factory>, modules: list[str] = <factory>, commands: dict[str, ~pathlib.Path | str] = <factory>, scripts: dict[str, dict[~typing.Literal['interpreter', 'location'], ~pathlib.Path]] = <factory>, parameters: dict[str, ~typing.Any] = <factory>) None#

Methods

__init__([python, modules, commands, ...])

from_dict(data)

Generate from a dictionary.

generate_template(required_callables)

Generate a template configuration

generate_template_toml(name, required_callables)

Generate a template configuration as a TOML string

Attributes

python

modules

commands

scripts

parameters

classmethod from_dict(data: Any) Self[source]#

Generate from a dictionary.

Parameters:

data – Dictionary read in from a config file

generate_template(required_callables: list[str]) NodeConfigDict[source]#

Generate a template configuration

Parameters:

required_callables – The list of software to generate a template for

Returns:

Dictionary that can be serialized or used directly

Return type:

NodeConfigDict

generate_template_toml(name: str, required_callables: list[str]) str[source]#

Generate a template configuration as a TOML string

Parameters:

required_callables – The list of software to generate a template for

Returns:

TOML config string

Return type:

str