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

Try to converge on internal types consistency. #574

Closed
wants to merge 1 commit into from

Commits on Jul 1, 2020

  1. Try to converge on internal types consistency.

    While it is convenient for user on high level API to be able to pass
    arround many types (array, bytes, or even dictionary, list, strings),
    It can make it relatively hard to follow internally if the types are not
    consistant.
    
    In particular this can relatively complicate weaving the v3 spec into
    the core of Zarr and add a number of conditional if we are not sure of
    the type we get.
    
    This try to be a little more consistent in what the implementation
    _emits_ right now this try to make sure that all the core only try to
    converge toward bytes, so that store users can expect to alway get bytes
    back from Zarr-Python stores, and as much as possible give bytes back,
    and mostly affects the ConsolidatedMetadataStore which used to – unlike
    other store – return objects instead of bytes, as well as the tests
    directly testing the stores.
    
    We of course can't be too strict as some existing store may have stored
    some values as not-bytes (pickle), and we still want to support this for
    the time being,but with this changes, we can add many `assert
    isinstance(x, bytes_like)` in many places ans still have the test suite
    to pass.
    
    In particular in all the decode/encode metadata functions, and Group
    class.
    
    One extra change in test is the removal of an old conditional import of
    h5py in the test suite which is unnecessary since introduction of the
    pytest's `importorskip` for h5py tests.
    Carreau committed Jul 1, 2020
    Configuration menu
    Copy the full SHA
    e8e5d48 View commit details
    Browse the repository at this point in the history