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

"variable" arg for multiple input processes #186

Open
aulemahal opened this issue May 13, 2021 · 5 comments
Open

"variable" arg for multiple input processes #186

aulemahal opened this issue May 13, 2021 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@aulemahal
Copy link
Collaborator

The current variable argument takes only a string, which is not useful for processes taking multiple input netCDFs. I would suggest having a variables argument, a mapping from arg name to variable name. Multi-input processes would use that one instead of the other. compute_indices could contain the logic to manage this.

@aulemahal aulemahal self-assigned this May 13, 2021
@aulemahal aulemahal added the bug Something isn't working label May 13, 2021
@huard
Copy link
Collaborator

huard commented May 14, 2021

Why not just mirror the arguments name ? I think that with the new parameter metadata this would now be possible, no ?

@huard
Copy link
Collaborator

huard commented May 14, 2021

To be clear, I mean having a WPS input called tas, pr, etc instead of a generic "variable".

@aulemahal
Copy link
Collaborator Author

Hum, I'm thinking about the case where the variable names in the dataset are not the same as the argument names. With only one variable, the current trick works well, but not when there are more. More specifically for using datasets with more than one variable, at least one having the wrong name.

I wanted to use the sea_ice_area process with xclim's test data, but the inputs are sic and area, and the variable in the datasets are siconc and areacello.

@huard
Copy link
Collaborator

huard commented May 14, 2021

Je pige. Un peu lent ce matin...
👍

@aulemahal
Copy link
Collaborator Author

So my idea of a mapping seems not possible because there are no corresponding input type in pyWPS... I was looking for a dict and it doesn't seem to exist.

Another solution would be to have, for each variable, a corresponding {var}_name input.

For example, for my sea_ice_area example, sic and area would be given datasets and there would also be sic_name='siconc' and area_name='areacello'. Sadly, this will break current processes by moving variable to a new input, with a differing name depending on the process...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants