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

Calling load_plugins multiple times results in duplicate entries #2489

Closed
astrofrog opened this issue May 8, 2024 · 1 comment
Closed

Calling load_plugins multiple times results in duplicate entries #2489

astrofrog opened this issue May 8, 2024 · 1 comment
Labels

Comments

@astrofrog
Copy link
Member

When calling load_plugins, we should skip previously loaded entries:

In [1]: from glue.config import qt_client

In [2]: qt_client
Out[2]: <glue_qt.config.QtClientRegistry at 0x774cec36f390>

In [3]: qt_client.members
Out[3]: []

In [4]: from glue.main import load_plugins

In [5]: load_plugins()

In [7]: qt_client.members
Out[7]: 
[glue_vispy_viewers.scatter.scatter_viewer.VispyScatterViewer,
 glue_vispy_viewers.volume.volume_viewer.VispyVolumeViewer,
 glue_qt.plugins.dendro_viewer.data_viewer.DendrogramViewer,
 glue_qt.viewers.histogram.data_viewer.HistogramViewer,
 glue_qt.viewers.image.data_viewer.ImageViewer,
 glue_qt.viewers.profile.data_viewer.ProfileViewer,
 glue_qt.viewers.scatter.data_viewer.ScatterViewer,
 glue_qt.viewers.table.data_viewer.TableViewer]

In [8]: load_plugins()

In [9]: qt_client.members
Out[9]: 
[glue_vispy_viewers.scatter.scatter_viewer.VispyScatterViewer,
 glue_vispy_viewers.volume.volume_viewer.VispyVolumeViewer,
 glue_qt.plugins.dendro_viewer.data_viewer.DendrogramViewer,
 glue_qt.viewers.histogram.data_viewer.HistogramViewer,
 glue_qt.viewers.image.data_viewer.ImageViewer,
 glue_qt.viewers.profile.data_viewer.ProfileViewer,
 glue_qt.viewers.scatter.data_viewer.ScatterViewer,
 glue_qt.viewers.table.data_viewer.TableViewer,
 glue_vispy_viewers.scatter.scatter_viewer.VispyScatterViewer,
 glue_vispy_viewers.volume.volume_viewer.VispyVolumeViewer,
 glue_qt.plugins.dendro_viewer.data_viewer.DendrogramViewer,
 glue_qt.viewers.histogram.data_viewer.HistogramViewer,
 glue_qt.viewers.image.data_viewer.ImageViewer,
 glue_qt.viewers.profile.data_viewer.ProfileViewer,
 glue_qt.viewers.scatter.data_viewer.ScatterViewer,
 glue_qt.viewers.table.data_viewer.TableViewer]

cc @CyclingNinja

@astrofrog astrofrog added the bug label May 8, 2024
@astrofrog
Copy link
Member Author

Fixed in #2490

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant