pyiron_contrib.image.utils module
- class pyiron_contrib.image.utils.DistributingList(initlist=None)[source]
Bases:
UserList
A list-like class which resolves attribute and function calls by returning a list-like class of the corresponding call on each child object.
- class pyiron_contrib.image.utils.LockedIfAttributeTrue(default, attribute_name)[source]
Bases:
LoggerMixin
A descriptor which prevents modification when the provided attribute of the owning instance is True.
Educational credit goes to: https://nbviewer.jupyter.org/urls/gist.github.com/ChrisBeaumont/5758381/raw/descriptor_writeup.ipynb
- default
The default value for the descriptor.
- attribute_name
The name of the attribute to look for in the owner instance when determining lock state.
- Type
str
- data
A container to track instances.
- Type
weakref.WeakKeyDictionary
- name
The name of the attribute the descriptor is being assigned to.
- Type
str
- class pyiron_contrib.image.utils.ModuleScraper(module, decorator=None, decorator_args=None, safe=True, recursive=True, scrape_functions=True, scrape_classes=True, scrape_primitives=True, primitives_list=None)[source]
Bases:
object
A class which scrapes through a module and applies classes and primitives found as attributes of itself, functions found as methods of itself, and sub-modules found recursively as new ModuleScraper attributes of itself.
A decorator can optionally be applied to all functions found. This is the real strength, since
Note
Doesn’t do anything until its activate method is called.
- safe
Whether to skip values beginning with an underscore. (Default is True, do skip.)
- Type
bool
- recursive
Whether to recursively activate submodules. (Default is False: submodules are noted by creating a new ModuleScraper instance and setting it as an attribute, but contents cannot be accessed until the submodule itself is explicitly activated.)
- Type
bool
- scrape_functions
Whether to look for functions in the module. (Default is True.)
- Type
bool
- scrape_classes
Whether to look for class definitions in the module. (Default is True.)
- Type
bool
- scrape_primitives
Whether to look for primitives in the module. (Default is True.)
- Type
bool
- primitives_list
A list of which types count as primitive. (Default is None, which uses (int, float, bool, numpy.ndarray).)
- Type
tuple/list
- activate()[source]
Parse the module assigned at instantiation, using decorator information assigned at instantiation.
- primitives_list
A descriptor which prevents modification when the provided attribute of the owning instance is True.
Educational credit goes to: https://nbviewer.jupyter.org/urls/gist.github.com/ChrisBeaumont/5758381/raw/descriptor_writeup.ipynb
- default
The default value for the descriptor.
- attribute_name
The name of the attribute to look for in the owner instance when determining lock state.
- Type
str
- data
A container to track instances.
- Type
weakref.WeakKeyDictionary
- name
The name of the attribute the descriptor is being assigned to.
- Type
str
- recursive
A descriptor which prevents modification when the provided attribute of the owning instance is True.
Educational credit goes to: https://nbviewer.jupyter.org/urls/gist.github.com/ChrisBeaumont/5758381/raw/descriptor_writeup.ipynb
- default
The default value for the descriptor.
- attribute_name
The name of the attribute to look for in the owner instance when determining lock state.
- Type
str
- data
A container to track instances.
- Type
weakref.WeakKeyDictionary
- name
The name of the attribute the descriptor is being assigned to.
- Type
str
- safe
A descriptor which prevents modification when the provided attribute of the owning instance is True.
Educational credit goes to: https://nbviewer.jupyter.org/urls/gist.github.com/ChrisBeaumont/5758381/raw/descriptor_writeup.ipynb
- default
The default value for the descriptor.
- attribute_name
The name of the attribute to look for in the owner instance when determining lock state.
- Type
str
- data
A container to track instances.
- Type
weakref.WeakKeyDictionary
- name
The name of the attribute the descriptor is being assigned to.
- Type
str
- scrape_classes
A descriptor which prevents modification when the provided attribute of the owning instance is True.
Educational credit goes to: https://nbviewer.jupyter.org/urls/gist.github.com/ChrisBeaumont/5758381/raw/descriptor_writeup.ipynb
- default
The default value for the descriptor.
- attribute_name
The name of the attribute to look for in the owner instance when determining lock state.
- Type
str
- data
A container to track instances.
- Type
weakref.WeakKeyDictionary
- name
The name of the attribute the descriptor is being assigned to.
- Type
str
- scrape_functions
A descriptor which prevents modification when the provided attribute of the owning instance is True.
Educational credit goes to: https://nbviewer.jupyter.org/urls/gist.github.com/ChrisBeaumont/5758381/raw/descriptor_writeup.ipynb
- default
The default value for the descriptor.
- attribute_name
The name of the attribute to look for in the owner instance when determining lock state.
- Type
str
- data
A container to track instances.
- Type
weakref.WeakKeyDictionary
- name
The name of the attribute the descriptor is being assigned to.
- Type
str
- scrape_primitives
A descriptor which prevents modification when the provided attribute of the owning instance is True.
Educational credit goes to: https://nbviewer.jupyter.org/urls/gist.github.com/ChrisBeaumont/5758381/raw/descriptor_writeup.ipynb
- default
The default value for the descriptor.
- attribute_name
The name of the attribute to look for in the owner instance when determining lock state.
- Type
str
- data
A container to track instances.
- Type
weakref.WeakKeyDictionary
- name
The name of the attribute the descriptor is being assigned to.
- Type
str