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

Fix custodian json import issue #883

Merged
merged 3 commits into from
Nov 8, 2023
Merged

Conversation

JaGeo
Copy link
Member

@JaGeo JaGeo commented Nov 7, 2023

Closes materialsproject/atomate2#604. I would be happy if this could get merged soon.

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (8bf7303) 78.91% compared to head (b80cbea) 78.91%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #883   +/-   ##
=======================================
  Coverage   78.91%   78.91%           
=======================================
  Files          75       75           
  Lines        4217     4217           
=======================================
  Hits         3328     3328           
  Misses        889      889           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@JaGeo
Copy link
Member Author

JaGeo commented Nov 7, 2023

@munrojm, would it be possible for you to have a look at this?

@utf
Copy link
Member

utf commented Nov 8, 2023

Hi @JaGeo, thanks for this report.

A couple of thoughts:

@JaGeo
Copy link
Member Author

JaGeo commented Nov 8, 2023

  • Is this issue happening because the json parsing is using monty loadfn which is deserialising the objects? One fix would be to just use json.load. This will probably be quicker and less error prone.

@utf, I assume so. I think, however, that it does not happen during the initial reading but rather at a later point as the initial reading suppresses the usage of cls.

return loadfn(filenames[0], cls=None)

From the error message, it fails at the start of relax2 rather than the end of relax1.

Just to add:
both, Optional[Any] and Optional[Union[dict,VaspJob]] worked for me.

@munrojm
Copy link
Member

munrojm commented Nov 8, 2023

@JaGeo sorry for the delay. This looks fine to me. I would prefer to be a bit more explicit with Optional[Union[dict,VaspJob]] as you have it.

@munrojm munrojm merged commit bc2f687 into materialsproject:main Nov 8, 2023
0 of 10 checks passed
@JaGeo
Copy link
Member Author

JaGeo commented Nov 8, 2023

@munrojm Thank you so much!

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.

BUG: TaskDoc in latest atomate2 version cannot process json from custodian
4 participants