Skip to content

deprecate(ModelOutput.quantity): mark quantity field as deprecated#199

Open
HaoZeke wants to merge 2 commits intometatensor:mainfrom
HaoZeke:morfixes
Open

deprecate(ModelOutput.quantity): mark quantity field as deprecated#199
HaoZeke wants to merge 2 commits intometatensor:mainfrom
HaoZeke:morfixes

Conversation

@HaoZeke
Copy link
Copy Markdown
Member

@HaoZeke HaoZeke commented Apr 3, 2026

The quantity field is no longer required for unit conversion since the unit parser determines dimensions from the expression itself.

Changes:

  • Add deprecated documentation to C++ header
  • Add TORCH_WARN in C++ setter when quantity is non-empty
  • Add DeprecationWarning in Python when quantity validation runs
  • Update documentation with deprecation notice
  • Add deprecation entries to CHANGELOG

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?

@HaoZeke HaoZeke force-pushed the morfixes branch 2 times, most recently from 4d71dab to e7e0aea Compare April 4, 2026 01:28
HaoZeke added 2 commits April 5, 2026 02:49
The quantity field on ModelOutput is no longer required for unit
conversion -- the unit parser now determines dimensions from the
expression itself. Setting a non-empty quantity emits a TORCH_WARN
deprecation notice from C++.

Input unit conversion in _convert_systems_units now gates on
requested.unit instead of requested.quantity, and the redundant
set_info("quantity", ...) call is removed.
- Remove quantity= parameter from ModelOutput calls in tests
- Add pytest filterwarnings for the new deprecation warnings
- Update conftest.py stderr filters for C++ TORCH_WARN output
- Update C++ test warning handler to handle multiple warnings
- Check unit info instead of removed quantity info in ASE tests
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