aiida.backends.general package

Submodules

class aiida.backends.general.abstractqueries.AbstractQueryManager(backend)[source]

Bases: object

__abstractmethods__ = frozenset([])
__dict__ = dict_proxy({'_abc_cache': <_weakrefset.WeakSet object>, '__module__': 'aiida.backends.general.abstractqueries', 'get_duplicate_uuids': <function get_duplicate_uuids>, '_abc_negative_cache': <_weakrefset.WeakSet object>, 'get_bands_and_parents_structure': <function get_bands_and_parents_structure>, '_abc_registry': <_weakrefset.WeakSet object>, '__abstractmethods__': frozenset([]), '_abc_negative_cache_version': 40, 'get_creation_statistics': <function get_creation_statistics>, '__dict__': <attribute '__dict__' of 'AbstractQueryManager' objects>, 'get_all_parents': <function get_all_parents>, 'apply_new_uuid_mapping': <function apply_new_uuid_mapping>, '__weakref__': <attribute '__weakref__' of 'AbstractQueryManager' objects>, '__doc__': None, '__init__': <function __init__>})
__init__(backend)[source]
Parameters:backend (aiida.orm.implementation.sql.SqlBackend) – The AiiDA backend
__module__ = 'aiida.backends.general.abstractqueries'
__weakref__

list of weak references to the object (if defined)

_abc_cache = <_weakrefset.WeakSet object>
_abc_negative_cache = <_weakrefset.WeakSet object>
_abc_negative_cache_version = 40
_abc_registry = <_weakrefset.WeakSet object>
apply_new_uuid_mapping(table, mapping)[source]
get_all_parents(node_pks, return_values=('id', ))[source]

Get all the parents of given nodes :param node_pks: one node pk or an iterable of node pks :return: a list of aiida objects with all the parents of the nodes

get_bands_and_parents_structure(args)[source]

Search for bands and return bands and the closest structure that is a parent of the instance. This is the backend independent way, can be overriden for performance reason

Returns:
A list of sublists, each latter containing (in order):
pk as string, formula as string, creation date, bandsdata-label
get_creation_statistics(user_pk=None)[source]

Return a dictionary with the statistics of node creation, summarized by day.

Note:Days when no nodes were created are not present in the returned ctime_by_day dictionary.
Parameters:user_pk – If None (default), return statistics for all users. If user pk is specified, return only the statistics for the given user.
Returns:a dictionary as follows:
{
   "total": TOTAL_NUM_OF_NODES,
   "types": {TYPESTRING1: count, TYPESTRING2: count, ...},
   "ctime_by_day": {'YYYY-MMM-DD': count, ...}

where in ctime_by_day the key is a string in the format ‘YYYY-MM-DD’ and the value is an integer with the number of nodes created that day.

get_duplicate_uuids(table)[source]

Return a list of rows with identical UUID

Parameters:table – Database table with uuid column, e.g. ‘db_dbnode’
Returns:list of tuples of (id, uuid) of rows with duplicate UUIDs
Rtype list: