Skip to content

Conversation

@almarklein
Copy link
Collaborator

Just a small example to show the image widget on desktop.

image

@almarklein
Copy link
Collaborator Author

BTW, there are a lot of files that get touched when I run black. What is the policy related to formatting and linting?

@kushalkolar
Copy link
Member

Ah I think we forgot to run black on the examples, they're only run on the source files I think.

We haven't made a strict linting policy yet but we should. I'll see if I can export my flake8 options from pycharm.

For this example, I think it'd be useful to add a note that if you want sliders to scroll through one or two dimensions you should use the ImageWidget in either Qt or jupyter. Since we don't have within canvas UI right now.

@almarklein
Copy link
Collaborator Author

For this example, I think it'd be useful to add a note that if you want sliders to scroll through one or two dimensions you should use the ImageWidget in either Qt or jupyter. Since we don't have within canvas UI right now.

👍

Odd though, because I have PySide6 installed, and it selects glfw. Will have a look why this is.

@almarklein
Copy link
Collaborator Author

Oh, it only looks for PyQt6 for now. Ref #384

@kushalkolar
Copy link
Member

Oh, it only looks for PyQt6 for now. Ref #384

Yup! I updated that issue with the specifics.

@almarklein
Copy link
Collaborator Author

almarklein commented Mar 12, 2024

Backend selection is a bit iffy. Will still select glfw because wgpu prefers it over qt. Something for another PR :)

@kushalkolar
Copy link
Member

Yup I think that's why our Qt example explicitly chooses the canvas

@kushalkolar
Copy link
Member

If this is good to go you can mark it as ready for review to trigger the CI to run, and then copy the new screenshot from the regenerate action to the corresponding examples dir.

@almarklein almarklein marked this pull request as ready for review March 12, 2024 11:41
@almarklein
Copy link
Collaborator Author

CI: AttributeError: module 'fastplotlib' has no attribute 'widgets'

But when I import fastplotlib as flp I can use flp.widgets. Which behavior is to be expected? :)

@kushalkolar
Copy link
Member

ImageWidget is intended to be used from top level, i.e. fpl.ImageWidget. Not entirely sure how this is happening.

@almarklein
Copy link
Collaborator Author

This is. Perhaps at some point the ImageWidget relied on ipywidgets?

try:
import ipywidgets
except (ModuleNotFoundError, ImportError):
pass
else:
from .widgets import ImageWidget

@kushalkolar
Copy link
Member

This is. Perhaps at some point the ImageWidget relied on ipywidgets?

try:
import ipywidgets
except (ModuleNotFoundError, ImportError):
pass
else:
from .widgets import ImageWidget

Ah yes good catch! That shouldn't be there.

@kushalkolar kushalkolar merged commit d45c723 into fastplotlib:main Mar 12, 2024
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.

2 participants