-
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
Clean up utility functions. #597
Conversation
"const2": {"const3": 0}, | ||
"const4": {}, |
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 edge case was being missed until I added this test:
signac/signac/contrib/utility.py
Lines 339 to 340 in 257c931
elif key is not None: | |
yield key, t |
Codecov Report
@@ Coverage Diff @@
## next #597 +/- ##
==========================================
+ Coverage 83.77% 84.20% +0.42%
==========================================
Files 54 54
Lines 5535 5502 -33
Branches 1021 1014 -7
==========================================
- Hits 4637 4633 -4
+ Misses 668 641 -27
+ Partials 230 228 -2
Continue to review full report at Codecov.
|
@@ -41,7 +41,7 @@ | |||
from .indexing import _SignacProjectCrawler | |||
from .job import Job | |||
from .schema import ProjectSchema | |||
from .utility import _mkdir_p, _nested_dicts_to_dotted_keys, split_and_print_progress | |||
from .utility import _mkdir_p, _nested_dicts_to_dotted_keys, _split_and_print_progress |
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.
If I've had to guess the function was introduced prior to having the tqdm dependency or because there was some kind of threading issue or so with tqdm. But I agree, we should certainly try to replace it with tqdm if possible.
* Clean up utility functions. * Add missing test case for dotted keys function where values are empty dicts.
* Clean up utility functions. * Add missing test case for dotted keys function where values are empty dicts.
* Clean up utility functions. * Add missing test case for dotted keys function where values are empty dicts.
* Clean up utility functions. * Add missing test case for dotted keys function where values are empty dicts.
* Clean up utility functions. * Add missing test case for dotted keys function where values are empty dicts.
* Clean up utility functions. * Add missing test case for dotted keys function where values are empty dicts.
* Clean up utility functions. * Add missing test case for dotted keys function where values are empty dicts.
* Clean up utility functions. * Add missing test case for dotted keys function where values are empty dicts.
* Clean up utility functions. * Add missing test case for dotted keys function where values are empty dicts.
* Clean up utility functions. * Add missing test case for dotted keys function where values are empty dicts.
* Clean up utility functions. * Add missing test case for dotted keys function where values are empty dicts.
* Clean up utility functions. * Add missing test case for dotted keys function where values are empty dicts.
* Clean up utility functions. * Add missing test case for dotted keys function where values are empty dicts.
* Clean up utility functions. * Add missing test case for dotted keys function where values are empty dicts.
* Clean up utility functions. * Add missing test case for dotted keys function where values are empty dicts.
* Clean up utility functions. * Add missing test case for dotted keys function where values are empty dicts.
* Clean up utility functions. * Add missing test case for dotted keys function where values are empty dicts.
Description
This PR removes unused utility functions and cleans up test coverage of the
utility.py
module.Notes:
_query_yes_no
function doesn't need test coverage (it's strictly for interactive use on the terminal)._split_and_print_progress
function can probably be simplified and replaced with tqdm, if it is needed at all. The function is used only once, to print info-level logging for updates to the in-memory state point cache. This should be investigated further, but I've made the function private for now._nested_dicts_to_dotted_keys
that wasn't being tested, when a value is an empty dict. I added a test that covers that edge case.Motivation and Context
Cleanup for signac 2.0.
Types of Changes
1The change breaks (or has the potential to break) existing functionality.
Checklist:
If necessary: