-
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
Rename root
parameter to path
.
#758
Conversation
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.
There's still a bit of old terminology (like "job workspace") that needs to be fixed.
signac/contrib/project.py
Outdated
@@ -78,13 +78,13 @@ class Project: | |||
A :class:`Project` may only be constructed in a directory that is already a | |||
signac project, i.e. a directory in which :func:`~signac.init_project` has | |||
already been run. If project discovery (searching upwards in the folder | |||
hierarchy until a project root is discovered) is desired, users should | |||
hierarchy until a project is discovered) is desired, users should |
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 say how a project is discovered? Like the presence of a signac.rc
file?
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 would need to consult the implementation to refresh myself but I think it's defined by the existence of a .signac/config
file (?). Either way, it may be better to write this definition in one place (not in every method/function docstring), and it's outside the scope of this PR which is focused on an API change.
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.
@@ -1370,7 +1370,7 @@ def _read_cache(self): | |||
def temporary_project(self, dir=None): | |||
"""Context manager for the initialization of a temporary project. | |||
The temporary project is by default created within the root project's | |||
The temporary project is by default created within the parent project's |
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.
"Parent project" doesn't sound the same as "root" in this context. To me, "parent" sounds like a higher level then the project. This could be confusing once we have nested projects
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.
Well... it is sort of a parent. The temporary project is created in a subdirectory of the project instance calling this. This is awkward almost any way I can think of writing it, since it's hard to explain the benefit of this implementation detail without describing specific filesystem hierarchies.
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.
Proposal to also rewrite the beginning of the docstring to be:
def temporary_project(self, dir=None):
""Context manager that initializes a temporary project within the calling Project.
The temporary project path defaults to that of the calling project workspace.
...
"""
I think this helps convey the relation better and uses more consistent terms.
btw - we should rename the argument from dir
to path
.
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 is focused on changing root
to path
, primarily in the get_project
and init_project
functions. A follow-up PR to address this would be appropriate.
I agree with your suggestions and I agree that the temporary project functionality and docs need a careful look before releasing 2.0. I just don't think this PR is the right place to iterate on that.
the specified directory, otherwise only return projects with | ||
a directory whose path is identical to the specified path | ||
argument (Default value = True). |
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 would like to see the updated signac-docs page on what a project is now. See my other comment about whether a project "has" a path.
(not blocking, but for curiosity and to start explaining to users)
Co-authored-by: Corwin Kerr <[email protected]>
Co-authored-by: Corwin Kerr <[email protected]>
Co-authored-by: Corwin Kerr <[email protected]>
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.
Check 2 rewordings in this commit: 74d7f78
plus this comment: #758 (comment)
I'm not sure if 74d7f78 is quite accurate. If Perhaps it should say something like: |
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.
Thanks for bearing with me!
Notes for future PRs:
- Functionality and description of
Project.temporary_project
- Review docstrings for consistent terminology.
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.
Looks good to me. It reminds me of where's waldo
* Change root to path. * Update tests to use path instead of root. * Update benchmarks to use path instead of root. * Update changelog. * Update changelog.txt Co-authored-by: Corwin Kerr <[email protected]> * Update signac/contrib/project.py Co-authored-by: Corwin Kerr <[email protected]> * Update tests/test_project.py Co-authored-by: Corwin Kerr <[email protected]> * Remove use of root. * Refactor docs for fn/isfile methods. * Bradley check these rewordings * Replace outdated job workspace directory * One more outdated job workspace directory * Apply minor changes * Describe path argument searching Co-authored-by: Corwin Kerr <[email protected]>
* Change root to path. * Update tests to use path instead of root. * Update benchmarks to use path instead of root. * Update changelog. * Update changelog.txt Co-authored-by: Corwin Kerr <[email protected]> * Update signac/contrib/project.py Co-authored-by: Corwin Kerr <[email protected]> * Update tests/test_project.py Co-authored-by: Corwin Kerr <[email protected]> * Remove use of root. * Refactor docs for fn/isfile methods. * Bradley check these rewordings * Replace outdated job workspace directory * One more outdated job workspace directory * Apply minor changes * Describe path argument searching Co-authored-by: Corwin Kerr <[email protected]>
* Change root to path. * Update tests to use path instead of root. * Update benchmarks to use path instead of root. * Update changelog. * Update changelog.txt Co-authored-by: Corwin Kerr <[email protected]> * Update signac/contrib/project.py Co-authored-by: Corwin Kerr <[email protected]> * Update tests/test_project.py Co-authored-by: Corwin Kerr <[email protected]> * Remove use of root. * Refactor docs for fn/isfile methods. * Bradley check these rewordings * Replace outdated job workspace directory * One more outdated job workspace directory * Apply minor changes * Describe path argument searching Co-authored-by: Corwin Kerr <[email protected]>
* Change root to path. * Update tests to use path instead of root. * Update benchmarks to use path instead of root. * Update changelog. * Update changelog.txt Co-authored-by: Corwin Kerr <[email protected]> * Update signac/contrib/project.py Co-authored-by: Corwin Kerr <[email protected]> * Update tests/test_project.py Co-authored-by: Corwin Kerr <[email protected]> * Remove use of root. * Refactor docs for fn/isfile methods. * Bradley check these rewordings * Replace outdated job workspace directory * One more outdated job workspace directory * Apply minor changes * Describe path argument searching Co-authored-by: Corwin Kerr <[email protected]>
* Change root to path. * Update tests to use path instead of root. * Update benchmarks to use path instead of root. * Update changelog. * Update changelog.txt Co-authored-by: Corwin Kerr <[email protected]> * Update signac/contrib/project.py Co-authored-by: Corwin Kerr <[email protected]> * Update tests/test_project.py Co-authored-by: Corwin Kerr <[email protected]> * Remove use of root. * Refactor docs for fn/isfile methods. * Bradley check these rewordings * Replace outdated job workspace directory * One more outdated job workspace directory * Apply minor changes * Describe path argument searching Co-authored-by: Corwin Kerr <[email protected]>
Description
See #757.
Motivation and Context
Resolves #757.
Checklist: