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

Commit c2b6400

Browse files
TomNicholasmalmans2pre-commit-ci[bot]
authored
Integrate variables into DataTree (#41)
* 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>
1 parent 7c121bb commit c2b6400

File tree

10 files changed

+694
-184
lines changed

10 files changed

+694
-184
lines changed

ci/doc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ channels:
44
dependencies:
55
- pip
66
- python>=3.8
7-
- xarray>=0.20.2
87
- netcdf4
98
- scipy
109
- sphinx
@@ -16,3 +15,4 @@ dependencies:
1615
- zarr
1716
- pip:
1817
- git+https://github.com/xarray-contrib/datatree
18+
- xarray>=2022.05.0.dev0

ci/environment.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ channels:
44
- nodefaults
55
dependencies:
66
- python>=3.8
7-
- xarray>=0.20.2
87
- netcdf4
98
- pytest
109
- flake8
@@ -13,3 +12,5 @@ dependencies:
1312
- pytest-cov
1413
- h5netcdf
1514
- zarr
15+
- pip:
16+
- xarray>=2022.05.0.dev0

datatree/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# import public API
77
from .datatree import DataTree
88
from .io import open_datatree
9-
from .mapping import map_over_subtree
9+
from .mapping import TreeIsomorphismError, map_over_subtree
1010

1111
try:
1212
__version__ = get_distribution(__name__).version

0 commit comments

Comments
 (0)