Skip to content

Deprecate plural outputs, unify inputs and outputs#210

Open
Luthaf wants to merge 3 commits intometatensor:mainfrom
Luthaf:deprecate-plural-outputs
Open

Deprecate plural outputs, unify inputs and outputs#210
Luthaf wants to merge 3 commits intometatensor:mainfrom
Luthaf:deprecate-plural-outputs

Conversation

@Luthaf
Copy link
Copy Markdown
Member

@Luthaf Luthaf commented Apr 23, 2026

Standard inputs and outputs are now named "standard quantities"; and all names use the singular version of the word (mass instead of masses)

Most of the code in this PR is handling backward compatibility. For outputs, AtomisticModel will automatically transform between the engine requested outputs and the model capabilties, sending warnings if any of them uses deprecated names.

For inputs, the engine must opt-in using the new names (since we don't want to duplicate inputs in the systems), and AtomisticModel will transform the provided inputs back to what the model wants internally.

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?

@Luthaf Luthaf requested a review from PicoCentauri April 23, 2026 15:19
Comment thread docs/src/engines/ipi.rst Outdated
Comment thread docs/src/quantities/feature.rst Outdated
Comment thread docs/src/quantities/feature.rst Outdated
Comment on lines +12 to +17
If you need other quantities as inputs or outputs, you should use custom
quantity with a name containing ``::``, such as ``my_code::my_quantity``. For
such custom quantity, you are free to use any relevant metadata structure, but
if multiple people are using the same quantity, they are encouraged to come
together, define the metadata schema they need and add a new section to these
pages.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we mention here that they are usually in singular...

Copy link
Copy Markdown
Member Author

@Luthaf Luthaf Apr 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we have to, we can discuss this whenever a PR comes in. If this becomes an issue we can start having docs for how to add new quantities

heat_flux
spin_multiplicity
feature
variants
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
variants
variant

?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, there are multiple variants of the same quantity

Comment thread docs/src/quantities/non_conservative.rst
Comment thread docs/src/quantities/non_conservative.rst Outdated
Comment thread docs/src/quantities/non_conservative.rst Outdated
Comment thread docs/src/conf.py
Comment on lines +820 to +829
} else if (base == "position") {
check_position(value, systems, request);
} else if (base == "momentum") {
check_momentum(value, systems, request);
} else if (base == "mass") {
check_mass(value, systems, request);
} else if (base == "velocity") {
check_velocity(value, systems, request);
} else if (base == "charge") {
check_charge(value, systems, request);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really need functions for all of them independently? I would say the logic is very similar for most of them, no?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but IMO having them as individual functions make it a lot easier to only modify one of them. We already share multiple sub-utility functions to check parts of the TensorMap

Luthaf added 3 commits April 28, 2026 15:01
They are now named "standard quantities", and the previous name is deprecated.

For backward compatibility, AtomisticModel will automatically transform between
the engine requested outputs and the model capabilties, sending warnings
if any of them uses deprecated names.

For inputs, the engine must opt-in using the new names (since we don't want to
duplicate inputs in the systems), and AtomisticModel will transform the provided
inputs back to what the model wants internally.
@Luthaf Luthaf force-pushed the deprecate-plural-outputs branch from 2935384 to 9d82dcf Compare April 28, 2026 13:10
@Luthaf Luthaf requested a review from PicoCentauri April 28, 2026 13:58
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.

2 participants