Skip to content

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 Feb 5, 2024
1 parent 0b2cfd4 commit fd9cdef
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 11 deletions.
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 fd9cdef

Please sign in to comment.