aiida.backends.sqlalchemy.models package

Submodules

class aiida.backends.sqlalchemy.models.authinfo.DbAuthInfo(*args, **kwargs)[source]

Bases: sqlalchemy.ext.declarative.api.Model

__init__(*args, **kwargs)
__mapper__ = <Mapper at 0x7f09c9986f10; DbAuthInfo>
__module__ = 'aiida.backends.sqlalchemy.models.authinfo'
__str__() <==> str(x)[source]
__table__ = Table('db_dbauthinfo', MetaData(bind=None), Column('id', Integer(), table=<db_dbauthinfo>, primary_key=True, nullable=False), Column('aiidauser_id', Integer(), ForeignKey('db_dbuser.id'), table=<db_dbauthinfo>), Column('dbcomputer_id', Integer(), ForeignKey('db_dbcomputer.id'), table=<db_dbauthinfo>), Column('metadata', JSONB(), table=<db_dbauthinfo>), Column('auth_params', JSONB(), table=<db_dbauthinfo>), Column('enabled', Boolean(), table=<db_dbauthinfo>), schema=None)
__table_args__ = (UniqueConstraint(Column('aiidauser_id', Integer(), ForeignKey('db_dbuser.id'), table=<db_dbauthinfo>), Column('dbcomputer_id', Integer(), ForeignKey('db_dbcomputer.id'), table=<db_dbauthinfo>)),)
__tablename__ = 'db_dbauthinfo'
_metadata
_sa_class_manager = {'_metadata': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c9abbc50>, 'aiidauser': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c9abba70>, 'aiidauser_id': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c9abbdd0>, 'auth_params': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c9abbf50>, 'dbcomputer': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c9abbb90>, 'dbcomputer_id': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c9abbe90>, 'enabled': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c994d050>, 'id': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c9abbd10>}
aiidauser
aiidauser_id
auth_params
dbcomputer
dbcomputer_id
enabled
get_auth_params()[source]
get_transport()[source]

Given a computer and an aiida user (as entries of the DB) return a configured transport to connect to the computer.

get_workdir()[source]
id
set_auth_params(auth_params)[source]
class aiida.backends.sqlalchemy.models.base.Model[source]

Bases: object

__dict__ = dict_proxy({'__module__': 'aiida.backends.sqlalchemy.models.base', 'session': <aiida.backends.sqlalchemy.models.base._SessionProperty object>, '__dict__': <attribute '__dict__' of 'Model' objects>, 'query': <aiida.backends.sqlalchemy.models.base._QueryProperty object>, 'save': <function save>, '__weakref__': <attribute '__weakref__' of 'Model' objects>, '__doc__': None, 'delete': <function delete>})
__module__ = 'aiida.backends.sqlalchemy.models.base'
__weakref__

list of weak references to the object (if defined)

delete(commit=True)[source]
query = None
save(commit=True)[source]
session
class aiida.backends.sqlalchemy.models.base._AiidaQuery(*args, **kwargs)[source]

Bases: sqlalchemy.orm.query.Query

__init__(*args, **kwargs)[source]

Constructor

__iter__()[source]
__module__ = 'aiida.backends.sqlalchemy.models.base'
class aiida.backends.sqlalchemy.models.base._QueryProperty(query_class=<class 'sqlalchemy.orm.query.Query'>)[source]

Bases: object

__dict__ = dict_proxy({'__module__': 'aiida.backends.sqlalchemy.models.base', '__dict__': <attribute '__dict__' of '_QueryProperty' objects>, '__weakref__': <attribute '__weakref__' of '_QueryProperty' objects>, '__doc__': None, '__init__': <function __init__>, '__get__': <function __get__>})
__get__(obj, _type)[source]
__init__(query_class=<class 'sqlalchemy.orm.query.Query'>)[source]

x.__init__(…) initializes x; see help(type(x)) for signature

__module__ = 'aiida.backends.sqlalchemy.models.base'
__weakref__

list of weak references to the object (if defined)

