-
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
WIP: Move all modules into root namespace. #862
Conversation
Codecov Report
@@ Coverage Diff @@
## next #862 +/- ##
==========================================
- Coverage 86.32% 85.57% -0.76%
==========================================
Files 51 42 -9
Lines 4687 4498 -189
Branches 1022 977 -45
==========================================
- Hits 4046 3849 -197
- Misses 456 471 +15
+ Partials 185 178 -7
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR should be targeting master
. We rebased next
and merged it into master
. At present, next
is out of date and can be archived/deleted (unless it preserves some history we want to keep).
@@ -28,6 +28,7 @@ repos: | |||
- id: pyupgrade | |||
args: | |||
- --py38-plus | |||
exclude: '_vendor' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like this to use the same (?x)^(
syntax as the other exclusions.
^signac/common/configobj/| | ||
^signac/common/deprecation/| | ||
^signac/_vendor/configobj/| | ||
^signac/_vendor/deprecation/| | ||
^signac/db/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this line be removed?
@@ -31,7 +31,7 @@ concurrency = thread,multiprocessing | |||
parallel = True | |||
source = signac | |||
omit = | |||
*/signac/common/configobj/*.py | |||
*/signac/_vendor/configobj/*.py |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we make this broader?
*/signac/_vendor/configobj/*.py | |
*/signac/_vendor/* |
@@ -637,7 +635,7 @@ def main_update_cache(args): | |||
# UNCOMMENT THE FOLLOWING BLOCK WHEN THE FIRST MIGRATION IS INTRODUCED. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just realized this PR is targeting next
. The next
branch is no longer up to date, and this PR should be targeting master
.
Here's what the directory structure currently looks like in this PR:
Overall I would say that this is pretty good. Merging in
Thinking ahead to a world where we support different layouts than the current project/job layout, we should make sure that the current organization would support such an API (with no expectation that this gets implemented any time soon, just trying to future-proof the design). Here's one example of how this is relevant now. If we view signac's future as supporting arbitrary (or at least much more general) layouts of directories, APIs like |
I largely agree with your assessments @vyasr. For the places you asked for feedback:
|
To clarify, you're saying that if we keep these functions public you would prefer that they stay at the top level of the package? I don't particularly like that we could end up littering the top level of the package with files like
I don't want to spend much time, only as much as is required to address the other questions I raised. If we have a decision that we already have to make about other APIs as part of the package reorg, I would like us to make the decision that would most easily allow implementing the more general layouts in the future without API breaks (or at least weigh that factor in). I also don't want to spend a lot of time thinking about it, but I do think it's worth considering in our discussions. |
Yes.
I know we debated this when designing I'm lightly biased towards the status quo -- I don't think the proposed motivation to change (reducing friction for an arbitrarily general future that isn't hotly demanded / receiving current-era developer attention) is sufficiently strong, especially as package development slows. Unless you have other reasons in mind or think we can get a consensus of developers/users to agree that this is worth considering further, I would try to follow the minimal/expedient/least-breaking path here. |
That goal is secondary, you may have missed the primary one:
I think having a single way to do things is easier to teach. To take a specific example, if we move
On a tangentially related note, after seeing how signac-flow's FlowProject has evolved I am somewhat wary of adding methods to a class only to see it turn into a container for far too much functionality and implementation. signac's current approach of having free function implementations that are called by class methods helps, but from a simplicity perspective I would prefer to have more functionality in free functions that users are encouraged to call. It improves encapsulation (assuming that the free functions only rely on the public APIs of the class) and makes the code more composable. So that's another consideration for why I'm proposing we reconsider having both APIs available. Having said that, this is a pretty minor point. I'm also pretty OK with leaving both visible, I'm just nitpicking while we have the opportunity before anything gets set in stone for 2.0. |
Closing in favor of #868. |
Description
Closes #756 .
Motivation and Context
Checklist: