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

Data structures docs #103

Merged
merged 54 commits into from
Jun 26, 2022

Conversation

TomNicholas
Copy link
Member

@TomNicholas TomNicholas commented May 31, 2022

Adds detailed explanation of the structure of a DataTree, trying to copy the style of the main xarray page on data structures.

Builds on #41 in the sense that the explanation assumes that model.

  • Closes part of Documentation plans #61
  • Passes pre-commit run --all-files
  • Changes are summarized in docs/source/whats-new.rst

@TomNicholas TomNicholas added the documentation Improvements or additions to documentation label May 31, 2022
@TomNicholas TomNicholas deleted the branch xarray-contrib:main June 16, 2022 15:27
@TomNicholas TomNicholas reopened this Jun 16, 2022
@TomNicholas TomNicholas changed the base branch from initial_integration_refactor to main June 16, 2022 15:28
@TomNicholas TomNicholas mentioned this pull request Jun 16, 2022
14 tasks
@TomNicholas TomNicholas assigned malmans2 and unassigned malmans2 Jun 17, 2022
docs/source/data-structures.rst Show resolved Hide resolved
We can update a datatree in-place using Python's standard dictionary syntax, similar to how we can for Dataset objects.
For example, to create this example datatree from scratch, we could have written:

# TODO update this example using ``.coords`` and ``.data_vars`` as setters,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did you forget to do this, or are you leaving it for another PR?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are some undocumented bugs I noticed with trying to use .coords since #41 I think, so I was going to leave that problem to a future PR.

@TomNicholas TomNicholas merged commit 133f60c into xarray-contrib:main Jun 26, 2022
@TomNicholas TomNicholas deleted the data_structures_docs2 branch June 26, 2022 12:36
flamingbear pushed a commit to flamingbear/rewritten-datatree that referenced this pull request Jan 19, 2024
* 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 52ef23baaa4b6892cad2d69c61b43db831044630.

* 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>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants