Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Relations between arguments in @expects decorator #150

Open
TomNicholas opened this issue Jan 20, 2022 · 1 comment
Open

Relations between arguments in @expects decorator #150

TomNicholas opened this issue Jan 20, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@TomNicholas
Copy link
Member

#143 should ideally add functionality for relations between units of input arguments, in the same way that pint.ureg.wraps does. This seems quite complicated though, so I think we should leave it to a separate PR. I wonder if the neatest way to fix it would involve some upstream changes in pint?

@TomNicholas TomNicholas added the enhancement New feature or request label Jan 20, 2022
@keewis
Copy link
Collaborator

keewis commented Feb 26, 2022

I didn't know about that, but this sounds useful!

If we use Signature.bind and BoundArguments.arguments, getting the names of the arguments shouldn't be too difficult. expects is a bit more complicated than wraps since we use dicts to represent xarray objects (and thus the syntax of the relationship needs to allow for something like arg.attribute), but that shouldn't be too much trouble either.

I definitely agree with you that we shouldn't hold back #143 even more than we already have, so this should be done in a different PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants