Data structures for mapping legacy JobCalculation data to new process attributes.
aiida.backends.general.migrations.calc_state.
StateMapping
Bases: tuple
tuple
__getnewargs__
Return self as a plain tuple. Used by copy and pickle.
__module__
__new__
Create new instance of StateMapping(state, process_state, exit_status, process_status)
__repr__
Return a nicely formatted representation string
__slots__
_asdict
Return a new dict which maps field names to their values.
_field_defaults
_fields
_fields_defaults
_make
Make a new StateMapping object from a sequence or iterable
_replace
Return a new StateMapping object replacing specified fields with new values
exit_status
Alias for field number 2
process_state
Alias for field number 1
process_status
Alias for field number 3
state
Alias for field number 0
SQL statements to detect invalid/ununderstood links for the provenance redesign migration.
Various utils that should be used during migrations and migrations tests because the AiiDA ORM cannot be used.
aiida.backends.general.migrations.utils.
delete_numpy_array_from_repository
Delete the numpy array with a given name from the repository corresponding to a node with a given uuid.
uuid – the UUID of the node
name – the name of the numpy array
dumps_json
Transforms all datetime object into isoformat and then returns the JSON.
ensure_repository_folder_created
Make sure that the repository sub folder for the node with the given UUID exists or create it.
uuid – UUID of the node
get_node_repository_sub_folder
Return the absolute path to the sub folder path within the repository of the node with the given UUID.
absolute path to node repository folder, i.e /some/path/repository/node/12/ab/c123134-a123/path
get_numpy_array_absolute_path
Return the absolute path of a numpy array with the given name in the repository of the node with the given uuid.
the absolute path of the numpy array file
get_object_from_repository
Return the content of a file with the given name in the repository sub folder of the given node.
name – name to use for the file
load_numpy_array_from_repository
Load and return a numpy array from the repository folder of a node.
uuid – the node UUID
name – the name under which to store the array
the numpy array
put_object_from_string
Write a file with the given content in the repository sub folder of the given node.
content – the content to write to the file
recursive_datetime_to_isoformat
Convert all datetime objects in the given value to string representations in ISO format.
value – a mapping, sequence or single value optionally containing datetime objects
store_numpy_array_in_repository
Store a numpy array in the repository folder of a node.
array – the numpy array to store