-
Notifications
You must be signed in to change notification settings - Fork 59
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
Remove lmoments3 #1644
Remove lmoments3 #1644
Conversation
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
On inspection, the No further action is required. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Could you confirm stats.frequency_analysis still works ?
Co-authored-by: David Huard <huard.david@ouranos.ca>
@huard import xclim as xc
import xarray as xr
import numpy as np
import lmoments3.distr as lmom
q = xr.DataArray(
np.random.random_sample((365 * 10 + 2,)),
dims=('time',),
coords={'time': xr.cftime_range('1990-01-01', freq='D', periods=365 * 10 + 2)},
attrs={'units': 'm3 s-1'}
)
xc.generic.return_level(q, mode='max', t=2, dist=lmom.gev, window=6, freq='YS', method='PWM')
xc.generic.return_level(q, mode='max', t=2, dist='genextreme', window=6, freq='YS', method='ML') |
@saschahofmann If you did not receive news from the last person, does this PR seems reasonable to you ? |
Yes totally . Tomorrow I'll be a little rude and give him a nudge on the lmoments R library that he still maintains hoping we can get his attention that way |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nicely done!
Co-authored-by: Trevor James Smith <10819524+Zeitsperre@users.noreply.github.com>
Pull Request Checklist:
lmoments3
andeofs
is not permitted under GPLv3 #1620number
) and pull request (:pull:number
) has been addedWhat kind of change does this PR introduce?
lmoments3
from xclim's dependencies.rv_continuous
instances for thedist
arguments of the statistical indicesDoes this PR introduce a breaking change?
Yes. Passing a mere string and
method='PWM'
is now broken. It will raise a ValueError with a message asking to pass an instance oflmoments3
instead.This also makes some functions awkward to use. Before, we relied on the
scipy_dist
attribute ofparams
to retrieve the distribution when computing statistics. As one can now pass an object that has nothing to do with scipy, those functions (parametric_quantile
for example) must now also accept the dist as an argument.Other information:
See Ouranosinc/lmoments3#12.
I kinda cheated and made it so the
dist
argument would show up as a "String" parameter to the indicator. This only changes the metadata, distributions objects can still be passed to indicators.