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

PI extension with PyMoDAQ4 #116

Open
jerlfan opened this issue Jun 5, 2023 · 4 comments
Open

PI extension with PyMoDAQ4 #116

jerlfan opened this issue Jun 5, 2023 · 4 comments
Assignees

Comments

@jerlfan
Copy link
Contributor

jerlfan commented Jun 5, 2023

We are using a PID extensions with pymodaq 4. The model is intialized properly, but when intializing the PID we get the following errors

Traceback (most recent call last):
File "C:\Users\manip-lumi\Documents\GitHub\PyMoDAQ2\src\pymodaq\extensions\pid\pid_controller.py", line 161, in process_output
self.output_viewer.show_data([[dat] for dat in datas['output']])
File "C:\Users\manip-lumi\Documents\GitHub\PyMoDAQ2\src\pymodaq\utils\plotting\data_viewers\viewer.py", line 318, in show_data
if len(data.shape) > 4:
AttributeError: 'list' object has no attribute 'shape'

It is related to the modification of the dat structures in pymodaq 4.

@jerlfan
Copy link
Contributor Author

jerlfan commented Jun 5, 2023

In pymodaq.extensions.pid.pid_controller

we have replaced the line 160:

self.output_viewer.show_data([[dat] for dat in datas['output']])

by
data=DataRaw(name='pid output'
data=datas['output'])
self.output_viewer.show_data(data)

We got the following errors:
Traceback (most recent call last):
File "C:\Users\manip-lumi\Documents\GitHub\PyMoDAQ2\src\pymodaq\extensions\pid\pid_controller.py", line 162, in process_output
data=DataRaw(name='pid output',data=datas['output'])
File "C:\Users\manip-lumi\Documents\GitHub\PyMoDAQ2\src\pymodaq\utils\data.py", line 1484, in init
super().init(*args, source=DataSource['raw'], **kwargs)
File "C:\Users\manip-lumi\Documents\GitHub\PyMoDAQ2\src\pymodaq\utils\data.py", line 1179, in init
super().init(*args, **kwargs)
File "C:\Users\manip-lumi\Documents\GitHub\PyMoDAQ2\src\pymodaq\utils\data.py", line 490, in init
self.data = data # dim consistency is actually checked within the setter method
File "C:\Users\manip-lumi\Documents\GitHub\PyMoDAQ2\src\pymodaq\utils\data.py", line 748, in data
data = self._check_data_type(data)
File "C:\Users\manip-lumi\Documents\GitHub\PyMoDAQ2\src\pymodaq\utils\data.py", line 702, in _check_data_type
raise TypeError(f'Data should be an non-empty list of non-empty numpy arrays')
TypeError: Data should be an non-empty list of non-empty numpy arrays

@quantumm
Copy link
Collaborator

Hi Jérémie,
For now the PID extension in not compatible with the v4.
I would recommand that you keep the v3 for now.
It is planned to make it compatible but difficult to fix the date of the release.
I will keep you updated!

@seb5g seb5g mentioned this issue Sep 5, 2023
@seb5g
Copy link
Contributor

seb5g commented Sep 5, 2023

the new pull request #148 should solve this issue!

@seb5g
Copy link
Contributor

seb5g commented Oct 28, 2023

Could either Jérémie or Quantuum try this and let us know if it is working properly now?

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

3 participants