Skip to content
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

Add some typings informations and typecheck #589

Merged
merged 1 commit into from Sep 19, 2020

Conversation

Carreau
Copy link
Contributor

@Carreau Carreau commented Aug 26, 2020

Mostly make it a bit clearer what is allowed/expected where.
In particular many of the decode fucntions allow already decoded
objects.

TODO:

  • Add unit tests and/or doctests in docstrings
  • Add docstrings and API docs for any new/modified user-facing classes and functions
  • New/modified features documented in docs/tutorial.rst
  • Changes documented in docs/release.rst
  • AppVeyor and Travis CI passes
  • Test coverage is 100% (Coveralls passes)

@pep8speaks
Copy link

pep8speaks commented Sep 8, 2020

Hello @Carreau! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

Line 471:23: E741 ambiguous variable name 'l'

Comment last updated at 2020-09-18 16:50:15 UTC

@Carreau
Copy link
Contributor Author

Carreau commented Sep 8, 2020

Added Typing to storage.py.

Note in particular that some function can get bytes/str/anything that
can be stringified though others only can get str/None as they don't call normalize on path.

@Carreau Carreau added this to the v2.5 milestone Sep 14, 2020
Mostly make it a bit clearer what is allowed/expected where.
In particular many of the decode functions allow already decoded
objects.

Add Typing to store.

Note in particular that some function can get bytes/str/anything that
can be stringified though others only can get str/None as they don't
call normalize on path.
@Carreau
Copy link
Contributor Author

Carreau commented Sep 18, 2020

rebased to fix conflicts in pytest.ini, no other changes.

@Carreau
Copy link
Contributor Author

Carreau commented Sep 19, 2020

All tests are passing and the push was only to fix a trivial conflict in pytest.ini merging. Thanks.

@Carreau Carreau merged commit 0e465a2 into zarr-developers:master Sep 19, 2020
@Carreau Carreau deleted the mypy branch September 19, 2020 20:40
@@ -74,27 +76,27 @@ def encode_array_metadata(meta):
return json_dumps(meta)


def encode_dtype(d):
def encode_dtype(d: np.dtype) -> str:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see #700

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants