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
Add option(s) to do automatic cleanup of "old" models/predictions/... #169
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #169 +/- ##
==========================================
+ Coverage 67.32% 69.91% +2.59%
==========================================
Files 23 25 +2
Lines 3204 3344 +140
==========================================
+ Hits 2157 2338 +181
+ Misses 1047 1006 -41 ☔ View full report in Codecov by Sentry. |
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.
Thanks! Good start!
Some general remarks that are best handled before doing a more detailed review:
- in general, application "logic" in orthoseg belongs in the /orthoseg/lib/ modules. So it would be best if cleanup.py would be moved there. Important: as a general principal, the modules in /orthoseg/lib/ offer a plain python API, so standard functions that get all necessary input via standard function arguments. In other words, the configuration (
conf.
) is not accessed there, this happens in /orthoseg/train.py, /orthoseg/predict.py,... Hence: cleanup.py should follow this principle as well and rather than reading the config files it should use standard functions with arguments that can be called from e.g. /orthoseg/predict.py, where the configuration has been loaded already anyway. - the cleanup sample project is to large to include in the github repo. I think it will be more efficient as well as easier to maintain to create the test data in code by creating empty files as needed to test the cleanup logic.
Co-authored-by: Pieter Roggemans <pieter.roggemans@gmail.com>
- create cleanup sample dummy files - refactor cleanup test
Sample project removed and files are now created in code |
- renamed parameter path to model_dir - removed logging initialisation in each function
- test seperated in test for models, training en predictions
- refactor cleanup_old_data
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.
Nice steps forward! Already a bit of more detailed feedback...
- add test_cleanup_projects_dir - refactor cleanup tests
- more specific exceptions - refactor test_cleanup.py
resolves #52