scaffold.entrypoints
Submodules
Classes
Helper class that provides a standard way to create an ABC using |
Package Contents
- class scaffold.entrypoints.Entrypoint(config: ENTRYPOINT_CONFIG_TYPE, contexts: List[contextlib.AbstractContextManager] = None)
Bases:
abc.ABC,Generic[ENTRYPOINT_CONFIG_TYPE]Helper class that provides a standard way to create an ABC using inheritance.
Initialize entrypoint with a configuration of the specified type. Given context managers will be appended after the ones are found in the config.
- Parameters:
config (EntrypointConf) – The entrypoint configuration object of the specified type.
contexts (List[AbstractContextManager]) – Context managers that should be added next to the ones specified in the config.
- __call__(*args, **kwargs) Any
Wraps self.run() within initialized contexts. Arguments and keyword arguments will be passed to run().
- classmethod from_config_name_or_class(config_name_or_class: str | scaffold.hydra.config_helpers.StructuredConfig, config_dir: str = None, overrides: List[str] = None, contexts: List[contextlib.AbstractContextManager] = None) Entrypoint
Temporarily initialized hydra, composes the config and initialized the entrypoint.
- Parameters:
config_name_or_class (str) – Name of the config file or EntrypointConf class.
config_dir (str) – Absolute path to the directory that should be added to the searchpath.
overrides (List[str]) – Hydra overrides that get applied during config composition.
contexts (List[AbstractContextManager]) – Contexts that should be added to the ones defined in the config.
- Returns:
Initialized Entrypoint instance.
- abstractmethod run(*args, **kwargs) Any
Abstract function that has to be overwritten.
- config: ENTRYPOINT_CONFIG_TYPE