-
Notifications
You must be signed in to change notification settings - Fork 27
Handle negative norm case where the result returns only 4 items #410
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
base: develop
Are you sure you want to change the base?
Conversation
…esult contains only 4 items instead of 5
Codecov Report❌ Patch coverage is
... and 3 files with indirect coverage changes 🚀 New features to boost your workflow:
|
|
Thanks @Yong2Sheng! @NicoloParmiggiani kindly agreed to review this. @Yong2Sheng: in the meantime, can you please add a unit test that executes the new lines? I think the easiest way would ne to take one of the existing tests, and subtract some counts to force negative. e.g.: you can do: There are other ways of course, whatever you prefer. I just want to avoid future changes resulting in this issue again. |
|
Hi @israelmcmc, thanks for the reminder! I will add the unit test for the new lines |
|
Hi @israelmcmc and @Yong2Sheng, I tested the code with the notebook that caused the original issue #380 and now it works properly. |
|
That's great, thanks @NicoloParmiggiani. When the coverage test is passing, you can go ahead and merge this. |
NicoloParmiggiani
left a comment
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 tested the code with the notebook that previously caused the error, and it now works correctly.
…st_norm_fit, fast_ts_map, and moc_ts_fit.
|
Hello @israelmcmc and @NicoloParmiggiani, I have added the unit test for the lines @israelmcmc requested. I also added/increased the unit test for other changesBug fix oneI also fixed a bug when plotting the fitted multi-resolution map: did not pass the Remove unnecessary checksIn function However, we fit the pixels by orders in each iteration, so the check is redundant. |
|
Hi @NicoloParmiggiani, could you please take a look at the new changes? Thank you! Even though the PR is approved, it still looks like it needs to be merged manually. |
I updated fast_ts_fit.py to handle different tuple lengths returned in result.
The code now checks the length of the result tuple to decide how to unpack it:
resulthas 5 items, it unpacks all of them.resulthas 4 items, it unpacks the available values and sets the iteration to -1 to indicate a negative norm.