-
Notifications
You must be signed in to change notification settings - Fork 11
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
base: main
Are you sure you want to change the base?
Conversation
I took some time to go over the code and did not find anything suspicious. However, I did not really understand what's going on, let's talk "offline". |
Well, looking at the working example it is a bit clearer to me, I just wonder whether we should incorporate the "load from plugin" into the usual loading data dialog. But maybe there are some good reasons not to do it. |
This could for example be the main window of the GUI, in case the plugin wants to access something there. | ||
However, this is unlikely to be necessary since plugins receive either the single | ||
:class:`mad_gui.models.GlobalData` or its attribute `PlotData`, which should be sufficient to do everything. | ||
def _configure(self, parent=None, **_) -> Self: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't yet get what this can actually be used for
@@ -43,6 +43,9 @@ class GlobalData(BaseStateModel): | |||
|
|||
""" | |||
|
|||
active_data_loader = Property(None) | |||
data_index = Property(None, dtype=int) | |||
data_label = Property("", dtype=str) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did not get what this is - add to docstring?
From the beginning I struggled a bit with now having two buttons for importers. Today we discussed that dynamically changing the already existing The reason why I am suggesting this is that then we keep only one "load data" button and thus I hope that it may be less confusing. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
two naming suggestions
sampling_rate_hz: float | ||
|
||
|
||
class BaseDataImporter(BasePlugin): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
class BaseDataImporter(BasePlugin): | |
class BaseDatasetImporter(BasePlugin): |
"""Run this dialog and return the data, that was selected by the user.""" | ||
if self.exec_(): | ||
return self.final_data_, self.loader_ | ||
return None, None | ||
|
||
|
||
class FromPluginLoaderDialog(QDialog): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
class FromPluginLoaderDialog(QDialog): | |
class FromDatasetLoaderDialog(QDialog): |
or even remove the From
. The reason why I would suggest this is, that also the FileLoaderDialog actually also makes use of plugins and therefore, I think FromPluginLoaderDialog
is not pinpointed
remove outdated option of pyinstaller
buildin an executable works locally, however the executable cannot start because of
I'll try and see if I can fix that within the next days |
Fixed this and also all other builds. Now pipelines for building standalone on windows, macOS, and Ubuntu work again. |
This PR implements a new way of how data can be loaded via Plugins.
Instead of creating a loader for a specific file type, this PR allows to create plugins that can generate their own list of data to be loaded.
This is create, if your data is either not linked to a specific file and requires complicated loading logic with multiple files involved, or when you simply want to make it easy for users to just get a specific selection of available datafiles.
@katharina-j-fau and I already used this version to make labling predefined datasets much easier and it also allows for straight forward integration with tpcp-datasets.
The big issue is, that this change to the plugin system is not backwards compatible in the following ways:
get_name
methodAs I was doing work on the GUI anayway, also intrduced a couple further changes:
As this is backwards compatible, the biggest issue is, that we need to update all the documentation, which I have not done and don't have a lot of time for at the moment. @katharina-j-fau Would you be interested to help here?
@MalteOlle What do you think of the changes in general? Could you have a look?
Remaining TODOS: