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

Move last_jobinfo from JSON-serialized string to dictionary #3651

Merged
merged 1 commit into from
Dec 13, 2019

Conversation

giovannipizzi
Copy link
Member

For historical reasons, this field was stored as a JSON-serialized
string in the last_jobinfo attribute of a CalcJob. However, this
is cumbersome and makes querying very hard.

We now replace this with a dictionary, thanks to new commands to
get directly a dictionary (with serialized fields, so that the
dictionary is JSON-serializable).
These (and existing) methods of the JobInfo class are now also tested.

Finally, the attribute key has been renamed from last_jobinfo to
last_job_info, for consistency with the key detailed_job_info
introduced in #3639. By changing the type of the content, the field is
anyway not directly usable as before in scripts, so changing the name
is not an additional issue.
This should not give a real backward-incompatibility problem, since
this field was there mostly for debugging reasons.

Fixes #3649

sphuber
sphuber previously approved these changes Dec 12, 2019
Copy link
Contributor

@sphuber sphuber left a comment

Choose a reason for hiding this comment

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

Thanks @giovannipizzi looking good, I would just turn the loaders into classmethods

aiida/schedulers/datastructures.py Outdated Show resolved Hide resolved
aiida/schedulers/datastructures.py Outdated Show resolved Hide resolved
aiida/orm/nodes/process/calculation/calcjob.py Outdated Show resolved Hide resolved
@sphuber sphuber self-requested a review December 12, 2019 20:17
@sphuber sphuber dismissed their stale review December 12, 2019 20:17

Meant to request changes

Copy link
Contributor

@sphuber sphuber left a comment

Choose a reason for hiding this comment

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

Accidentally approved first

@giovannipizzi giovannipizzi force-pushed the fix_3649_last_jobinfo branch 2 times, most recently from 756e1e9 to 065ec84 Compare December 13, 2019 13:38
For historical reasons, this field was stored as a JSON-serialized
string in the `last_jobinfo` attribute of a CalcJob. However, this
is cumbersome and makes querying very hard.

We now replace this with a dictionary, thanks to new commands to
get directly a dictionary (with serialized fields, so that the
dictionary is JSON-serializable). These (and existing) methods of
the JobInfo class are now also tested.

Finally, the attribute key has been renamed from `last_jobinfo` to
`last_job_info`, for consistency with the key `detailed_job_info`
introduced in aiidateam#3639. By changing the type of the content, the field is
anyway not directly usable as before in scripts, so changing the name
is not an additional issue. This should not give a real backward-
incompatibility problem, since this field was there mostly for
debugging reasons.
@sphuber sphuber merged commit 9092b93 into aiidateam:develop Dec 13, 2019
@sphuber
Copy link
Contributor

sphuber commented Dec 13, 2019

Rebasing and squashing seems to have done it, the tests passed. Or maybe it was just luck/random again. We will see. Thanks for the PR in any case @giovannipizzi !

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.

Move last_jobinfo from JSON-serialized string to dictionary
2 participants