Skip to content

Implement the verdi export inspect command#2128

Merged
giovannipizzi merged 3 commits into
aiidateam:developfrom
sphuber:fix_584_verdi_export_inspect
Oct 26, 2018
Merged

Implement the verdi export inspect command#2128
giovannipizzi merged 3 commits into
aiidateam:developfrom
sphuber:fix_584_verdi_export_inspect

Conversation

@sphuber
Copy link
Copy Markdown
Contributor

@sphuber sphuber commented Oct 26, 2018

Fixes #584 at least the basic functionality. It does not address all the requirements specified in that issue, but for example how to inspect the actual content should be discussed, because just printing to terminal becomes useless for big archives. I would propose new issues can be opened if there are specific suggestions.

This command enables a user to easily inspect the contents of an export
archive. The implementation uses a new class Archive which is a utility
class to deal with export archives. It should be used in a context manager:

with Archive('/some/archive.aiida') as archive:
    version = archive.version_format

The context manager will ensure that the archive is lazily unpacked into a
sandbox folder which will be automatically cleaned when the context is left.

The command by default prints a summary of the contents and the version numbers
of the format itself and AiiDA with which it was exported. With flags one can
toggle to print just the format version, or the contents of the data or metadata
files contained within the archive.

@coveralls
Copy link
Copy Markdown

coveralls commented Oct 26, 2018

Coverage Status

Coverage increased (+9.4%) to 68.65% when pulling 86e8a96 on sphuber:fix_584_verdi_export_inspect into d8fca45 on aiidateam:develop.

This command enables a user to easily inspect the contents of an export
archive. The implementation uses a new class `Archive` which is a utility
class to deal with export archives. It should be used in a context manager:

    with Archive('/some/archive.aiida') as archive:
        version = archive.version_format

The context manager will ensure that the archive is lazily unpacked into a
sandbox folder which will be automatically cleaned when the context is left.

The command by default prints a summary of the contents and the version numbers
of the format itself and AiiDA with which it was exported. With flags one can
toggle to print just the format version, or the contents of the data or metadata
files contained within the archive.
@sphuber sphuber force-pushed the fix_584_verdi_export_inspect branch from c2938ff to 908954d Compare October 26, 2018 12:08
Copy link
Copy Markdown
Member

@giovannipizzi giovannipizzi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice!

@giovannipizzi giovannipizzi merged commit d0a8db5 into aiidateam:develop Oct 26, 2018
@sphuber sphuber deleted the fix_584_verdi_export_inspect branch October 28, 2018 10:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants