-
Notifications
You must be signed in to change notification settings - Fork 48
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
Support basic arithmetic between PredictionEnsemble
objects.
#248
Comments
Applying these operators to HimdcatsEnsemble then means to apply it to all datasets therein, right? But does this make sense? For skill computation not really |
I guess I'm thinking just of the specific case I mentioned in this PR. But for now I guess it's reasonable to expect the user to do that before hand (e.g. Another use case would be if there is some variable derived from two other variables. But that's actually a different issue I think. Right now I don't have it set up to be able to do:
|
I think this has something to do with https://stackoverflow.com/questions/20507745/overloading-addition-subtraction-and-multiplication-operators |
Ah nice, of course there's a magic method for that. Cool. I'll keep this in mind for a future PR. |
@aaronspring here is the issue if you want to post the use case for this. I think your thought was for integrating, e.g. through |
my use case for he=(he*area).sum([‘lon’,’lat']) |
It might be useful to support basic arithmetic between
PredictionEnsemble
objects (+, -, *, /).Code Sample, a copy-pastable example if possible
Expected Output
This should perform the arithmetic across variables and products in common. Maybe this doesn't make much sense in most cases, but the best example I can think of is if you're aligning observations, etc. with the drift-correction method used for CESM-DPLE.
You set this up by doing
But you cannot currently do
which in theory could do this over every dataset that contains the
time
dimension.I anticipate the solution would follow something similar to #243
Output of
climpred.show_versions()
climpred: 1.1.0.post55
xarray: 0.14.0
pandas: 0.25.2
numpy: 1.17.2
scipy: 1.3.1
cftime: 1.0.4
dask: 2.6.0
distributed: 2.6.0
setuptools: 41.4.0
pip: 19.3.1
conda: None
pytest: 5.2.1
IPython: 7.8.0
sphinx: 2.2.0
The text was updated successfully, but these errors were encountered: