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

Create a Base store class for Zarr Store. #612

Closed
wants to merge 9 commits into from

Conversation

Carreau
Copy link
Contributor

@Carreau Carreau commented Sep 19, 2020

In progress,

All existing stores in zarr-python now inherit from this; and thus all the test stop testing for a close() method and call it unconditionally.

The base store is a bit more strict in what it accepts than subclasses (only allow strings), as it is generally safer for the superclass to be stricter as anything that works with superclass will work with subclass, but the opposite is untrue.

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)

@Carreau
Copy link
Contributor Author

Carreau commented Oct 7, 2020

May want to write a store "wrapper", that handle usual mutable mapping and offer the right methods.

@pep8speaks
Copy link

pep8speaks commented Oct 22, 2020

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

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2021-03-10 21:00:31 UTC

@codecov
Copy link

codecov bot commented Oct 26, 2020

Codecov Report

Merging #612 (566d145) into master (17728e8) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff            @@
##           master     #612    +/-   ##
========================================
  Coverage   99.93%   99.94%            
========================================
  Files          26       28     +2     
  Lines        9945    10307   +362     
========================================
+ Hits         9939    10301   +362     
  Misses          6        6            
Impacted Files Coverage Δ
zarr/convenience.py 100.00% <100.00%> (ø)
zarr/core.py 100.00% <100.00%> (ø)
zarr/creation.py 100.00% <100.00%> (ø)
zarr/hierarchy.py 100.00% <100.00%> (ø)
zarr/storage.py 100.00% <100.00%> (ø)
zarr/tests/test_convenience.py 100.00% <100.00%> (ø)
zarr/tests/test_core.py 100.00% <100.00%> (ø)
zarr/tests/test_creation.py 100.00% <100.00%> (ø)
zarr/tests/test_hierarchy.py 100.00% <100.00%> (ø)
zarr/tests/test_storage.py 100.00% <100.00%> (ø)
... and 3 more

zarr/storage.py Outdated Show resolved Hide resolved
zarr/storage.py Outdated Show resolved Hide resolved
zarr/storage.py Outdated Show resolved Hide resolved
zarr/storage.py Outdated Show resolved Hide resolved
zarr/storage.py Outdated Show resolved Hide resolved
zarr/storage.py Outdated Show resolved Hide resolved
zarr/storage.py Outdated Show resolved Hide resolved
zarr/hierarchy.py Outdated Show resolved Hide resolved
zarr/storage.py Outdated
# def keys()
# def items()
# def values()
# def get
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Cleanup this,

zarr/hierarchy.py Outdated Show resolved Hide resolved
zarr/storage.py Outdated Show resolved Hide resolved
zarr/tests/test_hierarchy.py Outdated Show resolved Hide resolved
@Carreau Carreau force-pushed the base-store branch 2 times, most recently from 01a68d5 to 0437842 Compare November 6, 2020 21:54
@Carreau Carreau force-pushed the base-store branch 2 times, most recently from 14392e9 to 19fe17c Compare November 18, 2020 17:45
@Carreau Carreau marked this pull request as ready for review December 2, 2020 18:45
@Carreau Carreau added this to the v2.7 milestone Dec 2, 2020
Carreau added 9 commits March 10, 2021 12:59
Unconditionally close store in tests.

All the tested stores should now have a `close()` method we can call and
will be no-op if the stores do not need closing.

Turn UserWarnings into errors

And turn then back into only warnings into relevant tests.
This ensure that we are not using deprecated functionalities, except
when testing for it.

initially based on 318eddcd, and later 1249f35 and 0f89a96
@Carreau
Copy link
Contributor Author

Carreau commented Mar 10, 2021

@joshmoore test should be passing, only a rebase and some cleanup might still be necessary after the rebase to get coverage up to 100%. Do you want me to fork master into a dev branch and target that for a dev branch ?

@joshmoore
Copy link
Member

Do you want me to fork master into a dev branch and target that for a dev branch ?

@Carreau, I didn't receive any objections to considering the mainline a pre-release while you get these branches in. Only requirement from my side would be to get 2.7.0 out the door. If we need a quick 2.7.x before you're done merging, then that would need to be from a stable branch.

@joshmoore
Copy link
Member

Having a think last night, what would everyone say to having this be the base for a v3 branch? Perhaps even start releasing pre-releases ASAP.

@joshmoore
Copy link
Member

Closing in favor of #789

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.

3 participants