class aiida.backends.sqlalchemy.models.base._SessionProperty[source]

Bases: object

__dict__ = dict_proxy({'__dict__': <attribute '__dict__' of '_SessionProperty' objects>, '__module__': 'aiida.backends.sqlalchemy.models.base', '__weakref__': <attribute '__weakref__' of '_SessionProperty' objects>, '__doc__': None, '__get__': <function __get__>})
__get__(obj, _type)[source]
__module__ = 'aiida.backends.sqlalchemy.models.base'
__weakref__

list of weak references to the object (if defined)

class aiida.backends.sqlalchemy.models.comment.DbComment(**kwargs)[source]

Bases: sqlalchemy.ext.declarative.api.Model

__init__(**kwargs)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

__mapper__ = <Mapper at 0x7f09c99bed10; DbComment>
__module__ = 'aiida.backends.sqlalchemy.models.comment'
__str__() <==> str(x)[source]
__table__ = Table('db_dbcomment', MetaData(bind=None), Column('id', Integer(), table=<db_dbcomment>, primary_key=True, nullable=False), Column('uuid', UUID(as_uuid=True), table=<db_dbcomment>, default=ColumnDefault(<function <lambda>>)), Column('dbnode_id', Integer(), ForeignKey('db_dbnode.id'), table=<db_dbcomment>), Column('ctime', DateTime(timezone=True), table=<db_dbcomment>, default=ColumnDefault(<function <lambda>>)), Column('mtime', DateTime(timezone=True), table=<db_dbcomment>, default=ColumnDefault(<function <lambda>>)), Column('user_id', Integer(), ForeignKey('db_dbuser.id'), table=<db_dbcomment>), Column('content', Text(), table=<db_dbcomment>), schema=None)
__tablename__ = 'db_dbcomment'
_sa_class_manager = {'content': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c994dad0>, 'ctime': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c994d890>, 'dbnode': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c994d410>, 'dbnode_id': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c994d7d0>, 'id': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c994d650>, 'mtime': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c994d950>, 'user': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c994d590>, 'user_id': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c994da10>, 'uuid': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c994d710>}
content
ctime
dbnode
dbnode_id
id
mtime
user
user_id
uuid
class aiida.backends.sqlalchemy.models.computer.DbComputer(*args, **kwargs)[source]

Bases: sqlalchemy.ext.declarative.api.Model

__init__(*args, **kwargs)
__mapper__ = <Mapper at 0x7f09c9955750; DbComputer>
__module__ = 'aiida.backends.sqlalchemy.models.computer'
__str__() <==> str(x)[source]
__table__ = Table('db_dbcomputer', MetaData(bind=None), Column('id', Integer(), table=<db_dbcomputer>, primary_key=True, nullable=False), Column('uuid', UUID(as_uuid=True), table=<db_dbcomputer>, default=ColumnDefault(<function <lambda>>)), Column('name', String(length=255), table=<db_dbcomputer>, nullable=False), Column('hostname', String(length=255), table=<db_dbcomputer>), Column('description', Text(), table=<db_dbcomputer>), Column('enabled', Boolean(), table=<db_dbcomputer>), Column('transport_type', String(length=255), table=<db_dbcomputer>), Column('scheduler_type', String(length=255), table=<db_dbcomputer>), Column('transport_params', JSONB(), table=<db_dbcomputer>), Column('metadata', JSONB(), table=<db_dbcomputer>), schema=None)
__tablename__ = 'db_dbcomputer'
_metadata
_sa_class_manager = {'_metadata': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c994dd70>, 'authinfos': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09cbb2b4d0>, 'dbnodes': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09cc76c590>, 'description': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c995e230>, 'enabled': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c995e2f0>, 'hostname': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c995e170>, 'id': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c994def0>, 'name': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c995e0b0>, 'scheduler_type': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c995e470>, 'transport_params': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c995e530>, 'transport_type': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c995e3b0>, 'uuid': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c994dfb0>}
authinfos
dbnodes
description
enabled
get_aiida_class()[source]
classmethod get_dbcomputer(computer)[source]

Return a DbComputer from its name (or from another Computer or DbComputer instance)

get_shebang()[source]
get_workdir()[source]
hostname
id
name
pk
scheduler_type
transport_params
transport_type
uuid
class aiida.backends.sqlalchemy.models.group.DbGroup(**kwargs)[source]

Bases: sqlalchemy.ext.declarative.api.Model

__init__(**kwargs)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

__mapper__ = <Mapper at 0x7f09c997ba10; DbGroup>
__module__ = 'aiida.backends.sqlalchemy.models.group'
__str__() <==> str(x)[source]
__table__ = Table('db_dbgroup', MetaData(bind=None), Column('id', Integer(), table=<db_dbgroup>, primary_key=True, nullable=False), Column('uuid', UUID(as_uuid=True), table=<db_dbgroup>, default=ColumnDefault(<function <lambda>>)), Column('name', String(length=255), table=<db_dbgroup>), Column('type', String(length=255), table=<db_dbgroup>, default=ColumnDefault('')), Column('time', DateTime(timezone=True), table=<db_dbgroup>, default=ColumnDefault(<function <lambda>>)), Column('description', Text(), table=<db_dbgroup>), Column('user_id', Integer(), ForeignKey('db_dbuser.id'), table=<db_dbgroup>), schema=None)
__table_args__ = (UniqueConstraint(Column('name', String(length=255), table=<db_dbgroup>), Column('type', String(length=255), table=<db_dbgroup>, default=ColumnDefault(''))),)
__tablename__ = 'db_dbgroup'
_sa_class_manager = {'dbnodes': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c995ea10>, 'description': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c995ee90>, 'id': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c995ead0>, 'name': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c995ec50>, 'time': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c995edd0>, 'type': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c995ed10>, 'user': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c995e890>, 'user_id': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c995ef50>, 'uuid': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c995eb90>}
dbnodes
description
get_aiida_class()[source]
id
name
pk
time
type
user
user_id
uuid
class aiida.backends.sqlalchemy.models.lock.DbLock(**kwargs)[source]

Bases: sqlalchemy.ext.declarative.api.Model

__init__(**kwargs)
__mapper__ = <Mapper at 0x7f09c9970190; DbLock>
__module__ = 'aiida.backends.sqlalchemy.models.lock'
__table__ = Table('db_dblock', MetaData(bind=None), Column('key', String(length=255), table=<db_dblock>, primary_key=True, nullable=False), Column('creation', DateTime(timezone=True), table=<db_dblock>, default=ColumnDefault(<function <lambda>>)), Column('timeout', Integer(), table=<db_dblock>), Column('owner', String(length=255), table=<db_dblock>), schema=None)
__tablename__ = 'db_dblock'
_sa_class_manager = {'creation': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c9973410>, 'key': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c9973290>, 'owner': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c9973590>, 'timeout': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c99734d0>}
creation
key
owner
timeout
class aiida.backends.sqlalchemy.models.log.DbLog(time, loggername='', levelname='', objname='', objpk=None, message=None, metadata=None)[source]

Bases: sqlalchemy.ext.declarative.api.Model

__init__(time, loggername='', levelname='', objname='', objpk=None, message=None, metadata=None)
__mapper__ = <Mapper at 0x7f09c9970950; DbLog>
__module__ = 'aiida.backends.sqlalchemy.models.log'
__str__() <==> str(x)[source]
__table__ = Table('db_dblog', MetaData(bind=None), Column('id', Integer(), table=<db_dblog>, primary_key=True, nullable=False), Column('time', DateTime(timezone=True), table=<db_dblog>, default=ColumnDefault(<function <lambda>>)), Column('loggername', String(length=255), table=<db_dblog>), Column('levelname', String(length=255), table=<db_dblog>), Column('objname', String(length=255), table=<db_dblog>), Column('objpk', Integer(), table=<db_dblog>), Column('message', Text(), table=<db_dblog>), Column('metadata', JSONB(), table=<db_dblog>), schema=None)
__tablename__ = 'db_dblog'
_metadata
_sa_class_manager = {'_metadata': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c9973890>, 'id': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c9973a10>, 'levelname': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c9973c50>, 'loggername': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c9973b90>, 'message': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c9973e90>, 'objname': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c9973d10>, 'objpk': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c9973dd0>, 'time': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c9973ad0>}
id
levelname
loggername
message
objname
objpk
time
class aiida.backends.sqlalchemy.models.node.DbCalcState(**kwargs)[source]

Bases: sqlalchemy.ext.declarative.api.Model

__init__(**kwargs)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

__mapper__ = <Mapper at 0x7f09c98fad90; DbCalcState>
__module__ = 'aiida.backends.sqlalchemy.models.node'
__table__ = Table('db_dbcalcstate', MetaData(bind=None), Column('id', Integer(), table=<db_dbcalcstate>, primary_key=True, nullable=False), Column('dbnode_id', Integer(), ForeignKey('db_dbnode.id'), table=<db_dbcalcstate>), Column('state', ChoiceType(length=255), table=<db_dbcalcstate>), Column('time', DateTime(timezone=True), table=<db_dbcalcstate>, default=ColumnDefault(<function <lambda>>)), schema=None)
__table_args__ = (UniqueConstraint(Column('dbnode_id', Integer(), ForeignKey('db_dbnode.id'), table=<db_dbcalcstate>), Column('state', ChoiceType(length=255), table=<db_dbcalcstate>)),)
__tablename__ = 'db_dbcalcstate'
_sa_class_manager = {'dbnode': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c98f9d70>, 'dbnode_id': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c98e0050>, 'id': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c98f9f50>, 'state': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c98e0110>, 'time': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c98e01d0>}
dbnode
dbnode_id
id
state
time

Bases: sqlalchemy.ext.declarative.api.Model

__init__(**kwargs)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

__mapper__ = <Mapper at 0x7f09c98eba10; DbLink>
__module__ = 'aiida.backends.sqlalchemy.models.node'
__str__() <==> str(x)[source]
__table__ = Table('db_dblink', MetaData(bind=None), Column('id', Integer(), table=<db_dblink>, primary_key=True, nullable=False), Column('input_id', Integer(), ForeignKey('db_dbnode.id'), table=<db_dblink>), Column('output_id', Integer(), ForeignKey('db_dbnode.id'), table=<db_dblink>), Column('label', String(length=255), table=<db_dblink>, nullable=False), Column('type', String(length=255), table=<db_dblink>), schema=None)
__table_args__ = ()
__tablename__ = 'db_dblink'
_sa_class_manager = {'id': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c98f5350>, 'input': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c98f5110>, 'input_id': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c98f5410>, 'label': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c98f5590>, 'output': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c98f5290>, 'output_id': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c98f54d0>, 'type': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c98f5650>}
id
input
input_id
label
output
output_id
type
class aiida.backends.sqlalchemy.models.node.DbNode(*args, **kwargs)[source]

Bases: sqlalchemy.ext.declarative.api.Model

