Skip to content
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

Fix creating colormap from list of Color objects #1859

Merged
merged 2 commits into from
May 8, 2020

Conversation

Czaki
Copy link
Contributor

@Czaki Czaki commented May 6, 2020

fix #1858 with adding check if any list member is instance of Color or ColorArray

Copy link
Contributor

@kmuehlbauer kmuehlbauer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Czaki Thanks for spotting and fixing this! Just one minor thing, otherwise LGTM. Adding more tests is appreciated but not mandatory.

vispy/color/color_array.py Outdated Show resolved Hide resolved
@@ -344,4 +344,9 @@ def test_normalize():
assert_allclose([y.min(), y.max()], [0.2975, 1-0.2975], 1e-1, 1e-1)


def test_colormap_creation():
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you are already here, do you mind adding some more tests for the different parametrizations?

@Czaki
Copy link
Contributor Author

Czaki commented May 6, 2020

I do not understand travis fail.

@Czaki Czaki requested a review from kmuehlbauer May 6, 2020 13:47
@djhoese
Copy link
Member

djhoese commented May 6, 2020

Looks like a pytest-sugar incompatibility with newer pytest: conda-forge/pytest-sugar-feedstock#9 and has been released as pytest-sugar 0.9.3 but isn't available on conda-forge yet: conda-forge/pytest-sugar-feedstock#9

I've commented there to have it merged. After it is merged, we wait an hour, then I'll restart the tests.

@djhoese
Copy link
Member

djhoese commented May 6, 2020

Ugh looks like it is broken with 0.9.3 too: pytest-dev/pytest#3170 (comment)

You could try limiting the version of pytest-sugar in the travis configs or just wait until things are released.

@Czaki
Copy link
Contributor Author

Czaki commented May 7, 2020

Ugh looks like it is broken with 0.9.3 too: pytest-dev/pytest#3170 (comment)

You could try limiting the version of pytest-sugar in the travis configs or just wait until things are released.

I change sugar version but there is error:

RuntimeError: Could not import any of the backends. You need to install any of ['PyQt4', 'PyQt5', 'PySide', 'PySide2', 'Pyglet', 'Glfw', 'SDL2', 'wx', 'EGL', 'osmesa']. We recommend PyQt

@djhoese
Copy link
Member

djhoese commented May 7, 2020

That's actually expected error for that set of tests I think. And sorry I was wrong, the problem wasn't necessarily pytest-sugar but its incompatibility with the new version of pytest. I think pytest needs to be limited not pytest-sugar.

@Czaki
Copy link
Contributor Author

Czaki commented May 7, 2020

So any changes are requested? Which version of pytest is ok?

@djhoese
Copy link
Member

djhoese commented May 7, 2020

pytest less than 5.4 should work (based on the bug reports I've seen).

@Czaki
Copy link
Contributor Author

Czaki commented May 7, 2020

Fixed

@djhoese
Copy link
Member

djhoese commented May 8, 2020

@kmuehlbauer Are you ok with this then? Feel free to merge if you are.

@djhoese djhoese changed the title fix creating colomap from color list Fix creating colomap from list of Color objects May 8, 2020
@kmuehlbauer
Copy link
Contributor

@Czaki

Thanks again for this fix.

I do not want to force this upon you. Could you by chance make two commits out of this four, one with your fixes and one with the travis changes? It would be easier to reverse the travis-changes, when fixed upstream. Normally we would have squash-merged.

If you are unsure I can do it, keeping your authoring information intact. Please let me know.

Czaki added 2 commits May 8, 2020 10:29
limit pytest on travis
block pytest-sugar 0.9.3
@Czaki Czaki force-pushed the color_array_fix branch from d9ea1ed to e90389e Compare May 8, 2020 08:30
@Czaki
Copy link
Contributor Author

Czaki commented May 8, 2020

Done

@kmuehlbauer
Copy link
Contributor

@Czaki I'll merge as soon, the CI's are happy.

@djhoese I was about to add the automerge label... 😁

@kmuehlbauer kmuehlbauer changed the title Fix creating colomap from list of Color objects Fix creating colormap from list of Color objects May 8, 2020
@kmuehlbauer kmuehlbauer merged commit b2de33d into vispy:master May 8, 2020
@kmuehlbauer
Copy link
Contributor

@Czaki Thanks again!

@Czaki Czaki deleted the color_array_fix branch May 8, 2020 10:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Initialize ColorArray from list of color fail
3 participants