Skip to content
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

Add group extras to archive #4521

Merged
merged 3 commits into from Oct 27, 2020

Conversation

chrisjsewell
Copy link
Member

@chrisjsewell chrisjsewell commented Oct 27, 2020

fixes #4497

Group extras were introduced recently but not yet exported to AiiDA archives.
This commit adds group extras to the AiiDA archive.

Instead of special-casing deserialization of attributes and extras based on the field name, a convert_type: "jsonb" is introduced, which is used to indicate JSON-binary fields.

@@ -377,6 +377,12 @@ def _store_entity_data(
fields_info = reader.metadata.all_fields_info.get(entity_name, {})
unique_identifier = reader.metadata.unique_identifiers.get(entity_name, None)

if entity_name == NODE_ENTITY_NAME:
Copy link
Member Author

Choose a reason for hiding this comment

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

this should eventually be removed, but it requires (a) changes to the export code and (b) a migration

@codecov
Copy link

codecov bot commented Oct 27, 2020

Codecov Report

Merging #4521 into develop will increase coverage by 6.73%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #4521      +/-   ##
===========================================
+ Coverage    72.67%   79.40%   +6.73%     
===========================================
  Files          480      480              
  Lines        35073    35080       +7     
===========================================
+ Hits         25486    27851    +2365     
+ Misses        9587     7229    -2358     
Flag Coverage Δ
#django 73.51% <76.93%> (?)
#sqlalchemy 72.67% <76.93%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
aiida/tools/importexport/common/config.py 100.00% <ø> (ø)
aiida/cmdline/commands/cmd_export.py 91.22% <100.00%> (+0.06%) ⬆️
...ida/tools/importexport/dbimport/backends/django.py 93.08% <100.00%> (+93.08%) ⬆️
aiida/tools/importexport/dbimport/backends/sqla.py 93.84% <100.00%> (+0.07%) ⬆️
aiida/tools/importexport/dbimport/utils.py 83.12% <100.00%> (ø)
aiida/manage/tests/__init__.py 88.54% <0.00%> (+0.92%) ⬆️
aiida/engine/daemon/client.py 73.57% <0.00%> (+1.15%) ⬆️
aiida/manage/manager.py 95.18% <0.00%> (+1.38%) ⬆️
aiida/backends/testbase.py 93.40% <0.00%> (+2.84%) ⬆️
aiida/backends/utils.py 95.24% <0.00%> (+4.77%) ⬆️
... and 71 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2f8e845...1c2c268. Read the comment docs.

@ltalirz ltalirz mentioned this pull request Oct 27, 2020
Copy link
Member

@ltalirz ltalirz left a comment

Choose a reason for hiding this comment

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

Tests before StrictVersion pass - thanks a lot @chrisjsewell , that's indeed a much more compact and elegant way to add the extras.
Looks like editing import/export starts being more fun again :-)

I've updated the PR description; feel free to use for the commit message

@chrisjsewell
Copy link
Member Author

I've updated the PR description; feel free to use for the commit message

will do thanks!

@chrisjsewell chrisjsewell merged commit 4859572 into aiidateam:develop Oct 27, 2020
@chrisjsewell chrisjsewell deleted the archive/group-extras branch October 27, 2020 23:49
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.

Add Group.extras to export archives
2 participants