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 JobStoreDocument attribute access #710

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

mjwen
Copy link
Member

@mjwen mjwen commented Feb 9, 2024

Summary

Fix the error:

  File "/home/atomate2/src/atomate2/cli/dev.py", line 58, in vasp_test_data
    if not isinstance(output["output"], TaskDoc):
                      ~~~~~~^^^^^^^^^^
TypeError: 'JobStoreDocument' object is not subscriptable

Copy link

codecov bot commented Feb 9, 2024

Codecov Report

Attention: 5 lines in your changes are missing coverage. Please review.

Comparison is base (e5ab301) 76.32% compared to head (57edfe6) 76.17%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #710      +/-   ##
==========================================
- Coverage   76.32%   76.17%   -0.16%     
==========================================
  Files          87       87              
  Lines        7164     7164              
  Branches     1057     1057              
==========================================
- Hits         5468     5457      -11     
- Misses       1373     1385      +12     
+ Partials      323      322       -1     
Files Coverage Δ
src/atomate2/cli/dev.py 0.00% <0.00%> (ø)

... and 1 file with indirect coverage changes

@mjwen mjwen changed the title Fix JobStoreDocument attribute access [WIP] Fix JobStoreDocument attribute access Feb 9, 2024
@mjwen mjwen changed the title [WIP] Fix JobStoreDocument attribute access Fix JobStoreDocument attribute access Feb 10, 2024
@mjwen
Copy link
Member Author

mjwen commented Feb 10, 2024

I was trying to add a test, and what I was doing is:

  • run a vasp calculation
  • add the job directory job_2024-02-10-... to the test data folder of atomate2 test
  • run atm dev vasp-test-data dummy to test it

In dev.py, the directory to copy the VASP files is from outputs.json, and it is an absolute path. Because the vasp files are relocated from wherever they are generated to the test data folder, it won't work.

To make it work, we need to update dev.py to accept a new job dir e.g. from cli, not from outputs.json. This can be done by adding an optional switch (e.g. --job_dirs) to atm dev vasp-test-data.

@utf If you think this is a OK, I can add it. Otherwise, this PR is ready for review.

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.

None yet

1 participant