aiida.orm.utils.builders package¶
Submodules¶
Manage code objects with lazy loading of the db env
-
class
aiida.orm.utils.builders.code.
CodeBuilder
(**kwargs)[source]¶ Bases:
object
Build a code with validation of attribute combinations
-
class
CodeType
[source]¶ Bases:
enum.Enum
-
ON_COMPUTER
= 'on computer'¶
-
STORE_AND_UPLOAD
= 'store in the db and upload'¶
-
__module__
= 'aiida.orm.utils.builders.code'¶
-
-
exception
CodeValidationError
(msg)[source]¶ Bases:
exceptions.Exception
A CodeBuilder instance may raise this
- when asked to instanciate a code with missing or invalid code attributes
- when asked for a code attibute that has not been set yet
-
__module__
= 'aiida.orm.utils.builders.code'¶
-
__weakref__
¶ list of weak references to the object (if defined)
-
__dict__
= dict_proxy({'__module__': 'aiida.orm.utils.builders.code', '_set_code_attr': <function _set_code_attr>, 'CodeValidationError': <class 'aiida.orm.utils.builders.code.CodeValidationError'>, 'validate_installed': <function validate_installed>, '_get_and_count': <function _get_and_count>, '_get': <function _get>, 'CodeType': <enum 'CodeType'>, '__dict__': <attribute '__dict__' of 'CodeBuilder' objects>, 'validate': <function validate>, '__weakref__': <attribute '__weakref__' of 'CodeBuilder' objects>, 'from_code': <staticmethod object>, '__init__': <function __init__>, 'validate_upload': <function validate_upload>, 'is_local': <function is_local>, '__setattr__': <function __setattr__>, '__getattr__': <function __getattr__>, 'validate_code_type': <function validate_code_type>, 'new': <function new>, '__doc__': 'Build a code with validation of attribute combinations', 'get_code_spec': <staticmethod object>})¶
-
__module__
= 'aiida.orm.utils.builders.code'¶
-
__weakref__
¶ list of weak references to the object (if defined)
-
_get_and_count
(key, used)[source]¶ Return a spec, or raise if not defined. Moreover, add the key to the ‘used’ dict.
Parameters: - key – name of a code spec
- used – should be a set of keys that you want to track.
key
will be added to this set if the value exists in the spec and can be retrieved.
-
_set_code_attr
(key, value)[source]¶ Set a code attribute, if it passes validation.
Checks compatibility with other code attributes.
-
static
from_code
(code)[source]¶ Create CodeBuilder from existing code instance.
See also
get_code_spec()
-
class
Manage computer objects with lazy loading of the db env
-
class
aiida.orm.utils.builders.computer.
ComputerBuilder
(**kwargs)[source]¶ Bases:
object
Build a computer with validation of attribute combinations
-
exception
ComputerValidationError
(msg)[source]¶ Bases:
exceptions.Exception
A ComputerBuilder instance may raise this
- when asked to instanciate a code with missing or invalid computer attributes
- when asked for a computer attibute that has not been set yet
-
__module__
= 'aiida.orm.utils.builders.computer'¶
-
__weakref__
¶ list of weak references to the object (if defined)
-
__dict__
= dict_proxy({'__module__': 'aiida.orm.utils.builders.computer', 'get_computer_spec': <staticmethod object>, '_get_and_count': <function _get_and_count>, '_set_computer_attr': <function _set_computer_attr>, '__getattr__': <function __getattr__>, 'from_computer': <staticmethod object>, '_get': <function _get>, 'ComputerValidationError': <class 'aiida.orm.utils.builders.computer.ComputerValidationError'>, '__dict__': <attribute '__dict__' of 'ComputerBuilder' objects>, 'new': <function new>, 'validate': <function validate>, '__setattr__': <function __setattr__>, '__weakref__': <attribute '__weakref__' of 'ComputerBuilder' objects>, '__doc__': 'Build a computer with validation of attribute combinations', '__init__': <function __init__>})¶
-
__module__
= 'aiida.orm.utils.builders.computer'¶
-
__weakref__
¶ list of weak references to the object (if defined)
-
_get_and_count
(key, used)[source]¶ Return a spec, or raise if not defined. Moreover, add the key to the ‘used’ dict.
Parameters: - key – name of a computer spec
- used – should be a set of keys that you want to track.
key
will be added to this set if the value exists in the spec and can be retrieved.
-
static
from_computer
(computer)[source]¶ Create ComputerBuilder from existing computer instance.
See also
get_computer_spec()
-
exception