Updating AiiDA¶
Instructions¶
Warning
The following instructions are how to update from v0.12.*
to v1.0.0
.
Each version increase may come with its own necessary migrations and you should only ever update the version by one at a time.
To find the instructions for older versions, refer to the table below.
Finish all running calculations. After migrating your database, you will not be able to resume unfinished calculations. Data of finished calculations will of course be automatically migrated.
Finish all running legacy workflows. The legacy workflows are completely deprecated and all data will be removed from your database, so make sure to create a backup (see point 5).
Enter the python environment where AiiDA is installed
Stop the daemon using
verdi daemon stop
Create a backup of your database and repository
Warning
Once you have migrated your database, you can no longer go back to an older version of aiida-core
, unless you restore your database and repository from a backup of course.
In addition, the data migration can take quite some time depending on the size of your database, so please be patient.
Big databases of multiple millions of nodes can take up to a few hours to migrate.
Update your
aiida-core
installationIf you have installed AiiDA through
pip
simply run:pip install --upgrade aiida-core
If you have installed from the git repository using
pip install -e .
, first delete all the.pyc
files (find . -name "*.pyc" -delete
) before updating your branch.
Finally, after having upgraded the installation, migrate your database with
verdi -p <profile_name> database migrate
After the database migration finishes, you will be able to continue working with your existing data. However, backwards incompatible changes were introduced in the python API, so you probably will have to update your code and installed plugins.
Backwards incompatible changes¶
The following list covers the most important backward incompatible changes between aiida-core==0.12.*
and aiida-core==1.0.0
.
General¶
Reorganization of some second-level modules. Various classes and functions have been moved, renamed or replaced. See this page for the rules on the publicness of parts of the python API [#2357]
The module
aiida.work
has been renamed toaiida.engine
and reorganized significantly [#2524]The module
aiida.scheduler
has been renamed toaiida.schedulers
[#2498]The module
aiida.transport
has been renamed toaiida.transports
[#2498]The module
aiida.utils
has been removed and its contents have been placed in other places where appropriate [#2357]Requirements were moved from
setup_requirements.py
tosetup.json
[#2307]
ORM¶
In order to define a clearer interface for users to the AiiDA entities, and allow (in the future) to swap between different profiles, the underlying hierarchy of nodes and links has been reworked (and a new paradigm has been implemented, with a “frontend” class that all users will interact with, and a “backend” class that users should never use directly, that implements the interaction to the database with a common interface, independent of the underlying ORM). The reorganisation of nodes and linktypes is mostly invisible to the user, but existing import statements will need to be updated.
Refactoring the ORM [#2190][#2210][#2227][#2225][#2481][#2544]
Renamed the node classes for the various process types
WorkCalculation
toWorkChainNode
[#2192]FunctionCalculation
toWorkFunctionNode
[#2189]InlineCalculation
toCalcFunctionNode
[#2195]Reorganization of the
aiida.orm
module, all node sub classes are now located underaiida.orm.nodes
[#2402][#2497]Make
Code
a real sub class ofData
[#2193]Implement new link types [#2220]
CREATE
:CalculationNode -> Data
RETURN
:WorkflowNode -> Data
INPUT_CALC
:Data -> CalculationNode
INPUT_WORK
:Data -> WorkflowNode
CALL_CALC
:WorkflowNode -> CalculationNode
CALL_WORK
:WorkflowNode -> WorkflowNode
Moved the plugin factories to
aiida.plugins.factories
[#2498]Methods that operated on the repository of a
Node
instance have been moved to aRepository
utility that is exposed through theNode.repository
property [#2506]Removed the
Error
data sub class and its entry point [#2529]Removed the
FrozenDict
data sub class and its entry point [#2532]Renamed the
ParameterData
data sub class toDict
[#2517]
QueryBuilder
¶
Group
¶
Change group type strings [#2329]
data.upf.family
todata.upf
aiida.import
toauto.import
autogroup.run
toauto.run
custom ones to
user
Remove
Group.query
andGroup.group_query
methods have been removed [#2329]Renamed
type
column ofGroup
database model totype_string
[#2329]Renamed
name
column ofGroup
database model tolabel
[#2329]Class method
Group.get_or_create
has been removed, use the collection methodGroup.objects.get_or_create
insteadClass method
Group.get_from_string
has been removed, use the class methodGroup.get
instead
Node
¶
The column
type
has been renamed tonode_type
[#2522]The methods
get_inputs
,get_outputs
,get_inputs_dict
andget_outputs_dict
have been removed and replace byget_incoming
andget_outgoing
[#2236]Removed the link manager methods
Node.inp
andNode.out
and the functionality has partially been replaced by: [#2569]The link manager properties
inputs
andoutputs
for theCalculationNode
andWorkflowNode
classes.Added the
Data.creator
propertyAdded the
ProcessNode.caller
propertyFunctionality to traverse the graph with tab completion when there is no uniqueness on the label is no longer supported and
get_incoming
andget_outgoing
should be used instead.
The classes
Node
,ProcessNode
can no longer be stored but only their sub classes [#2301]
Data
¶
Kind.is_alloy()
has been changed to a propertyKind.is_alloy
[#2374]Kind.has_vacancies()
has been changed to a propertyKind.has_vacancies
[#2374]StructureData.is_alloy()
has been changed to a propertyStructureData.is_alloy
[#2374]StructureData.has_vacancies()
has been changed to a propertyStructureData.has_vacancies
[#2374]CifData._get_aiida_structure()
has been renamed toCifData.get_structure()
. [#2422]CifData
default library used inget_structure
to convert toStructureData
has been changed fromase
topymatgen
[#1257]SinglefileData
the methodsget_file_content
,add_path
andremove_path
have been removed in favor ofput_object_from_file
andget_content
[#2506]ArrayData.iterarrays()
has been renamed toArrayData.get_iterarrays()
. [#2422]TrajectoryData._get_cif()
has been renamed toTrajectoryData.get_cif()
. [#2422]TrajectoryData._get_aiida_structure()
has been renamed toTrajectoryData.get_structure()
. [#2422]StructureData._get_cif()
has been renamed toStructureData.get_cif()
. [#2422]Code.full_text_info()
has been renamed toCode.get_full_text_info()
. [#2422]Code.is_hidden()
has been renamed and changed toCode.hidden
property. [#2422]RemoteData.is_empty()
has been changed to a propertyRemoteData.is_empty
. [#2422]The arguments
stepids
andcells
of theTrajectoryData.set_trajectory()
method are made optional which has implications on the ordering of the arguments passed to this method. [#2422]The list of atomic symbols for
TrajectoryData
is no longer stored as array data but is now accessible through theTrajectoryData.symbols
attribute. [#2422]Removed deprecated methods
BandsData._prepare_dat_1
andBandsData._prepare_dat_2
[#3114]Removed deprecated method KpoinstData.bravais_lattice [#3114]
Removed deprecated method KpoinstData._set_bravais_lattice [#3114]
Removed deprecated method KpoinstData._get_or_create_bravais_lattice [#3114]
Removed deprecated method KpoinstData.set_kpoints_path [#3114]
Removed deprecated method KpoinstData._find_bravais_info [#3114]
Removed deprecated method KpoinstData.find_bravais_lattice [#3114]
Removed deprecated method KpoinstData.get_special_kpoints [#3114]
Process
¶
Inline calculations¶
The
make_inline
andoptional_inline
decorators have been replaced bycalcfunction
. [#2203]
JobCalculation
¶
In the new engine, it is not possible to launch calculation jobs by first creating an instance of the Calculation and then calling the calculation.use_xxx
methods, as it was common in early versions of AiiDA.
Instead, you need to pass the correct Calculation class to the run
or submit
function, passing the nodes to link as input as kwargs
.
For the past few versions, we have kept back-compatibility by supporting both ways of submitting. In version 1.0 we have decided to keep only one single way of submitting calculations for simplicity.
JobCalculation
has been replaced byCalcJob
process class [#2389]Custom methods on the node class should now be implemented through a
CalculationTools
plugin [#2331]Explicit
set_
methods of theJobCalculation
have been replaced with genericset_option
method [#2361]Explicit
get_
methods of theJobCalculation
have been replaced with genericget_option
method [#1961]New calculation job states have been introduced set as an attribute, only to be used for querying [#2389]
The
DbCalcState
table that recorded the old job state ofJobCalculations
has been removed [#2389]
Parser
¶
parse_from_retrieved
has been renamed toparse
. In addition the arguments and return signatures have changed, for details see the PR [#2397]
WorkChain
¶
The free function
submit
in anyWorkChain
should be replaced withself.submit
.The future returned by
submit
no longer has thepid
attribute but ratherpk
.The
workfunction
decorator can only be used for functions that return one of the inputs they receive, for all other use thecalcfunction
The
get_inputs_template class
method has been replaced byget_builder
. See the section on the process builder in the documentation on how to use it.The
input_group
has been deprecated and been replaced by namespaces. See the section on ports in the documentation on how to use them.The use of a
.
(period) in output keys is not supported inProcess.out
because that is now reserved to indicate namespaces.
verdi
¶
The verdi
command line interface has been migrated over to a new system (called click
), making the interface of all verdi
commands consistent: now the way to specify a node (via a PK, a UUID or a LABEL) is the same for all commands, and command-line options that have the same meaning use the same flags in all commands.
To make this possible, the interface of various verdi commands has been changed to ensure consistency.
Also the output of most commands has been homogenised (e.g. to print errors or warnings always in the same style).
Moreover, some of the commands have been renamed to be consistent with the new names of the classes in AiiDA.
Removed
verdi data plugins
in favor ofverdi plugin list
[#3114]Removed
verdi code rename
in favor ofverdi code relabel
[#3114]Removed
verdi code update
in favor ofverdi code duplicate
[#3114]Removed
verdi work
in favor ofverdi process
[#2574]Removed
verdi calculation
in favor ofverdi process
andverdi calcjob
[#2574]Removed
verdi workflows
[#2379]Deprecated the commands to set and get config options
verdi devel *property*
in favor ofverdi config
[#2354]verdi code show
no longer shows number of calculations by default to improve performance, with--verbose
flag to restore old behavior [#1428]The tab-completion activation for
verdi
has changed, simply replace theeval "$(verdi completioncommand)"
line in your activation script witheval "$(_VERDI_COMPLETE-source verdi)"
Daemon¶
Schedulers¶
Renamed
aiida.daemon.execmanager.job_states
toJOB_STATES
, conforming to python conventions [#1799]Abstract method
aiida.scheduler.Scheduler._get_detailed_jobinfo_command()
raisesaiida.common.exceptions.FeatureNotAvailable
(wasNotImplemented
).Moved the
SchedulerFactory
toaiida.plugins.factories
[#2498]
Export import¶
New export archive format introduced
v0.6
. Older archives will automatically be converted when usingverdi import
, or alternatively can be manually exported usingverdi export migrate
Older versions¶
To determine the current version of your installation use verdi --version
.
If the command does not exist, you have an older version of AiiDA, in which case you need to get it from the aiida.__init__.py
file.
Update instructions for older versions can be found in the documentation of the corresponding version: