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

Add option(s) to do automatic cleanup of "old" models/predictions/... #169

Open
wants to merge 29 commits into
base: main
Choose a base branch
from

Conversation

KriWay
Copy link
Collaborator

@KriWay KriWay commented Mar 25, 2024

resolves #52

Copy link

codecov bot commented Mar 25, 2024

Codecov Report

Attention: Patch coverage is 86.76471% with 18 lines in your changes are missing coverage. Please review.

Project coverage is 69.91%. Comparing base (c7f1c7b) to head (c827b49).
Report is 10 commits behind head on main.

Files Patch % Lines
orthoseg/lib/cleanup.py 84.37% 15 Missing ⚠️
orthoseg/util/data.py 91.42% 3 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@theroggy theroggy left a 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.

CHANGELOG.md Outdated Show resolved Hide resolved
KriWay and others added 4 commits March 27, 2024 14:34
Co-authored-by: Pieter Roggemans <pieter.roggemans@gmail.com>
@KriWay KriWay requested a review from theroggy March 28, 2024 11:51
- create cleanup sample dummy files
- refactor cleanup test
@KriWay
Copy link
Collaborator Author

KriWay commented Mar 28, 2024

Sample project removed and files are now created in code

orthoseg/lib/cleanup.py Outdated Show resolved Hide resolved
orthoseg/lib/cleanup.py Outdated Show resolved Hide resolved
orthoseg/lib/cleanup.py Outdated Show resolved Hide resolved
orthoseg/lib/cleanup.py Outdated Show resolved Hide resolved
orthoseg/lib/cleanup.py Outdated Show resolved Hide resolved
orthoseg/lib/cleanup.py Outdated Show resolved Hide resolved
tests/test_cleanup.py Outdated Show resolved Hide resolved
tests/test_cleanup.py Outdated Show resolved Hide resolved
helper_scripts/cleanup_old_data.py Outdated Show resolved Hide resolved
orthoseg/predict.py Outdated Show resolved Hide resolved
- 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
@KriWay KriWay requested a review from theroggy April 16, 2024 08:32
Copy link
Collaborator

@theroggy theroggy left a 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...

helper_scripts/cleanup_old_data.py Outdated Show resolved Hide resolved
orthoseg/lib/cleanup.py Outdated Show resolved Hide resolved
orthoseg/lib/cleanup.py Outdated Show resolved Hide resolved
orthoseg/util/data.py Show resolved Hide resolved
tests/test_cleanup.py Outdated Show resolved Hide resolved
tests/test_cleanup.py Outdated Show resolved Hide resolved
tests/test_cleanup.py Outdated Show resolved Hide resolved
@KriWay KriWay requested a review from theroggy April 17, 2024 12:32
orthoseg/util/data.py Outdated Show resolved Hide resolved
orthoseg/util/data.py Outdated Show resolved Hide resolved
tests/test_data.py Outdated Show resolved Hide resolved
- more specific exceptions
- refactor test_cleanup.py
@KriWay KriWay requested a review from theroggy April 24, 2024 07:34
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.

Add option(s) to do automatic cleanup of "old" models/predictions/...
3 participants