expose _to_temp_dataset / _from_temp_dataset as semi-public API?
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 4.2k
- Forks
- 1.4k
- Avg merge
- 2d 15h
- Merged PRs (30d)
- 14
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating DataArray._to_temp_dataset and DataArray._from_temp_dataset and reviewing their existing tests and API conventions. Compare their behavior with the to_dataset example in the issue and inspect how pint-xarray would use them. Done means a clear decision about external use, with the corresponding API documentation and tests if changes are required.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- data
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100