Add support for MTKNPT - #89
Conversation
This is a follow-up to materialyzeai#88 to add support for `MTKNPT`. This is the newly recommended method for NPT simulations in ASE, with `npt` being deprecated (see https://gitlab.com/ase/ase/-/merge_requests/3765). In materialyzeai#88, I only added the isotropic version. I didn't see the regular `MTKNPT` until now. Signed-off-by: Andrew S. Rosen <asrosen93@gmail.com>
|
It looks like we are blocked by ASE. The |
Signed-off-by: Andrew S. Rosen <asrosen93@gmail.com>
|
@Naisargi-Goyal, since it will take some time for a new ASE version to be released on PyPI (which is needed to merge this PR), please post here if you find anything unusual or undesirable about the implementation I made or if you would like any improvements to be made. I encourage you to check that the default parameters I used are sensible and such. |
|
You can always install ASE in the CI using the main branch of the ASE repo. |
|
@shyuep If I do that, I would need to ensure the import doesn't cause any breakage for downstream users who have not updated to the |
|
Yes. But think it is up to you. If you feel it is not an urgent feature, we can always wait for new ASE to be released rather than doing all these hoops. |
| ] | ||
| dependencies = [ | ||
| "ase>=3.23.0", | ||
| "ase>=3.25.0", |
There was a problem hiding this comment.
In hindsight, this should have been added in #88. I have added it now. Note that the master branch of ASE is 3.26.0b1.
| @pytest.fixture(scope="module", autouse=True) | ||
| def set_seed() -> None: | ||
| np.random.seed(42) # noqa: NPY002 |
There was a problem hiding this comment.
I was getting arbitrary test failures between my local machine and CI due to differences in the random initializations. I have set a seed in the test suite to avoid this from happening in the future, although this also involves changes to the test values. I have confirmed that this PR does not break any behavior by ensuring that the test values remain unchanged with the main branch of matcalc as well as with ASE 3.23.0, 3.24.0, and 3.25.0.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #89 +/- ##
=======================================
Coverage 96.22% 96.22%
=======================================
Files 22 22
Lines 1167 1167
=======================================
Hits 1123 1123
Misses 44 44 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@shyuep: This is ready for your review. The 1 missing line of coverage is for the scenario where the ASE version is < 3.26.0, which I have confirmed works fine locally. |
Signed-off-by: Shyue Ping Ong <shyuep@users.noreply.github.com>
Signed-off-by: Andrew S. Rosen <asrosen93@gmail.com>
|
Thanks. |
This is a follow-up to #88 to add support for
MTKNPT. This is the newly recommended method for NPT simulations in ASE, withNPTnot being recommended due to stability issues (see https://gitlab.com/ase/ase/-/merge_requests/3765). In #88, I only added the isotropic version. I didn't see the regularMTKNPTuntil now.Checklist
ruff.mypy.duecredit@due.dcitedecorators to reference relevant papers by DOI (example)Tip: Install
pre-commithooks to auto-check types and linting before every commit: