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

Remove duplicate results when activating multiple ImageViewer modules #91

Open
berceanu opened this issue Feb 7, 2021 · 4 comments
Open

Comments

@berceanu
Copy link

berceanu commented Feb 7, 2021

Feature description

ImageViewer(name="One plot", img_globs=["my_amazing_plot.png"]),
ImageViewer(name="All Plots"),

It would be nice if "my_amazing_plot.png" would not appear twice on the dashboard page.

Proposed solution

Perhaps one one module is activated, it could check the output from the other modules and eliminate the duplicates?

@bdice
Copy link
Member

bdice commented Feb 7, 2021

Hmm. I see your point, but I think I would advocate for users to set specific globs for each ImageViewer module, or only use one with the default setting (all jpg/png/... files). Communicating between modules/cards would require a fair bit of effort and the benefit seems small. Can you help explain why you chose your approach over one of those alternatives?

@berceanu
Copy link
Author

berceanu commented Feb 7, 2021

I often have many .pngs as output from postprocessing (>10 / job) and showing them all by default would result in a lot of clutter. So I select a few (2-3) as separate ImageViewer modules and add a general ImageViewer for the rest. Except it's not really the rest, it's the duplicates plus the rest :)

However this is not a big issue, I can definately work around it if the implementation is costly.

@bdice
Copy link
Member

bdice commented Feb 7, 2021

Another alternative would be to change the behavior of img_globs to allow a callable. The callable would act on filenames in the job directory as a filter (True means show, False means hide). This would make it easier to construct a custom set of images that excludes previously shown images.

@berceanu
Copy link
Author

berceanu commented Feb 7, 2021

Yes, sounds easier than setting up inter-module communication.

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

No branches or pull requests

2 participants