| |
- builtins.object
-
- BaseEnvironment
- builtins.tuple(builtins.object)
-
- Task
- TaskResult
class BaseEnvironment(builtins.object) |
|
BaseEnvironment(default_ns: str = '__root__', logger: logging.Logger = <Logger datazen.environment.base (WARNING)>, newline: str = '\n', **_) -> None
The base class for environment loading-and-storing management. |
|
Methods defined here:
- __init__(self, default_ns: str = '__root__', logger: logging.Logger = <Logger datazen.environment.base (WARNING)>, newline: str = '\n', **_) -> None
- Manage environments by names, set up a dictionary with a root
namespace.
- add_dir(self, dir_type: datazen.enums.DataType, dir_path: str, rel_path: str = '.', name: str = '__root__', allow_dup: bool = False) -> bool
- Proxy for add_dir for a namespace.
- add_dirs(self, dir_type: datazen.enums.DataType, dir_paths: List[str], rel_path: str = '.', name: str = '__root__', allow_dup: bool = False) -> int
- Proxy for add_dirs for a namespace.
- add_namespace(self, name: str, clone_root: bool = True) -> None
- Add a new namespace, optionally clone from the existing root.
- get_data(self, dir_type: datazen.enums.DataType, name: str = '__root__') -> Dict[str, Any]
- Get the raw data for a directory type from a namespace.
- get_namespace(self, key_name: str, target: str, target_data: Dict[str, Any]) -> str
- Determine the namespace that a target should use, in general they
all should be unique unless they don't load anything new.
- get_to_load(self, dir_type: datazen.enums.DataType, name: str = '__root__') -> List[Union[pathlib.Path, str, NoneType]]
- Proxy for a namespace's get_to_load.
- get_valid(self, name: str = '__root__') -> bool
- Get the 'valid' flag for a namespace.
- set_valid(self, value: bool, name: str = '__root__') -> None
- Set the 'valid' flag for a namespace.
- unload_all(self, name: str = '__root__') -> None
- Unload all of the directories for a namespace.
- update_load_state(self, dir_type: datazen.enums.DataType, to_load: List[Union[pathlib.Path, str, NoneType]], name: str = '__root__') -> int
- Proxy for update_load_state for a namespace.
Data descriptors defined here:
- __dict__
- dictionary for instance variables
- __weakref__
- list of weak references to the object
|
class Task(builtins.tuple) |
|
Task(variant: str, name: str)
Parameters identifying a task. |
|
- Method resolution order:
- Task
- builtins.tuple
- builtins.object
Methods defined here:
- __getnewargs__(self)
- Return self as a plain tuple. Used by copy and pickle.
- __repr__(self)
- Return a nicely formatted representation string
- _asdict(self)
- Return a new dict which maps field names to their values.
- _replace(self, /, **kwds)
- Return a new Task object replacing specified fields with new values
Class methods defined here:
- _make(iterable) from builtins.type
- Make a new Task object from a sequence or iterable
Static methods defined here:
- __new__(_cls, variant: str, name: str)
- Create new instance of Task(variant, name)
Readonly properties defined here:
- slug
- Convert this task into its 'slug' form.
Data descriptors defined here:
- variant
- Alias for field number 0
- name
- Alias for field number 1
Data and other attributes defined here:
- __annotations__ = {'name': <class 'str'>, 'variant': <class 'str'>}
- __match_args__ = ('variant', 'name')
- __orig_bases__ = (<function NamedTuple>,)
- _field_defaults = {}
- _fields = ('variant', 'name')
Methods inherited from builtins.tuple:
- __add__(self, value, /)
- Return self+value.
- __contains__(self, key, /)
- Return bool(key in self).
- __eq__(self, value, /)
- Return self==value.
- __ge__(self, value, /)
- Return self>=value.
- __getattribute__(self, name, /)
- Return getattr(self, name).
- __getitem__(self, key, /)
- Return self[key].
- __gt__(self, value, /)
- Return self>value.
- __hash__(self, /)
- Return hash(self).
- __iter__(self, /)
- Implement iter(self).
- __le__(self, value, /)
- Return self<=value.
- __len__(self, /)
- Return len(self).
- __lt__(self, value, /)
- Return self<value.
- __mul__(self, value, /)
- Return self*value.
- __ne__(self, value, /)
- Return self!=value.
- __rmul__(self, value, /)
- Return value*self.
- count(self, value, /)
- Return number of occurrences of value.
- index(self, value, start=0, stop=9223372036854775807, /)
- Return first index of value.
Raises ValueError if the value is not present.
Class methods inherited from builtins.tuple:
- __class_getitem__(...) from builtins.type
- See PEP 585
|
class TaskResult(builtins.tuple) |
|
TaskResult(success: bool, fresh: bool, time_ns: int = -1)
Return value for a task, express whether or not the task succeeded and if
this tasks' result should be considered 'new' from the last time it was
evaluated. |
|
- Method resolution order:
- TaskResult
- builtins.tuple
- builtins.object
Methods defined here:
- __eq__(self, other: object) -> bool
- Don't compare timing when checking equivalence.
- __getnewargs__(self)
- Return self as a plain tuple. Used by copy and pickle.
- __repr__(self)
- Return a nicely formatted representation string
- _asdict(self)
- Return a new dict which maps field names to their values.
- _replace(self, /, **kwds)
- Return a new TaskResult object replacing specified fields with new values
- log(self, task: datazen.environment.base.Task, logger: logging.Logger, level: int = 10) -> None
- Log status based on this task result.
- with_time(self, time_ns: int) -> 'TaskResult'
- Create a new result from this one, with the time set.
Class methods defined here:
- _make(iterable) from builtins.type
- Make a new TaskResult object from a sequence or iterable
Static methods defined here:
- __new__(_cls, success: bool, fresh: bool, time_ns: int = -1)
- Create new instance of TaskResult(success, fresh, time_ns)
Data descriptors defined here:
- success
- Alias for field number 0
- fresh
- Alias for field number 1
- time_ns
- Alias for field number 2
Data and other attributes defined here:
- __annotations__ = {'fresh': <class 'bool'>, 'success': <class 'bool'>, 'time_ns': <class 'int'>}
- __match_args__ = ('success', 'fresh', 'time_ns')
- __orig_bases__ = (<function NamedTuple>,)
- _field_defaults = {'time_ns': -1}
- _fields = ('success', 'fresh', 'time_ns')
Methods inherited from builtins.tuple:
- __add__(self, value, /)
- Return self+value.
- __contains__(self, key, /)
- Return bool(key in self).
- __ge__(self, value, /)
- Return self>=value.
- __getattribute__(self, name, /)
- Return getattr(self, name).
- __getitem__(self, key, /)
- Return self[key].
- __gt__(self, value, /)
- Return self>value.
- __hash__(self, /)
- Return hash(self).
- __iter__(self, /)
- Implement iter(self).
- __le__(self, value, /)
- Return self<=value.
- __len__(self, /)
- Return len(self).
- __lt__(self, value, /)
- Return self<value.
- __mul__(self, value, /)
- Return self*value.
- __ne__(self, value, /)
- Return self!=value.
- __rmul__(self, value, /)
- Return value*self.
- count(self, value, /)
- Return number of occurrences of value.
- index(self, value, start=0, stop=9223372036854775807, /)
- Return first index of value.
Raises ValueError if the value is not present.
Class methods inherited from builtins.tuple:
- __class_getitem__(...) from builtins.type
- See PEP 585
| |