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

Commit

Permalink
Integrate variables into DataTree (#41)
Browse files Browse the repository at this point in the history
* 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

* correct deepcopy tests

* use .data_vars in copy tests

* make imports depend on most recent version of xarray

Co-authored-by: Mattia Almansi <[email protected]>

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

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

* remove try except for internal import

* depend on latest pre-release of xarray

* correct name of version

* xarray pre-release under pip in ci envs

* correct methods

* whatsnews

* improve docstrings

Co-authored-by: Mattia Almansi <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Jun 16, 2022
1 parent 7c121bb commit c2b6400
Show file tree
Hide file tree
Showing 10 changed files with 694 additions and 184 deletions.
2 changes: 1 addition & 1 deletion ci/doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ channels:
dependencies:
- pip
- python>=3.8
- xarray>=0.20.2
- netcdf4
- scipy
- sphinx
Expand All @@ -16,3 +15,4 @@ dependencies:
- zarr
- pip:
- git+https://github.com/xarray-contrib/datatree
- xarray>=2022.05.0.dev0
3 changes: 2 additions & 1 deletion ci/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ channels:
- nodefaults
dependencies:
- python>=3.8
- xarray>=0.20.2
- netcdf4
- pytest
- flake8
Expand All @@ -13,3 +12,5 @@ dependencies:
- pytest-cov
- h5netcdf
- zarr
- pip:
- xarray>=2022.05.0.dev0
2 changes: 1 addition & 1 deletion datatree/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# import public API
from .datatree import DataTree
from .io import open_datatree
from .mapping import map_over_subtree
from .mapping import TreeIsomorphismError, map_over_subtree

try:
__version__ = get_distribution(__name__).version
Expand Down
Loading

0 comments on commit c2b6400

Please sign in to comment.