-
Notifications
You must be signed in to change notification settings - Fork 5
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
Test fixes #154
Test fixes #154
Conversation
…each test run; note: this is a workaround for better test asset management tracked in #61
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #154 +/- ##
=====================================
Coverage 75.0% 75.0%
=====================================
Files 12 12
Lines 863 863
=====================================
Hits 648 648
Misses 215 215
|
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.
@ejm714 Generally looks good. I am getting slightly different values for the test assets when I rerun make test
-- can we huddle quickly tomorrow?
Based on sentinel_metadata_[train/test].csv
, I'm getting all the same tiles, but with different values for the number of water pixels. As a result of the different water masks, but features, r-squared values (results.json), and model are also different.
a9af79990527a83e31f9a954d3e334d5,S2B_MSIL2A_20180708T155819_R097_T17SPV_20201011T133356,0.004069006543723974,56382.0,3,https://sentinel2l2a01.blob.core.windows.net/sentinel2-l2/17/S/PV/2018/07/08/S2B_MSIL2A_20180708T155819_N0212_R097_T17SPV_20201011T133356.SAFE/GRANULE/L2A_T17SPV_A006987_20180708T161248/IMG_DATA/R10m/T17SPV_20180708T155819_TCI_10m.tif | ||
d823c957bedf702bb1dd8d562e45a7b8,S2B_MSIL2A_20170713T173909_R098_T13TDE_20210210T083500,0.014554095195663475,66558.0,15,https://sentinel2l2a01.blob.core.windows.net/sentinel2-l2/13/T/DE/2017/07/13/S2B_MSIL2A_20170713T173909_N0212_R098_T13TDE_20210210T083500.SAFE/GRANULE/L2A_T13TDE_A001840_20170713T174714/IMG_DATA/R10m/T13TDE_20170713T173909_TCI_10m.tif | ||
f79c66af395e5de8fb3c5cc1b1ed6993,S2A_MSIL2A_20180521T154911_R054_T18TUK_20201012T122951,0.0155145746579417,6416.0,0,https://sentinel2l2a01.blob.core.windows.net/sentinel2-l2/18/T/UK/2018/05/21/S2A_MSIL2A_20180521T154911_N0212_R054_T18TUK_20201012T122951.SAFE/GRANULE/L2A_T18TUK_A015209_20180521T155356/IMG_DATA/R10m/T18TUK_20180521T154911_TCI_10m.tif | ||
494fb91d1fb8697e73b90e5d0c9420ed,S2A_MSIL2A_20190818T170851_R112_T15SUD_20201005T015156,0.010019129603060737,1096.0,8,https://sentinel2l2a01.blob.core.windows.net/sentinel2-l2/15/S/UD/2019/08/18/S2A_MSIL2A_20190818T170851_N0212_R112_T15SUD_20201005T015156.SAFE/GRANULE/L2A_T15SUD_A021702_20190818T171838/IMG_DATA/R10m/T15SUD_20190818T170851_TCI_10m.tif |
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.
When I rerun make test
on this branch, I get different values for num_water_pixels
. Mine generally align with the previous version of this file. I'm not sure why mine is different -- I started with a clean environment and re-installed the requirements.
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.
I'm also getting slightly different values for features_test.csv
and features_train.csv
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.
hmmm that's very curious and good to know
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.
after a long investigation, the number of water pixel changes (with cascading effects on band summary stats) appear to be coming from OpenCV (due to variations in underlying hardware, operating systems, and library implementations).
Different processors and architectures may handle floating-point calculations with slight variations, leading to minor differences in the computed pixel values during interpolation.
this is the relevant part of the code
Lines 165 to 169 in 85c82ca
if config.filter_to_water_area: | |
if band != "SCL": | |
scaled_scl = cv2.resize(scl_array[0], (arr.shape[2], arr.shape[1])) | |
arr = arr[0][scaled_scl == 6] | |
sample_item_features["num_water_pixels"] = arr.size |
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.
@ejm714 LGTM! Just one small question.
- All tests pass for me, and
make tests
doesn't change any of the test asset files make assets
runs and does change test asset files (expected because of weirdopencv
behavior). The same images are selected for both train and test, although the number of water pixels is different
@@ -34,7 +34,7 @@ dependencies = [ | |||
"gradio", | |||
"lightgbm", | |||
"loguru", | |||
"matplotlib<3.8.0", | |||
"matplotlib", |
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.
Why do we no longer need to enforce a version of matplotlib?
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.
There was a mpl bug that was the cause of this ceiling (e379dec) but I can't remember the specifics. In general, we only want floors not ceilings for packages. Ceilings are often a temporary workaround and it looked like this one was outdated (indeed as it was given tests pass with later versions)
root_mean_squared_error
function (API change details)Bonus fixes
clean
make command