-
-
Notifications
You must be signed in to change notification settings - Fork 310
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
Refactor core.py #1329
Comments
I agree that a refactoring is needed and would be eager to help. |
Trying to list different use-cases we might want to have in mind when refactoring the API:
Some questions come to my mind. They don't all need to be answered for the refactoring, but I assume they still might help:
(The refactoring should be no means solve any of those things above, rather make solving them easy if we think they might come up soon). Also, we might want to wait for #1323 to be done before starting a larger refactoring. What are the next steps? I'd propose to
|
Sorry I am slow to reply here. Some of your suggestions were the target of my "context" suggestion, which was proposed as a way of getting some of this without a refactor. Of course, that's not to say that a refactor might not be the best option in the long term! Also, I know that there already is a route to partial reads (but I don't know how to make it happen) and considerable work on sharding. As a reminder, the contexts idea was to be able to pass a dict to the storage and codec reader methods, specifying additional information about what was requested (key name, part of the chunk requested, location in output, class of output array...). This could be a way to implement partial reads, sharding, custom array classes - again, in the current API. The calling function can check the signature of a codec/store to see if it accepts the dict, and any implementation can pick and choose what information to make use of, so you maintain backward compatibility. It is interesting to see async in the list, though! Surfacing that through the current API, as opposed to my POC subclassing, would definitely require code changes at multiple levels. |
Atm there is quite some 🍝 code in
core.py
, especially around the different read and write cases (partial reads, decode, encode, …). It would be great to refactor this a bit, some ideas:The text was updated successfully, but these errors were encountered: