pydoit_nb.typing#

Typing specifications

ConfigBundleLike#

class ConfigBundleLike(*args, **kwargs)[source]#

Bases: Protocol[T_co]

Protocol for configuration bundles

property config_hydrated: T_co#

Hydrated config

property config_hydrated_path: Path#

Path in which to write the hydrated config

property root_dir_output_run: Path#

Root directory in which output is saved

property run_id: str#

Run ID for the run to which this config bundle applies

ConfigBundleCreator#

class ConfigBundleCreator(*args, **kwargs)[source]#

Bases: Protocol[AI_contra, CB_co]

Callable that can be used to create config bundles

Converter#

class Converter(*args, **kwargs)[source]#

Bases: Protocol

Protocol for converters

dumps(obj, sort_keys=False)[source]#

Dump configuration to a string

Parameters:
  • obj (typing.Any) – Object to dump. The type hints aren’t great here. The assumption is that the dumping protocol should handle any type issues (I think static typing doesn’t really work here, for reasons I don’t fully have my head around).

  • sort_keys (bool) – Should the keys be sorted in the output?

Returns:

str – String version of config

loads(inp, target)[source]#

Load an instance of target from a string

Parameters:
Returns:

typing.TypeVar(T) – Loaded instance of target

NotebookConfigLike#

class NotebookConfigLike(*args, **kwargs)[source]#

Bases: Protocol

A class which is like a notebook config

step_config_id: str#

String which identifies the step config to use with the notebook