__init__(*args, **kwargs)
__mapper__ = <Mapper at 0x7f09c98dfd10; DbNode>
__module__ = 'aiida.backends.sqlalchemy.models.node'
__str__() <==> str(x)[source]
__table__ = Table('db_dbnode', MetaData(bind=None), Column('id', Integer(), table=<db_dbnode>, primary_key=True, nullable=False), Column('uuid', UUID(as_uuid=True), table=<db_dbnode>, default=ColumnDefault(<function <lambda>>)), Column('type', String(length=255), table=<db_dbnode>), Column('label', String(length=255), table=<db_dbnode>, default=ColumnDefault('')), Column('description', Text(), table=<db_dbnode>, default=ColumnDefault('')), Column('ctime', DateTime(timezone=True), table=<db_dbnode>, default=ColumnDefault(<function <lambda>>)), Column('mtime', DateTime(timezone=True), table=<db_dbnode>, default=ColumnDefault(<function <lambda>>)), Column('nodeversion', Integer(), table=<db_dbnode>, default=ColumnDefault(1)), Column('public', Boolean(), table=<db_dbnode>, default=ColumnDefault(False)), Column('attributes', JSONB(), table=<db_dbnode>), Column('extras', JSONB(), table=<db_dbnode>), Column('dbcomputer_id', Integer(), ForeignKey('db_dbcomputer.id'), table=<db_dbnode>), Column('user_id', Integer(), ForeignKey('db_dbuser.id'), table=<db_dbnode>, nullable=False), schema=None)
__tablename__ = 'db_dbnode'
static _del_attr(d, key)[source]
_sa_class_manager = {'attributes': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c98e0d10>, 'ctime': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c98e0a10>, 'dbcomments': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09cbbf9830>, 'dbcomputer': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c98e03b0>, 'dbcomputer_id': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c98e0e90>, 'dbgroups': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09cbb4c830>, 'dbstates': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09cbbe38f0>, 'description': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c98e0950>, 'extras': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c98e0dd0>, 'id': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c98e0650>, 'inputs_q': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09cc76c710>, 'label': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c98e0890>, 'mtime': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c98e0ad0>, 'nodeversion': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c98e0b90>, 'outputs_q': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c98e0590>, 'public': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c98e0c50>, 'type': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c98e07d0>, 'user': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c98e04d0>, 'user_id': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c98e0f50>, 'uuid': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c98e0710>, 'workflow_step': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09cbb73170>}
static _set_attr(d, key, value)[source]
aiida_query = <aiida.backends.sqlalchemy.models.base._AiidaQuery object>
attributes
computer_name = <sqlalchemy.sql.elements.Label object>
ctime
dbcomments
dbcomputer
dbcomputer_id
dbgroups
dbstates
del_attr(key)[source]
del_extra(key)[source]
description
extras
get_aiida_class()[source]

Return the corresponding aiida instance of class aiida.orm.Node or a appropriate subclass.

get_simple_name(invalid_result=None)[source]

Return a string with the last part of the type name.

If the type is empty, use ‘Node’. If the type is invalid, return the content of the input variable invalid_result.

Parameters:invalid_result – The value to be returned if the node type is not recognized.
id
inputs
inputs_q
label
mtime
nodeversion
outputs
outputs_q
pk
public
reset_extras(new_extras)[source]
set_attr(key, value)[source]
set_extra(key, value)[source]
state = <sqlalchemy.sql.elements.Label object>
type
user
user_email = <sqlalchemy.sql.elements.Label object>
user_id
uuid
workflow_step
class aiida.backends.sqlalchemy.models.settings.DbSetting(**kwargs)[source]

Bases: sqlalchemy.ext.declarative.api.Model

__init__(**kwargs)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

__mapper__ = <Mapper at 0x7f09cb8f2d10; DbSetting>
__module__ = 'aiida.backends.sqlalchemy.models.settings'
__str__() <==> str(x)[source]
__table__ = Table('db_dbsetting', MetaData(bind=None), Column('id', Integer(), table=<db_dbsetting>, primary_key=True, nullable=False), Column('key', String(length=255), table=<db_dbsetting>, nullable=False), Column('val', JSONB(), table=<db_dbsetting>, default=ColumnDefault({})), Column('description', String(length=255), table=<db_dbsetting>, nullable=False, default=ColumnDefault('')), Column('time', DateTime(timezone=True), table=<db_dbsetting>, default=ColumnDefault(<UTC>)), schema=None)
__table_args__ = (UniqueConstraint(Column('key', String(length=255), table=<db_dbsetting>, nullable=False)),)
__tablename__ = 'db_dbsetting'
_sa_class_manager = {'description': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09cbd55410>, 'id': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09cbd550b0>, 'key': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09cbd55cb0>, 'time': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09cbd55e30>, 'val': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09cbd55950>}
classmethod del_value(key, only_children=False, subspecifier_value=None)[source]
description
get_description()[source]

This can be called on a given row and will get the corresponding description.

getvalue()[source]

This can be called on a given row and will get the corresponding value.

id
key
classmethod set_value(key, value, with_transaction=True, subspecifier_value=None, other_attribs={}, stop_if_existing=False)[source]
time
val
class aiida.backends.sqlalchemy.models.user.DbUser(email, first_name='', last_name='', institution='', **kwargs)[source]

Bases: sqlalchemy.ext.declarative.api.Model

__init__(email, first_name='', last_name='', institution='', **kwargs)
__mapper__ = <Mapper at 0x7f09c98c8f50; DbUser>
__module__ = 'aiida.backends.sqlalchemy.models.user'
__str__() <==> str(x)[source]
__table__ = Table('db_dbuser', MetaData(bind=None), Column('id', Integer(), table=<db_dbuser>, primary_key=True, nullable=False), Column('email', String(length=254), table=<db_dbuser>), Column('password', String(length=128), table=<db_dbuser>), Column('is_superuser', Boolean(), table=<db_dbuser>, nullable=False, default=ColumnDefault(False)), Column('first_name', String(length=254), table=<db_dbuser>), Column('last_name', String(length=254), table=<db_dbuser>), Column('institution', String(length=254), table=<db_dbuser>), Column('is_staff', Boolean(), table=<db_dbuser>, default=ColumnDefault(False)), Column('is_active', Boolean(), table=<db_dbuser>, default=ColumnDefault(False)), Column('last_login', DateTime(timezone=True), table=<db_dbuser>, default=ColumnDefault(<function <lambda>>)), Column('date_joined', DateTime(timezone=True), table=<db_dbuser>, default=ColumnDefault(<function <lambda>>)), schema=None)
__tablename__ = 'db_dbuser'
_sa_class_manager = {'authinfos': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09cbaf1fb0>, 'date_joined': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c98f9a10>, 'dbgroups': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09cbb4ccb0>, 'dbnodes': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09cc76c830>, 'email': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c98f9350>, 'first_name': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c98f95f0>, 'id': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c98f9230>, 'institution': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c98f9770>, 'is_active': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c98f98f0>, 'is_staff': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c98f9830>, 'is_superuser': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c98f94d0>, 'last_login': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c98f9950>, 'last_name': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c98f96b0>, 'password': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c98f9410>}
authinfos
date_joined
dbgroups
dbnodes
email
first_name
get_aiida_class()[source]
get_full_name()[source]
get_short_name()[source]
id
institution
is_active
is_staff
is_superuser
last_login
last_name
password
aiida.backends.sqlalchemy.models.utils.get_value_of_sub_field(key, original_get_value)[source]

Get the value that corresponds to sub-fields of dictionaries stored in a JSON. For example, if there is a dictionary {‘b’: ‘c’} stored as value of the key ‘a’ value ‘a’ :param key: The key that can be simple, a string, or complex, a set of keys separated by the separator value. :param original_get_value: The function that should be called to get the original value (which can be a dictionary too). :return: The value that correspond to the complex (or not) key. :raise NotExistent: If the key doesn’t correspond to a value

aiida.backends.sqlalchemy.models.utils.validate_key(key)[source]

Validate the key string to check if it is valid (e.g., if it does not contain the separator symbol.).

Returns:None if the key is valid
Raises:ValidationError – if the key is not valid
class aiida.backends.sqlalchemy.models.workflow.DbWorkflow(*args, **kwargs)[source]

Bases: sqlalchemy.ext.declarative.api.Model

__init__(*args, **kwargs)
__mapper__ = <Mapper at 0x7f09c9850ad0; DbWorkflow>
__module__ = 'aiida.backends.sqlalchemy.models.workflow'
__str__() <==> str(x)[source]
__table__ = Table('db_dbworkflow', MetaData(bind=None), Column('id', Integer(), table=<db_dbworkflow>, primary_key=True, nullable=False), Column('uuid', UUID(as_uuid=True), table=<db_dbworkflow>, default=ColumnDefault(<function <lambda>>)), Column('ctime', DateTime(timezone=True), table=<db_dbworkflow>, default=ColumnDefault(<function <lambda>>)), Column('mtime', DateTime(timezone=True), table=<db_dbworkflow>, default=ColumnDefault(<function <lambda>>)), Column('user_id', Integer(), ForeignKey('db_dbuser.id'), table=<db_dbworkflow>), Column('label', String(length=255), table=<db_dbworkflow>), Column('description', Text(), table=<db_dbworkflow>), Column('nodeversion', Integer(), table=<db_dbworkflow>), Column('lastsyncedversion', Integer(), table=<db_dbworkflow>), Column('state', ChoiceType(length=255), table=<db_dbworkflow>, default=ColumnDefault(u'INITIALIZED')), Column('report', Text(), table=<db_dbworkflow>), Column('module', Text(), table=<db_dbworkflow>), Column('module_class', Text(), table=<db_dbworkflow>), Column('script_path', Text(), table=<db_dbworkflow>), Column('script_md5', String(length=255), table=<db_dbworkflow>), schema=None)
__tablename__ = 'db_dbworkflow'
_get_or_create_data(name, data_type)[source]
_get_or_create_step(name, user)[source]
_sa_class_manager = {'ctime': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c98f5e90>, 'data': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c98f5c50>, 'description': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c9903770>, 'id': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c98f5d10>, 'label': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c99036b0>, 'lastsyncedversion': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c99038f0>, 'module': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c9903350>, 'module_class': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c9903410>, 'mtime': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c98f5fb0>, 'nodeversion': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c9903830>, 'parent_workflow_step': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09cbbfb1d0>, 'report': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c9903a70>, 'script_md5': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c9903590>, 'script_path': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c99034d0>, 'state': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c99039b0>, 'steps': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09cbb738f0>, 'user': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c98f59b0>, 'user_id': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c99035f0>, 'uuid': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c98f5dd0>}
add_attribute(name, value)[source]
add_attributes(_dict)[source]
add_data(dict, d_type)[source]
add_parameter(name, value)[source]
add_parameters(_dict, force=False)[source]
add_result(name, value)[source]
add_results(_dict)[source]
aiida_query = <aiida.backends.sqlalchemy.models.base._AiidaQuery object>
append_to_report(_text)[source]
clear_report()[source]
ctime
data
description
finish()[source]
get_aiida_class()[source]

Return the corresponding aiida instance of class aiida.worflow

get_attribute(name)[source]
get_attributes()[source]
get_calculations()[source]
get_data(d_type)[source]
get_parameter(name)[source]
get_parameters()[source]
get_result(name)[source]
get_results()[source]
get_sub_workflows()[source]
id
is_subworkflow()[source]

Return True if this is a subworkflow, False if it is a root workflow, launched by the user.

label
lastsyncedversion
module
module_class
mtime
nodeversion
parent_workflow_step
pk
report
script_md5
script_path
set_script_md5(md5)[source]
set_state(state)[source]
state
steps
user
user_id
uuid
class aiida.backends.sqlalchemy.models.workflow.DbWorkflowData(**kwargs)[source]

Bases: sqlalchemy.ext.declarative.api.Model

__init__(**kwargs)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

