Skip to content

Commit

Permalink
V3 update pre commit (#1808)
Browse files Browse the repository at this point in the history
  • Loading branch information
jhamman authored Apr 23, 2024
1 parent f046322 commit f7993db
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 28 deletions.
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ default_language_version:
python: python3
repos:
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: 'v0.2.1'
rev: 'v0.4.1'
hooks:
- id: ruff
args: ["--fix", "--show-fixes"]
Expand All @@ -18,11 +18,11 @@ repos:
- id: codespell
args: ["-L", "ba,ihs,kake,nd,noe,nwo,te,fo,zar", "-S", "fixture"]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v4.6.0
hooks:
- id: check-yaml
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.8.0
rev: v1.9.0
hooks:
- id: mypy
files: src
Expand Down
1 change: 1 addition & 0 deletions src/zarr/convenience.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Convenience functions for storing and loading data."""

import itertools
import os
import re
Expand Down
4 changes: 2 additions & 2 deletions src/zarr/n5.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""This module contains a storage class and codec to support the N5 format.
"""
"""This module contains a storage class and codec to support the N5 format."""

import os
import struct
import sys
Expand Down
1 change: 1 addition & 0 deletions src/zarr/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
path) and a `getsize` method (return the size in bytes of a given value).
"""

import atexit
import errno
import glob
Expand Down
2 changes: 1 addition & 1 deletion src/zarr/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ def __init__(self, group, expand=False, level=None):
UP_AND_RIGHT="\u2514",
HORIZONTAL="\u2500",
VERTICAL="\u2502",
VERTICAL_AND_RIGHT="\u251C",
VERTICAL_AND_RIGHT="\u251c",
)

def __bytes__(self):
Expand Down
6 changes: 2 additions & 4 deletions src/zarr/v3/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,15 +111,13 @@ def parse_configuration(data: JSON) -> JSON:
@overload
def parse_named_configuration(
data: JSON, expected_name: Optional[str] = None
) -> Tuple[str, Dict[str, JSON]]:
...
) -> Tuple[str, Dict[str, JSON]]: ...


@overload
def parse_named_configuration(
data: JSON, expected_name: Optional[str] = None, *, require_configuration: bool = True
) -> Tuple[str, Optional[Dict[str, JSON]]]:
...
) -> Tuple[str, Optional[Dict[str, JSON]]]: ...


def parse_named_configuration(
Expand Down
15 changes: 5 additions & 10 deletions tests/v3/test_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,19 @@ def test_product(data: Tuple[int, ...]):


# todo: test
def test_concurrent_map():
...
def test_concurrent_map(): ...


# todo: test
def test_to_thread():
...
def test_to_thread(): ...


# todo: test
def test_enum_names():
...
def test_enum_names(): ...


# todo: test
def test_parse_enum():
...
def test_parse_enum(): ...


@pytest.mark.parametrize("data", [("foo", "bar"), (10, 11)])
Expand Down Expand Up @@ -93,5 +89,4 @@ def parse_dtype(data: Tuple[str, np.dtype]):


# todo: figure out what it means to test this
def test_parse_fill_value():
...
def test_parse_fill_value(): ...
12 changes: 4 additions & 8 deletions tests/v3/test_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,17 @@


# todo: test
def test_datatype_enum():
...
def test_datatype_enum(): ...


# todo: test
# this will almost certainly be a collection of tests
def test_array_metadata_v3():
...
def test_array_metadata_v3(): ...


# todo: test
# this will almost certainly be a collection of tests
def test_array_metadata_v2():
...
def test_array_metadata_v2(): ...


@pytest.mark.parametrize("data", [None, ("a", "b", "c"), ["a", "a", "a"]])
Expand All @@ -37,8 +34,7 @@ def parse_dimension_names_invalid(data: Any) -> None:


# todo: test
def test_parse_attributes() -> None:
...
def test_parse_attributes() -> None: ...


def test_parse_zarr_format_v3_valid() -> None:
Expand Down

0 comments on commit f7993db

Please sign in to comment.