Deprecate plural outputs, unify inputs and outputs#210
Deprecate plural outputs, unify inputs and outputs#210Luthaf wants to merge 3 commits intometatensor:mainfrom
Conversation
| 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. |
There was a problem hiding this comment.
Should we mention here that they are usually in singular...
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
| variants | |
| variant |
?
There was a problem hiding this comment.
no, there are multiple variants of the same quantity
| } 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); |
There was a problem hiding this comment.
Do we really need functions for all of them independently? I would say the logic is very similar for most of them, no?
There was a problem hiding this comment.
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
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.
2935384 to
9d82dcf
Compare
Standard inputs and outputs are now named "standard quantities"; and all names use the singular version of the word (
massinstead ofmasses)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
Issue referenced (for PRs that solve an issue)?Reviewer checklist