refactor(flopy_io, notebooks): update path cleaning mechanism#1728
Merged
Conversation
a2906a2 to
1c6aba0
Compare
2 tasks
Codecov Report
@@ Coverage Diff @@
## develop #1728 +/- ##
=========================================
- Coverage 71.9% 71.9% -0.1%
=========================================
Files 253 253
Lines 55987 55996 +9
=========================================
+ Hits 40270 40275 +5
- Misses 15717 15721 +4
|
0a97e89 to
36b5849
Compare
775eddf to
d2f3442
Compare
jlarsen-usgs
approved these changes
Feb 24, 2023
d2f3442 to
200d03c
Compare
200d03c to
72f6930
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#1711 cleaned up absolute paths containing usernames from notebooks and introduced a function
relpath_printstrto traprelpatherrors due to different drives on Windows. This isn't always sufficient to keep absolute paths out of notebooks if used with a path sharing no prefix with the starting path (e.g. if an exe isn't in the flopy project dir, but somewhere like/usr/bin)Rename
relpath_printstr->relpath_safesince it returns the edited path without printing. Update usages. Refactor to follow builtinrelpathsignature and defaults.Introduce a function
scrub_loginto obfuscate login names with***. Optionally scrub inrelpath_safe.Suppress output in notebooks with
silent=Trueand collect withreport=Truebefore printing, avoiding the executable log statement if possible, otherwise usescrub_login()to hide username in absolute pathsLint notebooks and test scripts