-
Notifications
You must be signed in to change notification settings - Fork 5
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
major refactoring of local.py #27
Conversation
…ass-Data-in-frequency_analysis.local
…s-Data-in-frequency_analysis.local
…s-Data-in-frequency_analysis.local
for more information, see https://pre-commit.ci
@sebastienlanglois @TC-FF I'm not quite done, but I wanted to put the files here before our meeting so you can see what I'm working on. |
Thanks @RondeauG, your work is fantastic! The code is super easy to understand and well-organized :) I know there's more to be done, but I couldn't resist giving your branch a try with the notebook example to see how it's coming along. The
Also, I would like to understand a little better how to use the code you provided below. My dataset,
Thanks again for all the work and looking forward to the next meeting! |
# Conflicts: # environment-dev.yml # environment.yml # setup.py
# Conflicts: # environment.yml
@sebastienlanglois @TC-FF Ça devrait être prêt pour révision ! Quelques points spécifiques pour vous:
|
Pull Request Checklist:
number
) and pull request (:pull:number
) has been added.What kind of change does this PR introduce?
Data
mostly replaced byget_yearly_op
, both inindicators.py
Data
did should be supported, but using xclim'sstats
indicator, withindexers
&xclim.core.missing
.min
instead of onlymax/volume
.date_bounds
(i.e.[03-01, 06-30]
) as well as dayofyear.get_yearly_op
(e.g. Q14max).xhydro.indicators.compute_volume()
and usesxclim.core.units.rate2amount()
.fit, parametric_quantiles & criteria
functions inlocal.py
(and split them in 3 for more control on what is computed)..to_dataframe()
or.load()
)get_criterions
(now_get_criteria_1d()
) should be better optimized and should never crash for AICC.xs.health_checks
toxhydro.utils
.Does this PR introduce a breaking change?
xhydro.utils.get_julian_day
-->ds.time.dt.dayofyear
should pretty much cover this, no? Also,date_bounds
should cover what was needed from this function.xhydro.utils.get_timestep
-->xarray.infer_freq(ds.time)
is a more robust version of this.Data.select_catchments
-->ds.where(ds.id.str.contains(), drop=True)
should cover this..contains()
works withregex
.DataFrames
anywhere, since they break the lazy computing and are horrible for memory management. If you want something more than a simple.to_dataframe()
for your notebooks, we could code that in.utils
.Other information:
season
dimension has been fully removed andget_yearly_op
instead outputs multiple variables. One reason for this is to have much better metadata. We can discuss this.Local
has for now been replaced with 3 functions. If we still want a class, we'll need to see its usefulness.