-
-
Notifications
You must be signed in to change notification settings - Fork 330
Add type hints to zarr.create #1536
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
Changes from 9 commits
aa8d1e2
ddeabc5
5c17cb0
a60fceb
451943a
424867e
4fbd22c
a34ed89
33ed933
0380cba
35bae0a
4d22d4f
73cedea
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,19 @@ | ||
import os | ||
from collections import defaultdict | ||
from threading import Lock | ||
from typing import Protocol | ||
|
||
import fasteners | ||
|
||
|
||
class ThreadSynchronizer: | ||
class Synchronizer(Protocol): | ||
"""Base class for synchronizers.""" | ||
|
||
def __getitem__(self, item): | ||
... | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thoughts welcome on how to make codecov happy with these lines. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I couldn't find anything obvious in https://docs.codecov.com/docs/ignoring-paths, seems like it only has per-file granularity. Since we know the decrease in coverage isn't meaningful, I'd be fine ignoring it here. In the future maybe we put protocols in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've updated the code coverage config to ignore lines that are "...". There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. good idea! |
||
|
||
|
||
class ThreadSynchronizer(Synchronizer): | ||
"""Provides synchronization using thread locks.""" | ||
|
||
def __init__(self): | ||
|
@@ -24,7 +32,7 @@ def __setstate__(self, *args): | |
self.__init__() | ||
|
||
|
||
class ProcessSynchronizer: | ||
class ProcessSynchronizer(Synchronizer): | ||
"""Provides synchronization using file locks via the | ||
`fasteners <https://fasteners.readthedocs.io/en/latest/api/inter_process/>`_ | ||
package. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
from typing import Literal, Protocol, Union | ||
|
||
ZARR_VERSION = Literal[2, 3] | ||
DIMENSION_SEPARATOR = Literal[".", "/"] | ||
MEMORY_ORDER = Literal["C", "F"] | ||
|
||
|
||
PathLike = Union[str, bytes, None] | ||
|
||
|
||
class MetaArray(Protocol): | ||
def __array_function__(self, func, types, args, kwargs): | ||
... |
Uh oh!
There was an error while loading. Please reload this page.