GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Image widget by almarklein · Pull Request #429 · fastplotlib/fastplotlib

Conversation

@almarklein

@almarklein almarklein commented Mar 12, 2024

Copy link
Copy Markdown
Collaborator

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

image

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
almarklein added 2 commits March 12, 2024 10:28
@almarklein
Add destkop image widget example
f049081
@almarklein
black (to examples/desktop/image only)
ef23789
@almarklein

almarklein commented Mar 12, 2024

Copy link
Copy Markdown
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?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@kushalkolar

kushalkolar commented Mar 12, 2024

Copy link
Copy Markdown
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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@almarklein

almarklein commented Mar 12, 2024

Copy link
Copy Markdown
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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@almarklein

almarklein commented Mar 12, 2024

Copy link
Copy Markdown
Collaborator Author

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@almarklein
Add not
4c9d575
@kushalkolar

kushalkolar commented Mar 12, 2024

Copy link
Copy Markdown
Member

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

Yup! I updated that issue with the specifics.

almarklein reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@almarklein

almarklein commented Mar 12, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Collaborator Author

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@kushalkolar

kushalkolar commented Mar 12, 2024

Copy link
Copy Markdown
Member

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@kushalkolar

kushalkolar commented Mar 12, 2024

Copy link
Copy Markdown
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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

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

almarklein commented Mar 12, 2024

Copy link
Copy Markdown
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? :)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@kushalkolar

kushalkolar commented Mar 12, 2024

Copy link
Copy Markdown
Member

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@almarklein

almarklein commented Mar 12, 2024

Copy link
Copy Markdown
Collaborator Author

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

fastplotlib/fastplotlib/__init__.py

Lines 11 to 16 in 97dd758

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@kushalkolar

kushalkolar commented Mar 12, 2024

Copy link
Copy Markdown
Member

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

fastplotlib/fastplotlib/__init__.py

Lines 11 to 16 in 97dd758

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

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

almarklein added 2 commits March 12, 2024 14:36
@almarklein
Always import ImageWidget
cc86548
@almarklein
Merge branch 'main' into image-widget
fe86d7a
@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

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@almarklein @kushalkolar
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.