aiida_amber.utils package¶
Submodules¶
aiida_amber.utils.node_utils module¶
Methods for dealing with various types of files and directories that are used in processes and add them to aiida nodes
- aiida_amber.utils.node_utils.check_filepath(input_files: list)[source]¶
Check if an input is a file or a path.
- Parameters:
input_files – The list of inputs to check
- Returns:
List of files and list of subdirs
- aiida_amber.utils.node_utils.format_link_label(filename: str) str[source]¶
Modified from: https://github.com/sphuber/aiida-shell/blob/master/src/aiida_shell/parsers/shell.py Format the link label from a given filename with prefix. Valid link labels can only contain alphanumeric characters and underscores, without consecutive underscores. So all characters that are not alphanumeric or an underscore are converted to underscores, where consecutive underscores are merged into one. Additional: Label cannot start with a number or underscore.
- Parameters:
filename – The filename.
- Returns:
The link label.
aiida_amber.utils.searchprevious module¶
Various functions for searching through previous AiiDA processes and appending nodes from previous processes to current process nodes.
- aiida_amber.utils.searchprevious.append_prev_nodes(qb, inputs, process_inputs, INPUT_DIR)[source]¶
Checks if previous processes exists for genericMD calcs and links the most recent SinglefileData type output nodes from previous processs as inputs to the new process if the file names match.
- Parameters:
qb (
aiida.orm.querybuilder.QueryBuilder) – The query entries of previous processes in the AiiDA databaseinputs (list) – Input files for the command to be run via AiiDA
process_inputs (dict) – All inputs for the current process to be submitted
INPUT_DIR – base directory where outputted files are stored.
- Returns:
Updated inputs for the current process
- Return type:
- aiida_amber.utils.searchprevious.build_query()[source]¶
Uses AiiDA querybuilder to find previously run processes and order from newest to oldest
- Returns:
the query entries
- Return type:
aiida.orm.querybuilder.QueryBuilder
- aiida_amber.utils.searchprevious.check_prev_process(qb)[source]¶
Wait for a previous process to finish if it is still running. The process state is checked every 10 seconds for up to 5 minutes and stops when the process state is set to finished. If a previous processes takes longer than 5 minutes, the latest submitted process is exited.
- Parameters:
qb (
aiida.orm.querybuilder.QueryBuilder) – The queries of previous processes in the AiiDA database
- aiida_amber.utils.searchprevious.find_previous_file_nodes(qb)[source]¶
For any previous processes, store nodes that are files into a list
- Parameters:
qb (
aiida.orm.querybuilder.QueryBuilder) – The queries of previous processes in the AiiDA database
- aiida_amber.utils.searchprevious.format_link_label(filename: str) str[source]¶
From https://github.com/sphuber/aiida-shell/blob/master/src/aiida_shell/parsers/shell.py Format the link label from a given filename. Valid link labels can only contain alphanumeric characters and underscores, without consecutive underscores. So all characters that are not alphanumeric or an underscore are converted to underscores, where consecutive underscores are merged into one.
- Parameters:
filename – The filename to convert to a label.
- Returns:
The link label used in AiiDA provenance graphs.
- aiida_amber.utils.searchprevious.link_previous_file_nodes(input_file_labels: dict, inputs: dict)[source]¶
For an incoming process, check if an input file is an output of a previous process. If this is the case, then rename the node with the new label
- Parameters:
input_file_labels – dictionary with keys of filenames and values the label for the node
inputs – dictionary used for all inputs for
Module contents¶
aiida_amber
A plugin for using Amber with AiiDA for molecular dymanics simulations.