Skip to content
This repository has been archived by the owner on Oct 24, 2024. It is now read-only.

DatasetView in map_over_subtree #269

Merged

Conversation

TomNicholas
Copy link
Member

@TomNicholas TomNicholas commented Oct 24, 2023

Doing this because
a) It's safer to make the dataset passed to map_over_subtree immutable, so the user can't modify in-place,
b) It would allow adding the .path to the DatasetView object as suggested in #266.

  • Reverts part of .to_dataset in map over subtree #194
  • Tests updated
  • Passes pre-commit run --all-files
  • New functions/methods are listed in api.rst
  • Changes are summarized in docs/source/whats-new.rst

@TomNicholas TomNicholas enabled auto-merge (squash) October 24, 2023 17:07
@TomNicholas TomNicholas merged commit 07ac0ae into xarray-contrib:main Oct 24, 2023
12 checks passed
flamingbear pushed a commit to flamingbear/rewritten-datatree that referenced this pull request Jan 19, 2024
* re-forbid initializing a DatasetView directly

* test that map_over_subtree definitely doesn't modify data in-place

* chnge behaviour to return an immmutable DatasetView within map_over_subtree

* improve error messages

* whatsew

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* remove unused return variable

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant