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

Simplify phonon get_supercell_size() and test clean up #783

Merged
merged 16 commits into from
Apr 25, 2024

Conversation

janosh
Copy link
Member

@janosh janosh commented Mar 22, 2024

  • include method (vasp|force_field) in PhononMaker test names
  • simplify phonon get_supercell_size() job
  • better use pytest structure fixtures to reduce duplication

@janosh janosh added the testing Test all the things label Mar 22, 2024
Copy link

codecov bot commented Mar 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 76.64%. Comparing base (256b39a) to head (48c063b).
Report is 5 commits behind head on main.

❗ Current head 48c063b differs from pull request most recent head aa3d1bb. Consider uploading reports for the commit aa3d1bb to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #783      +/-   ##
==========================================
- Coverage   77.03%   76.64%   -0.40%     
==========================================
  Files         122      114       -8     
  Lines        9108     8502     -606     
  Branches     1429     1275     -154     
==========================================
- Hits         7016     6516     -500     
+ Misses       1663     1599      -64     
+ Partials      429      387      -42     
Files Coverage Δ
src/atomate2/common/jobs/phonons.py 75.28% <100.00%> (+0.01%) ⬆️
src/atomate2/common/schemas/phonons.py 94.07% <ø> (ø)

... and 15 files with indirect coverage changes

@janosh
Copy link
Member Author

janosh commented Mar 22, 2024

waiting on uv release astral-sh/uv#313 (comment)

@janosh
Copy link
Member Author

janosh commented Mar 23, 2024

looks like we can successfully migrate CI deps installation to uv. @utf are you ok with this? should give a decent speed up as in materialsproject/pymatgen#3675 (comment)

@janosh
Copy link
Member Author

janosh commented Mar 23, 2024

uv install time is ~40s vs pip's ~150s, so a 3.7x speed up

@janosh
Copy link
Member Author

janosh commented Mar 23, 2024

looks like the test failures could be related to recent jsanitize changes in materialsvirtuallab/monty#638. @Andrew-S-Rosen do you happen to know a good fix here?

@janosh janosh changed the title Simplify phonon job get_supercell_size() Migrate CI dependency installation from pip to uv Mar 23, 2024
@janosh janosh added dependencies Pull requests that update a dependency file ci Continuous integration labels Mar 23, 2024
@Andrew-S-Rosen
Copy link
Member

Andrew-S-Rosen commented Mar 23, 2024

@janosh: I must admit, I can't see how that PR would cause the issue here. The command being called here is jsanitize(obj, strict=True, allow_bson=True), but the logic I added only kicks in if recursive_msonable=True (which is not the case by default). I also don't think replacing an isinstance() check with try/except would trigger this error in particular. That said, the timing is suspicious. 😅 There was also materialsproject/maggma#930 in maggma, but that doesn't seem to be called here.

@JaGeo
Copy link
Member

JaGeo commented Mar 23, 2024

I think we already talked about a similar issue here ( #781 , not the CHGNet issue but the one of the band structure workflow). I think emmet was at fault.

@JaGeo
Copy link
Member

JaGeo commented Mar 23, 2024

See #781 (comment)

@janosh
Copy link
Member Author

janosh commented Mar 23, 2024

@Andrew-S-Rosen my bad, should have looked more closely at the stack trace. was going mostly by temporal correlation 😅

@JaGeo thanks for the pointer! i missed that discussion 🙏

@janosh janosh force-pushed the simplify-get_supercell_size branch from d92c31d to 496e51f Compare April 1, 2024 11:09
@janosh janosh changed the title Migrate CI dependency installation from pip to uv Simplify phonon get_supercell_size() and test clean up Apr 1, 2024
@janosh janosh enabled auto-merge (squash) April 4, 2024 05:45
@janosh janosh merged commit e408beb into main Apr 25, 2024
6 checks passed
@janosh janosh deleted the simplify-get_supercell_size branch April 25, 2024 23:13
@janosh janosh removed the dependencies Pull requests that update a dependency file label May 3, 2024
@janosh janosh mentioned this pull request May 3, 2024
hrushikesh-s pushed a commit to hrushikesh-s/atomate2 that referenced this pull request Jun 28, 2024
…roject#783)

* simplify phonon job get_supercell_size()

* remove torch.set_default_dtype(torch.float32) from test_phonon_wf()

should be obsolete now with revert_default_dtype context manager

* include method (vasp|force field) in phonon flow test names

* simplify test_phonon_wf_force_field with intermediate variables

* remove duplication by using si_structure pytest fixture

* ruff fixes
@utf utf added the enhancement Improvements to existing features label Aug 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci Continuous integration enhancement Improvements to existing features testing Test all the things
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants