Open
Description
When writing accessors which behave the same for both Dataset
and DataArray
, it would be incredibly useful to be able to use DataArray._to_temp_dataset
/ DataArray._from_temp_dataset
to deduplicate code. Is it safe to use those in external packages (like pint-xarray
)?
Otherwise I guess it would be possible to use
name = da.name if da.name is None else "__temp"
temp_ds = da.to_dataset(name=name)
new_da = temp_ds[name]
if da.name is None:
new_da = new_da.rename(da.name)
assert_identical(da, new_da)
but that seems less efficient.
Metadata
Metadata
Assignees
Labels
No labels