Ulm-IQO / qudi-core

A framework for modular measurement applications.
GNU General Public License v3.0
28 stars 21 forks source link

[New Feature] Make use of the Qt `QResource` system for data files #17

Open Neverhorst opened 2 years ago

Neverhorst commented 2 years ago

Feature Description

Handling qudi data files in cross-platform distributions is a huge nuisance and not really working so far. Each system has its own defaults and conventions in handling data files (e.g. icons, config files) and Qt already offers a viable solution in terms of their QResource system. We should make use of it in order to make our life's easier before trying to deploy qudi as application.

Related Problem

No response

Considered Alternatives

Each distribution and deployment tool (e.g. PyInstaller) for Python applications comes with a custom way to handle data files but most of them are quite hacky and not as general as the Qt resource system. And since we already rely fully on Qt, why go for another tool that is less compatible and needs manual tweaking to integrate with qudi?

Additional Context

No response

Contact Details

tomek.qudi@gmail.com

blupgnup commented 10 months ago

Hi, First of all, thanks for all the work done around Qudi. This is a very promising tool.

I am in the process of building dedicated modules set for Qudi and I am struggling to add some dedicated icons to my GUI. Was there any development on this side up to now and is there any recommended way to add icons using for example Setup.py and package_data ? (I did not manage to be successful yet and I fear there is a lack of documentation on to how to properly build qudi modules for now).

If I were to make use of QResource system and write the necessary code for this to work, would that make sense to implement it directly in my module or would it be (I guess it would) a better way to integrate it directly into qudi-core ?

Edit: I actually just saw that there is already a Qt resource branch on qudi-core. Any plans to integrate that in a near future ?

Thanks and have a nice day.

Neverhorst commented 10 months ago

Hi @blupgnup ,

happy to hear you are considering qudi for your work.

Just to clarify: Are you planning to implement a few modules on your own to use locally or do you want to implement a full fledged qudi addon package(-repository). The latter is something that has only been possible since the release of qudi-core and I would be very interested in getting feedback from an independent set of eyes since the documentation on that is still WIP. If so, please do not hesitate to open a discussion about this here and/or contact me directly. It would be much appreciated.

Regarding your questions: There are two relatively low-priority (thus long-running) projects of mine that I want to finish in 2023.

Both projects are quite invasive and of breaking nature but will improve qudi a lot in the long run. They will be combined in a major release (qudi-core v2.0.0). The addon packages like qudi-iqo-modules will lag a bit behind this release schedule in order to adapt to the changes before upgrading the qudi-core dependency. The next major release after that (qudi-core v3.0.0) will probably be the migration to PySide6 and higher Python versions. But I can not give you any timeline on that at the moment.

So yes, I would suggest making use of the Qt resource system natively if your timeline allows for that.

Regarding documentation on new qudi modules (gui/logic/hardware), please refer to the documentation page. It is still incomplete but we are working on it. Please also check the index for the topic you are interested in, since some links from within the documentation might be broken even though the respective page exists.

blupgnup commented 10 months ago

Hi @Neverhorst ,

Thanks for your quick reply, it is good to see that the project is still ongoing.

We have been using qudi in the past creating our own modules into a fork of the main qudi repository but I recently decided to create a separate set of qudi modules that I could use on top of qudi-core following your template and the qudi-iqo-modules example. See here for the repo : https://github.com/blupgnup/qudi-ffpc-modules.git I think this is a very good way to go and I hope that migrating to the qudi-core v2.0.0 won't be too much trouble...

Indeed the documentation is of quality but incomplete. I think one of the page that would be most appreciated is the 'Writing qudi Modules' page.

I will be happy to have a more detailed discussion with you on this subject.