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
Please have a look at bytescale tests? #130
Comments
@lwasser this means that bytescale is not returning an array where the minimum value is 0.0, rather, it is 1.0.... why would that be? |
i'm not sure. So can you run the test_spatial locally and see if it throws an error and explore it perhaps? i would imagine tho if you run it locally it will throw the same assert as travis does? does it? and if not ... i am not sure. does the cmin have anything to do with it perhaps?
|
There is nearly 100% code coverage on the bytescale function, with the exception of checking if the data is of type uint8, which would be easy enough. I am testing it locally and am receiving no errors when calling |
can you do this? @joemcglinchy can you please submit a new pr... in that just clean up the file - specifically remove this:
the code above doesn't actually do anything. let's see what travis says on a new build? when i run it locally i don't see an error. the min is 0 . i'm not sure what travis is running. |
removing that line will remove coverage for the
|
ok @joemcglinchy since things seem to be ok with travis now i'll close this.if travis becomes angry again we can revisit! thank you so much. |
Could it be that this error only shows up for some unlucky values of the array because the values are generated randomly (I think)? |
@betatim it could be the case! i'd have to think about this more in context of the function. pretty odd that it worked after a travis build so that does suggest your statement must be true. |
it certainly could be the case. I ran that function in a loop with 1000000 iterations, multiple times, and that assertion error comes up randomly. I brought this up to Leah yesterday, I think there is something else that could be contributing to this issue. The |
looks like we have a bug in bytescale. I edited my local copy of test_spatial.py to print out some values, here's what we get for the last check on
|
what about that particular array threw the bug @joemcglinchy ? Nice find!! |
I think since the min of the original array was greater than the cmin specified (10)? I am not totally sure. I'm going to have to figure that one out locally. I'll add it to my bytescale_tests branch and submit another PR when it's ready. |
Sounds great @joemcglinchy you know i've found a bunch of bugs in my functions too working through these unit tests. i think for that reason alone it's a great option. :) |
hey @joemcglinchy
can you please have a look at this here
https://travis-ci.org/earthlab/earthpy/builds/460164320#L1240
it's throwing an error on @betatim pr
what is odd about this is that the last commit actually did not fail. but in this pr clearly the bytscale tests are throwing an error.
Can you kindly look into this as this is related to that pr that got merged accidentally?
Many thanks!
The text was updated successfully, but these errors were encountered: