-
Notifications
You must be signed in to change notification settings - Fork 101
Drop temporary_directory/temporary_cd for tempfile #595
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
Conversation
|
This pull request introduces 1 alert when merging dd4af89 into 5abd8d9 - view on LGTM.com new alerts:
|
j-wags
left a comment
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. I tried to think of cases where making and entering a temporary directory in separate steps would be essential, but nothing comes to mind. This is great, and I'm happy to be removing unneeded code.
|
@mattwthompson (cc @j-wags ) I don't think the Also snippets like would likely be better to just use a |
| import re | ||
| import subprocess | ||
| import textwrap | ||
| import tempfile |
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.
Oops, thought I fixed this typo
That's right. I was fairly surprised the tests passed but that shouldn't have been the criteria anyway. I'll fix this tomorrow. |
|
Ahhh, simon is correct above, just saw this and came to say the same thing -- There are still some places where we need to cd into the temporary directory. I'm adding |
|
@j-wags https://github.com/SimonBoothroyd/nonbonded/blob/621151c747925aefeb368d0a2bc99c4305de6dd7/nonbonded/library/utilities/utilities.py#L34 may be helpful - it optionally temporarily cd's into a temporary directory. |
|
Ah, that's really helpful. For now I'm going to revert it to two nested contexts (first make directory, then enter it), since that's more explicit about what's happening. I think this will continue to be a tricky area of the codebase, so "more explicit" will be good here. |
Fixes #503
Arguably instead of just removing the functions, they could be replaced with some sort of
DeprecationWarning. But downstream users are probably not importing these functions directly. Open to suggestions here