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

Allow assigning Coercible values + NamedNode internal class #115

Merged
merged 7 commits into from
Jun 17, 2022

Conversation

TomNicholas
Copy link
Member

Fixes #112 (which was trivial), but then also fixes a bug I noticed with name permanence. This bug wasn't exposed because the name-related tests were testing TreeNode instead of DataTree, so I refactored until the existing tests correctly exposed the bug. Then I fixed the bug.

@TomNicholas TomNicholas added the bug Something isn't working label Jun 17, 2022
@TomNicholas TomNicholas mentioned this pull request Jun 17, 2022
3 tasks
@TomNicholas TomNicholas merged commit b7cdaa0 into xarray-contrib:main Jun 17, 2022
@TomNicholas TomNicholas deleted the NamedNode branch June 17, 2022 20:43
@TomNicholas TomNicholas mentioned this pull request Jun 17, 2022
TomNicholas added a commit to TomNicholas/datatree that referenced this pull request Jun 17, 2022
TomNicholas added a commit that referenced this pull request Jun 26, 2022
* sketching out changes needed to integrate variables into DataTree

* fixed some other basic conflicts

* fix mypy errors

* can create basic datatree node objects again

* child-variable name collisions dectected correctly

* in-progres

* add _replace method

* updated tests to assert identical instead of check .ds is expected_ds

* refactor .ds setter to use _replace

* refactor init to use _replace

* refactor test tree to avoid init

* attempt at copy methods

* rewrote implementation of .copy method

* xfailing test for deepcopying

* pseudocode implementation of DatasetView

* Revert "pseudocode implementation of DatasetView"

This reverts commit 52ef23b.

* removed duplicated implementation of copy

* reorganise API docs

* expose data_vars, coords etc. properties

* try except with calculate_dimensions private import

* add keys/values/items methods

* don't use has_data when .variables would do

* explanation of basic properties

* add data structures page to index

* revert adding documentation in favour of that going in a different PR

* explanation of basic properties

* add data structures page to index

* create tree node-by-node

* create tree from dict

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

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

* dict-like interface

* correct deepcopy tests

* use .data_vars in copy tests

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

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

* black

* whatsnew

* data contents

* dictionary-like access

* TODOs

* test assigning int

* allow assigning coercible values

* simplify example using #115

* add note about fully qualified names

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
flamingbear pushed a commit to flamingbear/rewritten-datatree that referenced this pull request Jan 19, 2024
…ntrib/datatree#115

* test assigning int

* allow assigning coercible values

* refactor name-related methods to intermediate class

* refactor tests to match

* fix now-exposed bug with naming

* moved test showing lack of name permanence

* whatsnew
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow any valid type as value for __setitem__
1 participant