-
Notifications
You must be signed in to change notification settings - Fork 180
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
Improve checks and tests for preprocess.py #564
Conversation
Not sure why the tag push is this PR? |
This isn't quite right yet, I was testing this on hpg,
|
Okay, @henrykironde should be ready. |
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.
tests/test_preprocess.py
Outdated
numpy_image = np.zeros((4, 400, 400), dtype=np.uint8) | ||
|
||
with pytest.warns(UserWarning): |
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.
@ Ben Why are we repeating the procedure ?
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.
Once for when the channel order channels x height x width and once for when the channel order is height x width x channels. The function should work and warn users in either situation. Before it was assuming the correct shape, which is channel x height x width, without actually checking it was true.
Yes, but we already pushed that. 1.3.1 is already up on pypi, https://pypi.org/project/deepforest/ |
@henrykironde I could use this next week, let me if there are concerns here. |
* Use pytest.mark.parametrize for multiple test instances
* Bump version: 1.3.0 → 1.3.1 * rasterio reads in a .tif, its channels first, CxHxW improve warnings and 4 band checking in preprocess pytest.mark.parametrize for multiple test instances --------- Co-authored-by: henry senyondo <[email protected]>
This is a follow to PR #552, we needed a test, and to warn users if rasters were in Channel x height x width before trying to coerce them to height x width x channel. I also changed base_dir to save_dir based on the deprecation warning and changed to use tmpdir when we aren't check the output of
preprocess.split_raster
.