-
Notifications
You must be signed in to change notification settings - Fork 102
[ENH] Update chainladder.utils.sparse.floor(x) to return a copy of x #740
Copy link
Copy link
Open
Labels
Effort > Brief 🐇Small tasks expected to take a few hours up to a couple of days.Small tasks expected to take a few hours up to a couple of days.Impact > Minor 🔷Small, backward compatible change. Treat like a patch release (e.g., 0.5.8 → 0.5.9).Small, backward compatible change. Treat like a patch release (e.g., 0.5.8 → 0.5.9).Refactor 🔧Code level improvements that restructure existing logic without changing behavior.Code level improvements that restructure existing logic without changing behavior.
Metadata
Metadata
Assignees
Labels
Effort > Brief 🐇Small tasks expected to take a few hours up to a couple of days.Small tasks expected to take a few hours up to a couple of days.Impact > Minor 🔷Small, backward compatible change. Treat like a patch release (e.g., 0.5.8 → 0.5.9).Small, backward compatible change. Treat like a patch release (e.g., 0.5.8 → 0.5.9).Refactor 🔧Code level improvements that restructure existing logic without changing behavior.Code level improvements that restructure existing logic without changing behavior.
Description
chainladder.utils.sparse.floor(x)mutatesx, where x is a sparse COO array.results in:
Is your feature request aligned with the scope of the package?
Describe the solution you'd like, or your current workaround.
Since side effects are discouraged these days, and the analogous
np.floor()returns a copy, I would recommend we also return a copy instead:Should result in:
And to save back to
a, we should do:resulting in:
Do you have any additional supporting notes?
No response