Skip to content

Added sample_kind to ModelOutput, without breaking changes#168

Merged
Luthaf merged 1 commit intomainfrom
sample_kind
Apr 21, 2026
Merged

Added sample_kind to ModelOutput, without breaking changes#168
Luthaf merged 1 commit intomainfrom
sample_kind

Conversation

@pfebrer
Copy link
Copy Markdown
Contributor

@pfebrer pfebrer commented Feb 26, 2026

This PR substitutes #165.

It also implements sample_kind, with the short-term goal of enabling per-pair targets, but in this case in a way that doesn't break backward compatibility (new code using old ModelOutput might fail, but old code using the new ModelOutput won't). This is achieved by keeping the possibility to pass per_atom as an argument, and setting/getting it as a property, even though from now on the only thing ModelOutput stores is sample_kind.

Thanks to @Luthaf for letting me know that one can set optional arguments in torch exportable classes :)

If you agree with merging this one I will finalize it with some more tests ✌️

📚 Download documentation for this pull-request

⚙️ Download Python wheels for this pull-request (you can install these with pip)

📚 Download documentation for this pull-request

⚙️ Download Python wheels for this pull-request (you can install these with pip)

📚 Download documentation for this pull-request

⚙️ Download Python wheels for this pull-request (you can install these with pip)

📚 Download documentation for this pull-request

⚙️ Download Python wheels for this pull-request (you can install these with pip)

📚 Download documentation for this pull-request

⚙️ Download Python wheels for this pull-request (you can install these with pip)

📚 Download documentation for this pull-request

⚙️ Download Python wheels for this pull-request (you can install these with pip)

📚 Download documentation for this pull-request

⚙️ Download Python wheels for this pull-request (you can install these with pip)

📚 Download documentation for this pull-request

⚙️ Download Python wheels for this pull-request (you can install these with pip)

📚 Download documentation for this pull-request

⚙️ Download Python wheels for this pull-request (you can install these with pip)

📚 Download documentation for this pull-request

⚙️ Download Python wheels for this pull-request (you can install these with pip)

📚 Download documentation for this pull-request

⚙️ Download Python wheels for this pull-request (you can install these with pip)

📚 Download documentation for this pull-request

⚙️ Download Python wheels for this pull-request (you can install these with pip)

📚 Download documentation for this pull-request

⚙️ Download Python wheels for this pull-request (you can install these with pip)

📚 Download documentation for this pull-request

⚙️ Download Python wheels for this pull-request (you can install these with pip)

📚 Download documentation for this pull-request

⚙️ Download Python wheels for this pull-request (you can install these with pip)

📚 Download documentation for this pull-request

⚙️ Download Python wheels for this pull-request (you can install these with pip)

📚 Download documentation for this pull-request

⚙️ Download Python wheels for this pull-request (you can install these with pip)

📚 Download documentation for this pull-request

⚙️ Download Python wheels for this pull-request (you can install these with pip)

📚 Download documentation for this pull-request

⚙️ Download Python wheels for this pull-request (you can install these with pip)

📚 Download documentation for this pull-request

⚙️ Download Python wheels for this pull-request (you can install these with pip)

📚 Download documentation for this pull-request

⚙️ Download Python wheels for this pull-request (you can install these with pip)

📚 Download documentation for this pull-request

⚙️ Download Python wheels for this pull-request (you can install these with pip)

📚 Download documentation for this pull-request

⚙️ Download Python wheels for this pull-request (you can install these with pip)

📚 Download documentation for this pull-request

⚙️ Download Python wheels for this pull-request (you can install these with pip)

📚 Download documentation for this pull-request

Comment thread metatomic-torch/include/metatomic/torch/model.hpp Outdated
Comment thread metatomic-torch/src/model.cpp Outdated
Comment thread metatomic-torch/src/outputs.cpp Outdated
@pfebrer pfebrer force-pushed the sample_kind branch 3 times, most recently from 4b3c32d to 87dc377 Compare March 13, 2026 21:37
@pfebrer
Copy link
Copy Markdown
Contributor Author

pfebrer commented Mar 13, 2026

This is ready for a final look. I checked that one can take the conda lammps-metatomic and use this modified metatomic version without problems to run an MD with a pet-mad.pt exported using the last metatomic release. The results of the MD are exactly the same as when running without the modified version.

Comment thread metatomic-torch/include/metatomic/torch/model.hpp
Comment thread metatomic-torch/include/metatomic/torch/model.hpp Outdated
Comment thread metatomic-torch/include/metatomic/torch/model.hpp Outdated
Comment thread metatomic-torch/src/model.cpp Outdated
Comment thread metatomic-torch/src/model.cpp Outdated
Comment thread metatomic-torch/src/outputs.cpp Outdated
Comment thread metatomic-torch/src/outputs.cpp Outdated
@Luthaf
Copy link
Copy Markdown
Member

Luthaf commented Mar 25, 2026

Do not merge before #186, we need to have at least one release of metatomic-ase that works with an already released version of metatomic-torch

@Luthaf Luthaf force-pushed the sample_kind branch 3 times, most recently from 9353d37 to 4df02e3 Compare April 8, 2026 08:42
@HaoZeke HaoZeke force-pushed the sample_kind branch 2 times, most recently from a24c33e to b387342 Compare April 17, 2026 10:45
@HaoZeke HaoZeke requested a review from Luthaf April 17, 2026 10:56
@pfebrer
Copy link
Copy Markdown
Contributor Author

pfebrer commented Apr 17, 2026

@HaoZeke I don't understand your change, we wanted it to work (not make engines fail) but deprecate it, issuing a warning so that the engines get changed before it gets removed. What's the problem with issuing a warning, it does not make the code fail no?

@HaoZeke
Copy link
Copy Markdown
Member

HaoZeke commented Apr 17, 2026

@HaoZeke I don't understand your change, we wanted it to work (not make engines fail) but deprecate it, issuing a warning so that the engines get changed before it gets removed. What's the problem with issuing a warning, it does not make the code fail no?

yeah that's true, but there's also the PR description where I thought we don't even want deprecation warnings, but OK, rebasing on #199 and then extending it

@pfebrer
Copy link
Copy Markdown
Contributor Author

pfebrer commented Apr 17, 2026

Aaah ok, noo the goal was to keep it compatible until metatomic introduces compatibility breaks (when multiple backends are supported probably), and at that point just remove per_atom

Comment thread python/metatomic_ase/tests/conftest.py Outdated
Comment thread python/metatomic_ase/pyproject.toml Outdated
…lity

Co-Authored-By: Guillaume Fraux <guillaume.fraux@epfl.ch>
Co-Authored-by: Rohit Goswami <rgoswami@ieee.org>
@Luthaf Luthaf merged commit 256a66e into main Apr 21, 2026
10 checks passed
@Luthaf Luthaf deleted the sample_kind branch April 21, 2026 09:46
@pfebrer
Copy link
Copy Markdown
Contributor Author

pfebrer commented Apr 21, 2026

Yessss, do you know approx when this will be in a realease?

@Luthaf
Copy link
Copy Markdown
Member

Luthaf commented Apr 21, 2026

End of this week/next week is the tentative deadline, but it will depend on how many other bugs I find in the mean time =)

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.

3 participants