Skip to content

Latest commit

 

History

History
69 lines (55 loc) · 2.45 KB

archive_profile.md

File metadata and controls

69 lines (55 loc) · 2.45 KB
jupytext kernelspec
text_representation
extension format_name format_version jupytext_version
.md
myst
0.13
1.11.4
display_name language name
Python 3
python
python3

(how-to:data:share:archive:profile)=

How to inspect an archive

This tutorial can be downloaded and run as a Jupyter Notebook: {nb-download}`archive_profile.ipynb` {octicon}`download`, together with the archive {download}`process.aiida`.

The AiiDA archive is a file format for long term storage of data from a particular profile. See {ref}how-to:share:archives for information on how to create and migrate an archive.

The easiest way to inspect the contents of an archive is to create a profile that "mounts" the archive as its data storage:

!verdi profile setup core.sqlite_zip -n --profile archive --filepath process.aiida

You can now inspect the contents of the process.aiida archive by using the archive profile in the same way you would a standard AiiDA profile. For example, you can start an interactive shell using verdi -p archive shell or if you are already in a notebook simply load the profile:

from aiida import load_profile
load_profile('archive', allow_switch=True)
A profile using the `core.sqlite_zip` storage is read-only.
It is therefore possible to query data, but trying to modify existing data or store new data will raise an exception.

Just as with a normal profile, we can now use the {py:class}~aiida.orm.QueryBuilder, to find and query for data:

from aiida import orm
process = orm.QueryBuilder().append(orm.ProcessNode).first(flat=True)
print(process)

and also use {py:class}~aiida.tools.visualization.graph.Graph, to visualize data provenance:

from aiida import orm
from aiida.tools.visualization import Graph
process = orm.QueryBuilder().append(orm.ProcessNode).first(flat=True)
graph = Graph(graph_attr={'rankdir': 'LR'})
graph.add_incoming(process, annotate_links='both')
graph.add_outgoing(process, annotate_links='both')
graph.graphviz

Once you are done inspecting the archive and you no longer want to keep the profile around, you can delete it:

verdi profile delete archive

You will be prompted whether you also want to keep the data. If you want to keep the process.aiida archive file, select not to delete the data.