-
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
get_project 'root' keyword fails silently #779
Comments
@rskye144 👋 thanks for the bug report 😍 Are you interested in contributing a PR to fix this issue? We can provide some help/guidance if you are interested! |
I think the right place to put this is below this line: signac/signac/common/config.py Line 147 in aed17f3
I think it should say: def load_config(root=None, local=False):
"""Load configuration, searching upward from a root path."""
if root is None:
root = os.getcwd()
if not os.path.isdir(root):
raise ValueError(f"The root directory '{root}' does not exist.")
# rest of the function |
I can give a PR a try! It will be my first time doing that, so any advice is appreciated. |
One key piece that I didn't notice earlier: this bug occurs fails for relative paths contained inside the current directory, when the current directory contains a signac project. Getting a nonexistent absolute path like |
* first try at changing config.py * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * changed pytest location to tests * changed error catch to get_project() * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * added contribution requirements and fixed double formatting * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update changelog. * Revert whitespace changes. * Remove unused import. * Update contributors.yaml Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Bradley Dice <[email protected]>
Resolved by #792 |
Description
When the
get_project
function is called with a project root that does not exist, it silently defaults to a project in the current directory.To reproduce
Error also occurs because paths with
~
are not expanded, producing an unexpected error; @bdice suggests could consider adding:Error output
No error is raised (which is wrong, an error/warning should be raised)
The text was updated successfully, but these errors were encountered: