-
Notifications
You must be signed in to change notification settings - Fork 31
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
Fixup original unit test, set up tests to run in GitHub Actions #66
Conversation
test/test_editor_loads_native.py
Outdated
colors = [ | ||
# TODO: Should we divide by 255 here instead of 256? The tests pass with a | ||
# lower value for `err` if we do. | ||
[int(c[i : i + 2], 16) / 256 for i in range(0, len(c), 2)] |
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.
The maximum value of int(c[i : i + 2], 16)
here (int('ff', 16)
) is 255
, so dividing by 256
is slightly compressing the resulting values towards 0 instead of producing a true 0-1 scale. Is this right?
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.
That sounds right!
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.
Sorry, want to be 100% sure I understand: Does dividing by 255 sound right to you, or 256?
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.
Does this need to be rebased, now that I merged #65? |
Yes, will do so in the morning!
Matt
…On Thu, Jun 1, 2023, 10:15 PM Stefan van der Walt ***@***.***> wrote:
Does this need to be rebased, now that I merged #65
<#65>?
—
Reply to this email directly, view it on GitHub
<#66 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AA3Q5SBNFBUNDOXC4K2YOBTXJFSE3ANCNFSM6AAAAAAYXVBXBQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
The unit test appears to have fallen out of sync with the code long ago (e.g. it seems to previously expect the values from `get_sRGB` to range from 0-255). I did my best to restore it, but at this point I'm not 100% sure why the colormaps only match approximately after applying these fixes.
@stefanv rebased and ready to go |
test/test_editor_loads_native.py
Outdated
colors = [ | ||
# TODO: Should we divide by 255 here instead of 256? The tests pass with a | ||
# lower value for `err` if we do. | ||
[int(c[i : i + 2], 16) / 256 for i in range(0, len(c), 2)] |
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.
That sounds right!
Merge #65 first. Not sure what the best practice for opening chained/dependent PRs from a fork is. I'll just rebase once #65 is merged.