8000 Reenable mypy and flake8 linting on CI. (#695) · trinetta/zarr-python@b0b161b · GitHub
[go: up one dir, main page]

Skip to content

Commit b0b161b

Browse files
Carreaujoshmoore
andauthored
Reenable mypy and flake8 linting on CI. (zarr-developers#695)
* Reenable mypy and flake8 linting on CI. * Restrict flake8 to just zarr/ * Add zarr/ target to mypy command Co-authored-by: Josh Moore <j.a.moore@dundee.ac.uk>
1 parent 33ec64a commit b0b161b

File tree

4 files changed

+13
-6
lines changed

4 files changed

+13
-6
lines changed

.github/workflows/python-package.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
22
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
33

4-
name: Python package
4+
name: Linux Testing
55

66
on:
77
push:
@@ -47,7 +47,7 @@ jobs:
4747
- name: Create Conda environment with the rights deps
4848
shell: "bash -l {0}"
4949
run: |
50-
conda create -n zarr-env python==${{matrix.python-version}} bsddb3 numcodecs==0.6.4 lmdb pip nodejs
50+
conda create -n zarr-env python==${{matrix.python-version}} bsddb3 numcodecs==0.6.4 lmdb pip nodejs flake8 mypy
5151
conda activate zarr-env
5252
npm install -g azurite
5353
- name: Install dependencies
@@ -79,3 +79,11 @@ jobs:
7979
#name: codecov-umbrella # optional
8080
#fail_ci_if_error: true # optional (default = false)
8181
verbose: true # optional (default = false)
82+
- name: Linting
83+
shell: "bash -l {0}"
84+
run: |
85+
conda activate zarr-env
86+
flake8 zarr
87+
mypy zarr
88+
89+

zarr/indexing.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -933,10 +933,10 @@ def __init__(self, selection, arr_shape):
933933
def __iter__(self):
934934
chunk1 = self.chunk_loc_slices[0]
935935
nitems = (chunk1[-1].stop - chunk1[-1].start) * np.prod(
936-
self.arr_shape[len(chunk1) :], dtype=int
936+
self.arr_shape[len(chunk1):], dtype=int
937937
)
938938
for partial_out_selection in self.chunk_loc_slices:
939939
start = 0
940940
for i, sl in enumerate(partial_out_selection):
941-
start += sl.start * np.prod(self.arr_shape[i + 1 :], dtype=int)
941+
start += sl.start * np.prod(self.arr_shape[i + 1:], dtype=int)
942942
yield start, nitems, partial_out_selection

zarr/tests/test_core.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2427,7 +2427,6 @@ class TestArrayWithFSStorePartialRead(TestArray):
24272427
def create_array(read_only=False, **kwargs):
24282428
path = mkdtemp()
24292429
atexit.register(shutil.rmtree, path)
2430-
#use_listings_cache=kwargs.pop("use_listings_cache", True)
24312430
store = FSStore(path)
24322431
cache_metadata = kwargs.pop("cache_metadata", True)
24332432
cache_attrs = kwargs.pop("cache_attrs", True)

zarr/util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,7 @@ def prepare_chunk(self):
575575
start_points_buffer, count=self.nblocks, dtype=np.int32
576576
)
577577
self.start_points_max = self.start_points.max()
578-
self.buff[16 : (16 + (self.nblocks * 4))] = start_points_buffer
578+
self.buff[16: (16 + (self.nblocks * 4))] = start_points_buffer
579579
self.n_per_block = blocksize / typesize
580580

581581
def read_part(self, start, nitems):

0 commit comments

Comments
 (0)
0