-
Notifications
You must be signed in to change notification settings - Fork 36
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
Reorganize modules for signac 2.0 #756
Comments
I've tried to analyze the import structure using pydeps on next and here is the result ( Here are my main conclusions:
Based on this and some other considerations, I recommend to adopt the following package structure:
Note: The above package structure is not exhaustive. @glotzerlab/signac-committers I would be interested in your take before I move forward with the implementation. |
Regarding the
|
I think I am mostly on board with the suggested structure. Some minor comments/questions:
|
No need for another discussion, I probably just forgot about the rationale. One alternative to consider that would improve modularity is to use a factory function that can be imported from the top-level namespace that returns the object with the derived class for a chosen backend (potentially with default): from synced_collections import get_buffered_attr_dict
document = get_buffered_attr_dict(backend="json", filename=fn_doc, write_concern=True) instead of from synced_collections.backends.collection_json import BufferedJSONAttrDict
document = BufferedJSONAttrDict(filename=fn_doc, write_concern=True) The type of |
Happy to adopt whatever is most common.
My rationale was that warnings and error classes are maybe something that users want to directly import, i.e., the module is part of the API, and that those classes could be considered "meta" compared to modules that implement core business logic. However, I like your suggestion of moving all
Similar to warnings, and errors, I consider the |
My votes:
I think making a prototype will make things easier to concretely evaluate. To reiterate previous discussions, we should make these changes at the last possible moment before 2.0 is released, so that rebasing |
I wouldn't mind adding a factory, although we'd probably want to put a bit more thought into the API; I would probably expect the Purely as a matter of preference I'm probably extern > vendor > thirdparty, but I don't really care what we choose. I definitely want it underscored, though. It sounds like we're aligned on moving @bdice if we had a prototype, what would you evaluate? What imports look like in a script using signac? How deep the directory tree is? Something else? |
Yes, the depth of the directory tree and where various files end up because |
I'm in favor of seeing a "prototype" that is just ascii on how it will all look. Also +1 to using |
I already experimented with creating a prototype, but obviously rewiring all the imports takes some effort. @bdice pointed out that we should wait with this until a late stage before merging |
That's why I asked about what exactly @bdice wanted to see from a prototype. I was going to suggest exactly what @mikemhenry did, making an ASCII diagram to see what it would look like. Rewriting all the imports now just for a prototype is a lot of effort to expend if we know that we'll have to rewrite them all again later. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This is the next item on the to-do list. |
The current layout of signac reflects the state of the package as it was originally conceived, i.e. as a starting point for users whose data would eventually grow into a full-sized database like MongoDB. However, experience with signac has shown that in practice most of our users stay with the job-project data model, which has become the true core of signac. Many parts of signac associated with more traditional database functionality will be removed in signac 2.0, and some of the core data structures like the JSONDict have been reimplemented in a generalized fashion in
synced_collections
(which will be spun out into its own package, see #755), so signac 2.0 will be a much leaner package than the 1.x line. For 2.0 we should reorganize our files into a flatter namespace that is more familiar to newer developers who are not familiar with or constrained by the origins of the project or its original goals.The text was updated successfully, but these errors were encountered: