-
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
Remove user-provided project name from API #677
Conversation
14f1287
to
e226575
Compare
Codecov Report
@@ Coverage Diff @@
## next #677 +/- ##
==========================================
+ Coverage 85.82% 85.84% +0.01%
==========================================
Files 51 51
Lines 5024 5038 +14
Branches 1104 1109 +5
==========================================
+ Hits 4312 4325 +13
- Misses 515 516 +1
Partials 197 197
Continue to review full report at Codecov.
|
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.
Suggestions attached.
…fix tests that would fail.
…e other than 'project'.
cf9c79a
to
bf4771f
Compare
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 looks good to me!
edit: I see Python 3.6 tests are failing. The underlying problem is that version.parse
only has the attribute major
for packaging >= 20.0. We pin Python 3.6 to packaging==15.0
. This can be fixed by using version.parse(__version__).release[0]
instead of version.parse(__version__).major
.
https://packaging.pypa.io/en/latest/changelog.html#id14 (the linked issue is wrong, it should point to pypa/packaging#225)
@bdice thanks for debugging that for me and making the change painless! |
@vyasr I think the method I proposed above would be a bit less hacky with version parsing but I approve the fix either way. |
@csadorf feel free to merge this if you think it's ready. |
… rely on Project.init_project for warnings.
Thanks @vyasr ! |
Description
This PR removes the ability for users to set a project name. The name still exists, but it is always just "project". These changes were split off from #643. Currently this changeset only includes the minimal set of changes to ensure that tests pass, but a large number of tests will now trigger warnings. Once reviewers indicate their approval of the new API I can go through and clean up tests.
Specifically, the changes here ensure that in 2.0 a user who accidentally passes a project name as either a positional or keyword argument will only see a warning, not an error. This choice is intended to provide a softer off-ramp for project names since they have been an integral part of signac since its inception. The only cases that were previously valid that will now fail are if the user provides multiple positional arguments in order to set the root directory, e.g.
init_project("project_name", "/root/directory")
. I think that this is an acceptable level of breakage since the vast majority of users do not set the root explicitly.I haven't removed the
Project.id
property here since the name still exists and users can still access it until the 2.0 migration actually removes it. I will remove the id property at that time.Motivation and Context
Prep for 2.0. Part of #541.
Types of Changes
1The change breaks (or has the potential to break) existing functionality.
Checklist:
If necessary: