Skip to content

Declare legacy outputs under their current name - #396

Open
EricBoittier wants to merge 4 commits into
metatensor:metatomic-corefrom
EricBoittier:legacy-current-names
Open

EricBoittier wants to merge 4 commits into
metatensor:metatomic-corefrom
EricBoittier:legacy-current-names

Conversation

@EricBoittier

@EricBoittier EricBoittier commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

LegacyModel declares outputs under a deprecated name (e.g. features, non_conservative_forces, ...) for legacy models, under the current property name, and asks the legacy model for the name it declared.
Properties named after the deprecated name get renamed.

The regression test references are generated with the previous engine, in the environment of references.lock. update-references.py could not run there: the released metatomic-torch has no metatomic_torch module.

Contributor (creator of pull-request) checklist

  • Tests updated (for new features and bugfixes)?
  • Documentation updated (for new features)?
  • Issue referenced (for PRs that solve an issue)?

Reviewer checklist

  • CHANGELOG updated with public API or any other important changes?

@EricBoittier
EricBoittier force-pushed the legacy-current-names branch 7 times, most recently from 0cee10d to 89aa38f Compare November 30, 2026 18:34
@Luthaf
Luthaf force-pushed the metatomic-core branch 2 times, most recently from f069384 to 5e20823 Compare December 3, 2026 09:23
@EricBoittier
EricBoittier force-pushed the legacy-current-names branch 2 times, most recently from 24bfc3b to 073c48d Compare December 3, 2026 09:44
@Luthaf
Luthaf force-pushed the metatomic-core branch 2 times, most recently from 987c579 to 4b69dde Compare December 3, 2026 10:07
The regression tests now load each model with the metatomic-torch legacy
plugin and run it with the metatomic-core API, like an engine using the
C or C++ API would, instead of running it with metatomic-torch.
update-references.py generates the references the same way.

PET-MAD-DOS v1.0 declares no length unit, and PET-MAD-S v1.5.0 and
ShiftML4 declare outputs with deprecated names, so LegacyModel can not
run them yet: they are expected failures.
metatomic-core rejects the deprecated output names that older models
declare, such as `features` or `non_conservative_forces`. LegacyModel,
in Python and in the metatomic-torch plugin, now declares these outputs
under their current name and asks the model for the name it declared.
If a model declares both names, the current one is used.

metatomic-torch also accepted properties named after the deprecated
name of some outputs (e.g. `non_conservative_forces`), which
metatomic-core does not, so LegacyModel renames them.

ShiftML4 now passes its regression test. PET-MAD-S v1.5.0 runs and
matches its references, except that the reference for the forces uses
the deprecated property name, so it stays an expected failure.
Expected failures would also hide other errors in these cases. PET-MAD-S
v1.5.0 is compared with its reference after renaming the reference's
'non_conservative_forces' properties, which metatomic-torch used, to
'non_conservative_force'. LegacyModel refuses PET-MAD-DOS v1.0, which
declares no length unit, and the test checks that it fails with this error.
update-references.py runs in the environment of references.lock, where
metatomic-torch is released as metatomic.torch, and neither metatomic_torch
nor metatomic-core exist. Generate the references with the previous engine
there, and share the code reading the inputs.
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.

1 participant