primap-community/primap2

Generalize `pr.set`

Opened this issue · 1 comments

Is your feature request related to a problem? Please describe.

Xarray lacks an easy-to-use solution for setting specific values. Unfortunately, pr.set also doesn't handle all use cases so far.

Describe the solution you'd like

It would be great to handle the following cases:

  • Like combine_first, but preserving NaNs in early objects before alignment.
  • Like set, but instead of dim and key, have a sel, so that it looks like da.pr.set(sel, value).
  • Support scalar NaN value in ds.set.

@JGuetschow Other use cases you'd like solved?

I can't promise that it is actually possible to solve everything here (I think there was a reason to only support dim and key, not the full sel) but given that we again and again deal with this, we should consider some use cases we really need.