Skip to content
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
merged 10 commits into from
Jul 15, 2024

Conversation

TimothyWillard
Copy link
Contributor

Similar to GH-246, but for file_paths instead of utils. Also, added an optional argument to run_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 in model_output to the output of these functions, but I do not think that's a deal breaker since these tests still demonstrate expected behavior.

TimothyWillard and others added 7 commits July 11, 2024 10:30
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.
Copy link
Collaborator

@jcblemai jcblemai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing!

Copy link
Contributor

@saraloo saraloo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing, thanks!

@TimothyWillard TimothyWillard merged commit 76c6985 into main Jul 15, 2024
1 check passed
@TimothyWillard TimothyWillard deleted the enhancement/document-test-gempyor-file_paths branch July 15, 2024 12:13
@TimothyWillard
Copy link
Contributor Author

Thanks y'all!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants