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

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Oct 23, 2024
1 parent d9f6d4a commit 6fa3497
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 19 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ that was more flexible than a single `xarray.Dataset` object.
The initial motivation was to represent netCDF files / Zarr stores with multiple nested groups in a single in-memory object,
but `datatree.DataTree` objects have many other uses.

# :rotating_light: :bell: :warning: NO LONGER MAINTAINED :warning: :bell: :rotating_light:
# :rotating_light: :bell: :warning: NO LONGER MAINTAINED :warning: :bell: :rotating_light:

**This repository has been archived and the code is no longer maintained!**

Expand Down
15 changes: 8 additions & 7 deletions datatree/__init__.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
import warnings

warnings.warn(
"The repository `xarray-contrib/datatree` has been archived! It is no longer maintained as of October 2024. " \
"Datatree functionality has been migrated upstream to `pydata/xarray`, so please use `xarray.DataTree` instead. " \
"To help you migrate there is a guide at https://github.com/pydata/xarray/blob/main/DATATREE_MIGRATION_GUIDE.md",
DeprecationWarning,
)

# import public API
from .datatree import DataTree
from .extensions import register_datatree_accessor
from .io import open_datatree
from .mapping import TreeIsomorphismError, map_over_subtree
from .treenode import InvalidTreeError, NotFoundInTreeError

warnings.warn(
"The repository `xarray-contrib/datatree` has been archived! It is no longer maintained as of October 2024. "
"Datatree functionality has been migrated upstream to `pydata/xarray`, so please use `xarray.DataTree` instead. "
"To help you migrate there is a guide at https://github.com/pydata/xarray/blob/main/DATATREE_MIGRATION_GUIDE.md",
DeprecationWarning,
)


try:
# NOTE: the `_version.py` file must not be present in the git repository
# as it is generated by setuptools at install time
Expand Down
3 changes: 1 addition & 2 deletions datatree/datatree.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,7 @@ def __getitem__(self, key: Hashable) -> DataArray: # type: ignore[misc]
...

@overload
def __getitem__(self, key: Any) -> Dataset:
...
def __getitem__(self, key: Any) -> Dataset: ...

def __getitem__(self, key) -> DataArray:
# TODO call the `_get_item` method of DataTree to allow path-like access to contents of other nodes
Expand Down
8 changes: 5 additions & 3 deletions datatree/formatting_html.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,11 @@ def summarize_children(children: Mapping[str, Any]) -> str:
lines_callback = lambda n, c, end: _wrap_repr(node_repr(n, c), end=end)

children_html = "".join(
lines_callback(n, c, end=False) # Long lines
if i < N_CHILDREN
else lines_callback(n, c, end=True) # Short lines
(
lines_callback(n, c, end=False) # Long lines
if i < N_CHILDREN
else lines_callback(n, c, end=True)
) # Short lines
for i, (n, c) in enumerate(children.items())
)

Expand Down
3 changes: 1 addition & 2 deletions datatree/iterators.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ def __next__(self) -> Iterator[Tree]:

@staticmethod
@abstractmethod
def _iter(children: List[Tree], filter_, stop, maxlevel) -> Iterator[Tree]:
...
def _iter(children: List[Tree], filter_, stop, maxlevel) -> Iterator[Tree]: ...

@staticmethod
def _abort_at_level(level, maxlevel):
Expand Down
6 changes: 2 additions & 4 deletions datatree/tests/test_datatree.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,7 @@ def test_assign_when_already_child_with_variables_name(self):
dt.ds = new_ds


class TestGet:
...
class TestGet: ...


class TestGetItem:
Expand Down Expand Up @@ -450,8 +449,7 @@ def test_setitem_dataarray_replace_existing_node(self):
xrt.assert_identical(results.to_dataset(), expected)


class TestDictionaryInterface:
...
class TestDictionaryInterface: ...


class TestTreeFromDict:
Expand Down

0 comments on commit 6fa3497

Please sign in to comment.