Skip to content

Commit 2174ae5

Browse files
committed
reformatting, fixes after linting
1 parent fd32b19 commit 2174ae5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+189
-192
lines changed

examples/zappend-demo.ipynb

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,10 @@
1818
"outputs": [],
1919
"source": [
2020
"import glob\n",
21-
"import math\n",
2221
"import os\n",
2322
"import os.path\n",
2423
"import shutil\n",
2524
"\n",
26-
"import numpy as np\n",
2725
"import xarray as xr"
2826
]
2927
},
@@ -2951,10 +2949,7 @@
29512949
"id": "e3b5f156-88c7-4ce1-908e-88ddc7b7e18c",
29522950
"metadata": {},
29532951
"outputs": [],
2954-
"source": [
2955-
"from IPython.display import Markdown\n",
2956-
"from zappend.config import get_config_schema"
2957-
]
2952+
"source": []
29582953
},
29592954
{
29602955
"cell_type": "code",
@@ -3023,7 +3018,7 @@
30233018
"metadata": {},
30243019
"outputs": [],
30253020
"source": [
3026-
"config_path = f\"zappend-config.yaml\""
3021+
"config_path = \"zappend-config.yaml\""
30273022
]
30283023
},
30293024
{

tests/config/test_attrs.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,17 @@
77
import unittest
88

99
import numpy as np
10-
import xarray as xr
1110
import pytest
11+
import xarray as xr
12+
13+
from zappend.config.attrs import (
14+
ConfigAttrsUserFunctions,
15+
eval_dyn_config_attrs,
16+
eval_expr,
17+
get_dyn_config_attrs_env,
18+
has_dyn_config_attrs,
19+
)
1220

13-
from zappend.config.attrs import ConfigAttrsUserFunctions
14-
from zappend.config.attrs import eval_dyn_config_attrs
15-
from zappend.config.attrs import eval_expr
16-
from zappend.config.attrs import get_dyn_config_attrs_env
17-
from zappend.config.attrs import has_dyn_config_attrs
1821
from ..helpers import make_test_dataset
1922

2023

tests/config/test_config.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
from zappend.context import Context
1212
from zappend.fsutil.fileobj import FileObj
1313
from zappend.slice import SliceSource
14-
from ..helpers import clear_memory_fs
15-
from ..helpers import make_test_dataset
14+
15+
from ..helpers import clear_memory_fs, make_test_dataset
1616

1717

1818
class ConfigTest(unittest.TestCase):
@@ -151,8 +151,7 @@ def test_slice_source_as_type(self):
151151
with pytest.raises(
152152
TypeError,
153153
match=(
154-
"slice_source must a callable"
155-
" or the fully qualified name of a callable"
154+
"slice_source must a callable or the fully qualified name of a callable"
156155
),
157156
):
158157
Config(

tests/config/test_normalize.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,9 @@
1010
import pytest
1111
import yaml
1212

13-
from zappend.config import exclude_from_config
14-
from zappend.config import merge_configs
15-
from zappend.config import normalize_config
13+
from zappend.config import exclude_from_config, merge_configs, normalize_config
1614
from zappend.fsutil import FileObj
15+
1716
from ..helpers import clear_memory_fs
1817

1918

@@ -88,7 +87,7 @@ def test_it_raises_if_config_is_not_object(self):
8887
file_obj.write("what?")
8988
with pytest.raises(
9089
TypeError,
91-
match="Invalid configuration:" " memory://config.yaml: object expected",
90+
match="Invalid configuration: memory://config.yaml: object expected",
9291
):
9392
normalize_config(file_obj)
9493

tests/config/test_validate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def test_validate_versions_fail(self):
2323
config = {"zarr_version": 1}
2424
with pytest.raises(
2525
ValueError,
26-
match="Invalid configuration:" " 2 was expected for zarr_version",
26+
match="Invalid configuration: 2 was expected for zarr_version",
2727
):
2828
validate_config(config)
2929

tests/contrib/test_levels.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,10 @@
88
import pytest
99
import xarray as xr
1010

11-
from zappend.fsutil import FileObj
11+
from tests.helpers import clear_memory_fs, make_test_dataset
1212
from zappend.contrib import write_levels
1313
from zappend.contrib.levels import get_variables_config
14-
from tests.helpers import clear_memory_fs
15-
from tests.helpers import make_test_dataset
14+
from zappend.fsutil import FileObj
1615

1716
try:
1817
# noinspection PyUnresolvedReferences

tests/fsutil/test_fileobj.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
# Permissions are hereby granted under the terms of the MIT License:
33
# https://opensource.org/licenses/MIT.
44

5-
import unittest
65
import os.path
6+
import unittest
77
import uuid
88

99
import fsspec
@@ -27,7 +27,7 @@ def test_repr(self):
2727
"FileObj('memory://test.zarr')", repr(FileObj("memory://test.zarr"))
2828
)
2929
self.assertEqual(
30-
"FileObj('memory://test.zarr'," " storage_options={'asynchronous': False})",
30+
"FileObj('memory://test.zarr', storage_options={'asynchronous': False})",
3131
repr(
3232
FileObj("memory://test.zarr", storage_options=dict(asynchronous=False))
3333
),

tests/fsutil/test_path.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66

77
import pytest
88

9-
from zappend.fsutil.path import split_components
10-
from zappend.fsutil.path import split_parent
9+
from zappend.fsutil.path import split_components, split_parent
1110

1211

1312
class SplitFilenameTest(unittest.TestCase):

tests/fsutil/test_transaction.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
import pytest
99

1010
from zappend.fsutil.fileobj import FileObj
11-
from zappend.fsutil.transaction import Transaction
12-
from zappend.fsutil.transaction import ROLLBACK_FILE
11+
from zappend.fsutil.transaction import ROLLBACK_FILE, Transaction
12+
1313
from ..helpers import clear_memory_fs
1414

1515

@@ -175,7 +175,7 @@ def test_it_raises_if_not_used_with_with(self):
175175
transaction = Transaction(test_root, rollback_dir)
176176
with pytest.raises(
177177
ValueError,
178-
match="Transaction instance must be" " used with the 'with' statement",
178+
match="Transaction instance must be used with the 'with' statement",
179179
):
180180
transaction._add_rollback_action("delete_file", "path", None)
181181

tests/slice/test_callable.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77
import pytest
88

99
from zappend.context import Context
10-
from zappend.slice.callable import import_attribute
11-
from zappend.slice.callable import to_slice_args
10+
from zappend.slice.callable import import_attribute, to_slice_args
1211

1312

1413
class ToSliceArgsTest(unittest.TestCase):

0 commit comments

Comments
 (0)