question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Refactoring stores into a separate library

See original GitHub issue

Over time the Zarr library accumulated more compressors and even some Cython code related to that effort until it made sense for these to go out and live as their own library, Numcodecs. Similarly we seem to be accumulating many stores, perhaps they would be best suited in another library that Zarr depends on.

The stores themselves actually don’t really need to know about compression, Groups, or Arrays (with the exception of some layers on top of the stores). Really stores are just key-value stores that allow associating some blob with some key. As such it may be possible for this library to have fewer requirements (if any) and be accessible to a larger group of people that are just interested in things that provide the MutableMapping interface to their storage format of choice.

By breaking out the stores as a separate library, we gain another benefit. Namely we can release the stores at a different time scale from Zarr itself. So if we get a new store or a bug fix for a store, we can do a new release even while Zarr itself has not changed much.

There are probably more reasons to consider this move. Would be curious to hear what others think about this?

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
rabernatcommented, Mar 4, 2019

I really like this idea.

0reactions
mbrcommented, Apr 1, 2019

The second is that zarr stores supports some optional methods, including some which are “hierarchy-aware”, i.e., when using keys that include a ‘/’ character and wanting to list keys at a given level, akin to listing the contents of a directory if using a file system.

So far, I have deliberately omittied these kinds of hierarchies; / characters are also not allowed in keys; this is to keep things are portable and simple as possible. There is support for rolling this yourself in a way through the keys method which takes a prefix argument for this reason.

It’s worth pointing out this really helps as we can leverage other methods of MutableMapping like update or clear and they just work off of the handful of methods we define. These are pretty handy when copying or removing data.

I believe that MutableMapping simply predates the development of simplekv, I am not against adding them. Some, like len, might be hard to implement for all backends though and I am not sure if it’s okay to just raise something like NotImplemented there.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Split 1 large C++ classes into multiple classes, whilst still ...
So I'm currently working on a project refactoring an Arduino library, using the vs plugin vMicro. The library itself had various large groups...
Read more >
The Big Refactor - Medium
Move the newly separated micro-libraries into separate repositories with their own versioning and build pipelines etc.
Read more >
Refactoring my code that depends on a renamed library method
I'd create a class with the same name, create the beauty method and then rename/refactor it to makeBeautiful . Your IDE can do...
Read more >
Refactoring Python Applications for Simplicity
In this step-by-step tutorial, you'll learn how to refactor your Python application to be simpler and more maintainable and have fewer bugs.
Read more >
Refactoring an Ionic Application into Reuseable Nx Libraries
We investigate how to refactor a basic Ionic application into Nx libraries for organisation and code resuse.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found