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

Draft: Revamped Plugin system #21

Open
wants to merge 51 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
9f5ee7a
Renamed a couple of things to make room for other types of loaders
AKuederle Feb 9, 2023
0fb016f
Started refactoring to make plugins class instances
AKuederle Feb 9, 2023
0602746
Removed pandas deprecation calls
AKuederle Feb 9, 2023
b230873
Implemented general structure for plugin loaders
AKuederle Feb 9, 2023
c4e526a
refactor and lint
AKuederle Feb 9, 2023
4462148
Fixed error when popup was closed without data selection
AKuederle Feb 24, 2023
1a38bf9
Fixed some small bugs and added new keycombo to shift plot
AKuederle Feb 24, 2023
22130fe
Some small fixes
AKuederle Apr 20, 2023
a9e0b54
Save last selected loader plugin
AKuederle Apr 20, 2023
4a2700c
Fully implemented plugin loading with forward backwards buttons
AKuederle Apr 20, 2023
7b4a3fd
Remove debug print
AKuederle Apr 20, 2023
2858dbd
Update
AKuederle Apr 21, 2023
af9f6d8
Update build_windows.yml
MalteOlle May 3, 2023
7e8368e
Update build_windows.yml
MalteOlle May 4, 2023
cf1c001
Update build_windows.yml
MalteOlle May 4, 2023
41dc15a
Update build_windows.yml
MalteOlle May 4, 2023
80132bb
Add files via upload
MalteOlle May 4, 2023
1e70613
Update pyproject.toml
MalteOlle May 4, 2023
26b0e7f
Update build_windows.yml
MalteOlle May 4, 2023
f848eab
Try to fix windows standalone
MalteOlle Jun 2, 2023
6587bbc
Update build_windows.yml
MalteOlle Jun 2, 2023
5facc3e
Update build_mac.yml
MalteOlle Jun 2, 2023
eddb218
Update build_ubuntu.yml
MalteOlle Jun 2, 2023
d8a7746
Update build_mac.yml
MalteOlle Jun 3, 2023
828fe92
try to fix gstreamer installation
MalteOlle Jun 3, 2023
d6a402e
Update build_ubuntu.yml
MalteOlle Jun 3, 2023
cfaa32f
Update pyinstaller.spec
MalteOlle Jun 3, 2023
8b0b74f
Update build_mac.yml
MalteOlle Jun 3, 2023
9c9ddee
Update dodo.py
MalteOlle Jun 3, 2023
52d7569
Update dodo.py
MalteOlle Jun 3, 2023
63f53d4
Update dodo.py
MalteOlle Jun 3, 2023
5f11eb4
Update build_mac.yml
MalteOlle Jun 3, 2023
23f7813
Update build_mac.yml
MalteOlle Jun 3, 2023
bdfb0a3
Update dodo.py
MalteOlle Jun 3, 2023
e68881d
Update dodo.py
MalteOlle Jun 3, 2023
da97a0f
Update dodo.py
MalteOlle Jun 3, 2023
c93b02f
Update dodo.py
MalteOlle Jun 3, 2023
8c99920
Update dodo.py
MalteOlle Jun 3, 2023
ed42b74
Update dodo.py
MalteOlle Jun 3, 2023
9f0fd91
Update dodo.py
MalteOlle Jun 3, 2023
f305e9f
Update dodo.py
MalteOlle Jun 3, 2023
5d82710
Update pyinstaller.spec
MalteOlle Jun 3, 2023
e5ea8aa
Update pyinstaller.spec
MalteOlle Jun 3, 2023
65ab59b
Update build_mac.yml
MalteOlle Jun 3, 2023
4dbb1b4
Update dodo.py
MalteOlle Jun 3, 2023
811b182
Update dodo.py
MalteOlle Jun 3, 2023
5bbe3cf
Update dodo.py
MalteOlle Jun 3, 2023
63e1b98
Update dodo.py
MalteOlle Jun 3, 2023
8b25708
Update build_mac.yml
MalteOlle Jun 3, 2023
403e55d
Update build_mac.yml
MalteOlle Jun 3, 2023
704475f
Update dodo.py
MalteOlle Jun 3, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/modules/example_plugins.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Classes
:toctree: generated/plugins
:template: class_no_inheritances.rst

ExampleImporter
ExampleFileImporter
StationaryMomentsDetector
EnergyCalculator
ExampleExporter
2 changes: 1 addition & 1 deletion docs/modules/plugin_selection.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ Classes
:template: class.rst

PluginSelectionDialog
LoadDataDialog
FileLoaderDialog
4 changes: 2 additions & 2 deletions docs/modules/plugins.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Classes
:toctree: generated/plugins
:template: class.rst

BaseImporter
BaseFileImporter
BaseAlgorithm
BaseExporter
ExampleImporter
ExampleFileImporter
4 changes: 2 additions & 2 deletions docs/plugin_algorithm.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ Overview
.. code-block:: python

from mad_gui import start_gui
from mad_gui.plugins import ExampleImporter
from mad_gui.plugins import ExampleFileImporter
from my_algorithm import MyAlgorithm # you need to create this file and class, see below

start_gui(plugins=[ExampleImporter, MyAlgorithm])
start_gui(plugins=[ExampleFileImporter, MyAlgorithm])

.. _algorithm annotations:

Expand Down
4 changes: 2 additions & 2 deletions docs/plugin_exporter.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ Export displayed annotations
.. code-block:: python

from mad_gui import start_gui
from mad_gui.plugins import ExampleImporter
from mad_gui.plugins import ExampleFileImporter
from my_exporter import CustomExporter # you need to create this file and class, see below

start_gui(plugins=[ExampleImporter, CustomExporter])
start_gui(plugins=[ExampleFileImporter, CustomExporter])

Upon pressing the `Export data` button in the GUI, the `ExportResultsDialog <https://github.com/mad-lab-fau/mad-gui/blob/main/mad_gui/components/dialogs/plugin_selection/export_results_dialog.py#L19>`_ will be
opened, in which your exporter can be selected. Basically, you will receive a `GlobalData <https://mad-gui.readthedocs.io/en/latest/modules/generated/mad_gui/mad_gui.models.GlobalData.html#mad_gui.models.GlobalData>`_ object, which keeps
Expand Down
6 changes: 3 additions & 3 deletions docs/plugin_importer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ The name will show up in the dropdown menu in the GUI's pop up when the user cli
from typing import Dict
import warnings
import pandas as pd
from mad_gui import start_gui, BaseImporter
from mad_gui import start_gui, BaseFileImporter

class CustomImporter(BaseImporter):
class CustomImporter(BaseFileImporter):
loadable_file_type = "*.*"

@classmethod
Expand Down Expand Up @@ -139,4 +139,4 @@ From user perspective it should work as we have described in our
In case loading your file does not work, we recommend to set breakpoints into your loader and check, whether
everything does what you expect it to do. Also you might want to look at our section about
:ref:`Troubleshooting development <troubleshooting development>` or at
`load_sensor_data's documentation <https://mad-gui.readthedocs.io/en/latest/modules/generated/plugins/mad_gui.plugins.BaseImporter.html#mad_gui.plugins.BaseImporter.load_sensor_data>`_.
`load_sensor_data's documentation <https://mad-gui.readthedocs.io/en/latest/modules/generated/plugins/mad_gui.plugins.BaseFileImporter.html#mad_gui.plugins.BaseFileImporter.load_sensor_data>`_.
2 changes: 1 addition & 1 deletion docs/troubleshooting.rst
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ parent directory).

The plugin I created does not show up in the GUI
************************************************
Please make sure that your plugin inherits from one of `BaseImporter`, `BaseAlgorithm`, or `BaseExporter`, as we
Please make sure that your plugin inherits from one of `BaseFileImporter`, `BaseAlgorithm`, or `BaseExporter`, as we
describe it in our section `Readme: Developing Plugins <https://mad-gui.readthedocs.io/en/latest/README.html#developing-plugins>`_.
Additionally, you should make sure to pass your plugin to the `start_gui` function, which is also described in the part
of `Readme: Developing Plugins <https://mad-gui.readthedocs.io/en/latest/README.html#developing-plugins>`_:
Expand Down
4 changes: 2 additions & 2 deletions mad_gui/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"""

from mad_gui.config import BaseSettings, BaseTheme
from mad_gui.plugins import BaseImporter, BaseExporter, BaseAlgorithm
from mad_gui.plugins import BaseFileImporter, BaseExporter, BaseAlgorithm
from mad_gui.start_gui import start_gui

__all__ = ["BaseSettings", "BaseTheme", "start_gui", "BaseImporter", "BaseExporter", "BaseAlgorithm"]
__all__ = ["BaseSettings", "BaseTheme", "start_gui", "BaseFileImporter", "BaseExporter", "BaseAlgorithm"]
4 changes: 2 additions & 2 deletions mad_gui/components/dialogs/plugin_selection/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from mad_gui.components.dialogs.plugin_selection.plugin_selection_dialog import PluginSelectionDialog
from mad_gui.components.dialogs.plugin_selection.load_data_dialog import LoadDataDialog
from mad_gui.components.dialogs.plugin_selection.load_data_dialog import FileLoaderDialog

__all__ = ["PluginSelectionDialog", "LoadDataDialog"]
__all__ = ["PluginSelectionDialog", "FileLoaderDialog"]
Loading