8000 Reenable mypy and flake8 linting on CI. by Carreau · Pull Request #695 · zarr-developers/zarr-python · GitHub
[go: up one dir, main page]

Skip to content

Reenable mypy and flake8 linting on CI. #695

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Python package
name: Linux Testing

on:
push:
Expand Down Expand Up @@ -47,7 +47,7 @@ jobs:
- name: Create Conda environment with the rights deps
shell: "bash -l {0}"
run: |
conda create -n zarr-env python==${{matrix.python-version}} bsddb3 numcodecs==0.6.4 lmdb pip nodejs
conda create -n zarr-env python==${{matrix.python-version}} bsddb3 numcodecs==0.6.4 lmdb pip nodejs flake8 mypy
conda activate zarr-env
npm install -g azurite
- name: Install dependencies
Expand Down Expand Up @@ -79,3 +79,11 @@ jobs:
#name: codecov-umbrella # optional
#fail_ci_if_error: true # optional (default = false)
verbose: true # optional (default = false)
- name: Linting
shell: "bash -l {0}"
run: |
conda activate zarr-env
flake8 zarr
mypy zarr


4 changes: 2 additions & 2 deletions zarr/indexing.py
Original file line number Diff line number Diff line change
Expand Up @@ -933,10 +933,10 @@ def __init__(self, selection, arr_shape):
def __iter__(self):
chunk1 = self.chunk_loc_slices[0]
nitems = (chunk1[-1].stop - chunk1[-1].start) * np.prod(
self.arr_shape[len(chunk1) :], dtype=int
self.arr_shape[len(chunk1):], dtype=int
)
for partial_out_selection in self.chunk_loc_slices:
start = 0
for i, sl in enumerate(partial_out_selection):
start += sl.start * np.prod(self.arr_shape[i + 1 :], dtype=int)
start += sl.start * np.prod(self.arr_shape[i + 1:], dtype=int)
yield start, nitems, partial_out_selection
1 change: 0 additions & 1 deletion zarr/tests/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -2427,7 +2427,6 @@ class TestArrayWithFSStorePartialRead(TestArray):
def create_array(read_only=False, **kwargs):
path = mkdtemp()
atexit.register(shutil.rmtree, path)
#use_listings_cache=kwargs.pop("use_listings_cache", True)
store = FSStore(path)
cache_metadata = kwargs.pop("cache_metadata", True)
cache_attrs = kwargs.pop("cache_attrs", True)
Expand Down
2 changes: 1 addition & 1 deletion zarr/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ def prepare_chunk(self):
start_points_buffer, count=self.nblocks, dtype=np.int32
)
self.start_points_max = self.start_points.max()
self.buff[16 : (16 + (self.nblocks * 4))] = start_points_buffer
self.buff[16: (16 + (self.nblocks * 4))] = start_points_buffer
self.n_per_block = blocksize / typesize

def read_part(self, start, nitems):
Expand Down
0