__mapper__ = <Mapper at 0x7f09c985d610; DbWorkflowData>
__module__ = 'aiida.backends.sqlalchemy.models.workflow'
__str__() <==> str(x)[source]
__table__ = Table('db_dbworkflowdata', MetaData(bind=None), Column('id', Integer(), table=<db_dbworkflowdata>, primary_key=True, nullable=False), Column('parent_id', Integer(), ForeignKey('db_dbworkflow.id'), table=<db_dbworkflowdata>), Column('name', String(length=255), table=<db_dbworkflowdata>), Column('time', DateTime(timezone=True), table=<db_dbworkflowdata>, default=ColumnDefault(<function <lambda>>)), Column('data_type', String(length=255), table=<db_dbworkflowdata>, default=ColumnDefault(u'PARAMETER')), Column('value_type', String(length=255), table=<db_dbworkflowdata>, default=ColumnDefault(u'NONE')), Column('json_value', Text(), table=<db_dbworkflowdata>), Column('aiida_obj_id', Integer(), ForeignKey('db_dbnode.id'), table=<db_dbworkflowdata>), schema=None)
__table_args__ = (UniqueConstraint(Column('parent_id', Integer(), ForeignKey('db_dbworkflow.id'), table=<db_dbworkflowdata>), Column('name', String(length=255), table=<db_dbworkflowdata>), Column('data_type', String(length=255), table=<db_dbworkflowdata>, default=ColumnDefault(u'PARAMETER'))),)
__tablename__ = 'db_dbworkflowdata'
_sa_class_manager = {'aiida_obj': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c9903110>, 'aiida_obj_id': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c986a170>, 'data_type': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c9903ef0>, 'id': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c9903290>, 'json_value': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c986a0b0>, 'name': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c9903d70>, 'parent': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09cbb73830>, 'parent_id': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c9903cb0>, 'time': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c9903e30>, 'value_type': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c9903fb0>}
aiida_obj
aiida_obj_id
data_type
get_or_create(**kwargs)[source]
get_value()[source]
id
json_value
name
parent
parent_id
set_value(arg)[source]
time
value_type
class aiida.backends.sqlalchemy.models.workflow.DbWorkflowStep(**kwargs)[source]

Bases: sqlalchemy.ext.declarative.api.Model

__init__(**kwargs)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

__mapper__ = <Mapper at 0x7f09c986fb10; DbWorkflowStep>
__module__ = 'aiida.backends.sqlalchemy.models.workflow'
__str__() <==> str(x)[source]
__table__ = Table('db_dbworkflowstep', MetaData(bind=None), Column('id', Integer(), table=<db_dbworkflowstep>, primary_key=True, nullable=False), Column('parent_id', Integer(), ForeignKey('db_dbworkflow.id'), table=<db_dbworkflowstep>), Column('user_id', Integer(), ForeignKey('db_dbuser.id'), table=<db_dbworkflowstep>), Column('name', String(length=255), table=<db_dbworkflowstep>), Column('time', DateTime(timezone=True), table=<db_dbworkflowstep>, default=ColumnDefault(<function <lambda>>)), Column('nextcall', String(length=255), table=<db_dbworkflowstep>, default=ColumnDefault('none')), Column('state', ChoiceType(length=255), table=<db_dbworkflowstep>, default=ColumnDefault(u'CREATED')), schema=None)
__table_args__ = (UniqueConstraint(Column('parent_id', Integer(), ForeignKey('db_dbworkflow.id'), table=<db_dbworkflowstep>), Column('name', String(length=255), table=<db_dbworkflowstep>)),)
__tablename__ = 'db_dbworkflowstep'
_sa_class_manager = {'calculations': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c986a5f0>, 'id': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c986a770>, 'name': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c986a9b0>, 'nextcall': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c986ab30>, 'parent': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c986a3b0>, 'parent_id': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c986a830>, 'state': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c986abf0>, 'sub_workflows': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c986a6b0>, 'time': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c986aa70>, 'user': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c986a530>, 'user_id': <sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x7f09c986a8f0>}
add_calculation(step_calculation)[source]
add_sub_workflow(sub_wf)[source]
calculations
finish()[source]
get_calculations(state=None)[source]
get_sub_workflows()[source]
id
is_finished()[source]
name
nextcall
parent
parent_id
reinitialize()[source]
remove_calculations()[source]
remove_sub_workflows()[source]
set_nextcall(_nextcall)[source]
set_state(_state)[source]
state
sub_workflows
time
user
user_id