-
Notifications
You must be signed in to change notification settings - Fork 4
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
Document And Test gempyor.file_paths
#250
Merged
TimothyWillard
merged 10 commits into
main
from
enhancement/document-test-gempyor-file_paths
Jul 15, 2024
Merged
Document And Test gempyor.file_paths
#250
TimothyWillard
merged 10 commits into
main
from
enhancement/document-test-gempyor-file_paths
Jul 15, 2024
Conversation
This file contains 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
Added tests for `gempyor.file_paths.run_id` as a starting point.
Added unit tests for `gempyor.file_paths.create_file_name_without_extension`. Used a general purpose `change_directory_to_temp_directory` pytest fixture to avoid test paths in git repo, but should be moved to a better home at some point.
Created a testing module for housing testing utilities starting with `change_directory_to_temp_directory` pytest fixture. Not sure how to go about testing this module or if that is necessary.
Created a unit test for `gempyor.file_paths.create_dir_name`. Removed unneeded comments from the unit tests for `create_file_name_without_extension`.
* Created unit tests for `gempyor.file_paths.create_file_name` in similar style to the other file paths unit tests. * Applied formatting to unit testing python files.
* Started working on documenting the contents of the `gempyor.file_paths` module. * Added type hints to the included functions. * Applied a formatter to the `file_paths.py` file. * Still need to complete the examples sections of other functions in this file.
* Added/expanded examples for `create_file_name`, `create_file_name_without_extension`, and `run_id` in `gempyor.file_paths`. * Added unit tests for user provided timestamps to `run_id`. * Applied formatting.
Migrated unit tests in the `tests/utils/test_file_paths.py` file into individual test files under the `tests/file_paths/` directory. Removed monkeypatch overriding of `datetime.now` since that is now covered by easier to test user-provided input.
jcblemai
approved these changes
Jul 12, 2024
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.
Amazing!
saraloo
approved these changes
Jul 14, 2024
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.
Amazing, thanks!
Thanks y'all! |
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.
Similar to GH-246, but for
file_paths
instead ofutils
. Also, added an optional argument torun_id
for a user-provided timestamp, mostly for unit testability. My unit test values are a bit contrived since I couldn't quite square the directory structure inmodel_output
to the output of these functions, but I do not think that's a deal breaker since these tests still demonstrate expected behavior.