Skip to content
This repository was archived by the owner on Jan 10, 2025. It is now read-only.

Commit

Permalink
qa
Browse files Browse the repository at this point in the history
  • Loading branch information
floriankrb committed Feb 6, 2024
1 parent 347114a commit 3a78669
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
8 changes: 5 additions & 3 deletions ecml_tools/create/writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,11 @@ def new_key(self, key, values_shape):

# Create a new key for indexing the large array.
new_key = tuple(
slice(self.offset, self.offset + values_shape[i])
if i == self.axis
else slice(None)
(
slice(self.offset, self.offset + values_shape[i])
if i == self.axis
else slice(None)
)
for i in range(len(self.shape))
)
else:
Expand Down
10 changes: 7 additions & 3 deletions tests/test_create.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

import json
import os
import tempfile

from ecml_tools.create import Creator
from ecml_tools.data import open_dataset
Expand All @@ -19,7 +18,12 @@ def compare_dot_zattrs(a, b):
b_keys = list(b.keys())
for k in set(a_keys) & set(b_keys):
if k in ["timestamp", "uuid", "latest_write_timestamp", "yaml_config"]:
assert type(a[k]) == type(b[k]), (type(a[k]), type(b[k]), a[k], b[k])
assert type(a[k]) == type(b[k]), ( # noqa: E721
type(a[k]),
type(b[k]),
a[k],
b[k],
)
assert k in a_keys, (k, a_keys)
assert k in b_keys, (k, b_keys)
return compare_dot_zattrs(a[k], b[k])
Expand All @@ -29,7 +33,7 @@ def compare_dot_zattrs(a, b):
for v, w in zip(a, b):
return compare_dot_zattrs(v, w)

assert type(a) == type(b), (type(a), type(b), a, b)
assert type(a) == type(b), (type(a), type(b), a, b) # noqa: E721
return a == b, (a, b)


Expand Down

0 comments on commit 3a78669

Please sign in to comment.