-
Notifications
You must be signed in to change notification settings - Fork 208
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🔀 MERGE: Release v2.0.0b1 #5426
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
280026e
👌 IMPROVE: Add `echo` functions to `aiida.cmdline.__all__`
chrisjsewell 10603d7
👌 IMPROVE: Add `JsonableData` to `aiida.orm.__all__`
chrisjsewell 52c6cff
📚 DOCS: Add "How to inspect an archive"
chrisjsewell d31c106
📚 DOCS: Enforce nitpicky mode
chrisjsewell 589ecfb
📚 DOCS: Auto-generate public API
chrisjsewell 79be423
📚 DOCS: Add links to AEPs
chrisjsewell 53e6461
📚 DOCS: Fix links to plugin writing
chrisjsewell 995f6de
📚 DOCS: Add `EnumData` and `JsonableData` sections
chrisjsewell 747c818
📚 DOCS: Add `CalcJobImporter` section
chrisjsewell cfa2c50
📚 DOCS: Improve plugin testing section
chrisjsewell 37c9f53
🔧 MAINTAIN: Add `py.typed` file
chrisjsewell 8b2f66d
🚀 RELEASE: v2.0.0b1
chrisjsewell File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -61,6 +61,7 @@ | |
'GroupEntityLoader', | ||
'ImportGroup', | ||
'Int', | ||
'JsonableData', | ||
'Kind', | ||
'KpointsData', | ||
'LinkManager', | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,6 +35,7 @@ | |
'Float', | ||
'FolderData', | ||
'Int', | ||
'JsonableData', | ||
'Kind', | ||
'KpointsData', | ||
'List', | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Marker file for PEP 561 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
--- | ||
jupytext: | ||
text_representation: | ||
extension: .md | ||
format_name: myst | ||
format_version: 0.13 | ||
jupytext_version: 1.11.4 | ||
kernelspec: | ||
display_name: Python 3 | ||
language: python | ||
name: python3 | ||
--- | ||
|
||
(how-to:data:share:archive:profile)= | ||
|
||
# How to inspect an archive | ||
|
||
```{note} | ||
This tutorial can be downloaded and run as a Jupyter Notebook: {nb-download}`archive_profile.ipynb` {octicon}`download`, together with the archive {download}`include/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. | ||
Once you have an archive at the latest version, you can inspect its contents in the same way you would with a standard AiiDA profile. | ||
|
||
We first create a profile instance from the archive path: | ||
|
||
```{code-cell} ipython3 | ||
from aiida import manage, orm, profile_context | ||
from aiida.storage.sqlite_zip.backend import SqliteZipBackend | ||
|
||
archive_profile = SqliteZipBackend.create_profile('include/process.aiida') | ||
print(archive_profile) | ||
``` | ||
|
||
The {py:func}`~aiida.manage.configuration.profile_context` function works similarly to the {py:func}`~aiida.manage.configuration.load_profile` function, | ||
but is used within a context manager, that insures that the storage is properly closed when the context is exited. | ||
With this, we can load our archive as a profile: | ||
|
||
```{code-cell} ipython3 | ||
with profile_context(archive_profile): | ||
print(manage.get_manager().get_profile()) | ||
``` | ||
|
||
To directly access the storage backend, and view information about it, we can use: | ||
|
||
```{code-cell} ipython3 | ||
import json | ||
with profile_context(archive_profile): | ||
storage = manage.get_manager().get_profile_storage() | ||
print(storage) | ||
print(json.dumps(storage.get_info(), indent=2)) | ||
``` | ||
|
||
This is directly equivalent to the command-line call: | ||
|
||
```{code-cell} ipython3 | ||
!verdi archive info include/process.aiida | ||
``` | ||
|
||
Note, that once the context manager is exited, the storage is closed, and will except on further calls. | ||
|
||
```{code-cell} ipython3 | ||
print(storage) | ||
``` | ||
|
||
As per a standard profile, we can now use the {py:class}`~aiida.orm.QueryBuilder`, to [find and query for data](how-to:query): | ||
|
||
```{code-cell} ipython3 | ||
with profile_context(archive_profile): | ||
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](how-to:data:visualise-provenance): | ||
|
||
```{code-cell} ipython3 | ||
from aiida.tools.visualization import Graph | ||
|
||
with profile_context(archive_profile): | ||
process = orm.QueryBuilder().append(orm.ProcessNode).first(flat=True) | ||
graph = Graph(graph_attr={"size": "8!,8!", "rankdir": "LR"}) | ||
graph.add_incoming(process, annotate_links="both") | ||
graph.add_outgoing(process, annotate_links="both") | ||
|
||
graph.graphviz | ||
``` |
File renamed without changes.
File renamed without changes.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do they have to be imported in this particular file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is required in
docs/source/reference/api/public.rst
, by theautoattribute
directive.What it actually does, is calls, e.g.
getattr(aiida, 'tools')
, which gives anAttributeError
, if you haven't actually already loaded the module.