ENH: Add cumulative integration function.#3508
Conversation
|
Initial thoughts:
|
I wanted to get this working before trying for
If it helps, it's kind of an inverse of EDIT: Just noticed
If |
DWesl
left a comment
There was a problem hiding this comment.
Suggestions to fix NameError in tests and lint errors for test docstrings.
That's what I get for not paying attention when borrowing implementation while changing names. Also fix some lint errors.
Docstrings are double quotes in the rest of the file.
…tions. I might need to pull out the derivation of x when I add integrate.
Possibly avoidable, given cumulative_trapezoid already handles that case. Should I raise a ValueError to add units or re-direct to cumulative_trapezoid?
scipy.integrate.cumulative_integrate already handles them.
Windows is fine with commas, Mac wants decimal points and skips the commas.
Looks like cf-xarray would also be an option, since they already have a differentiate:
I think I have that working now.
The |
|
pint-xarray handles this now: import xarray as xr, pint_xarray
ds = xr.open_dataset(...)
integral = ds.pint.quantify().integrate(...).pint.dequantify("~C")I'll check |
Description Of Changes
Add a unit-aware cumulative integration function.
Won't be as fast as the xarray cumulative integration function,
but I'll be less likely to forget the units.
Checklist