-
-
Notifications
You must be signed in to change notification settings - Fork 80
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
Strange Effect when using python-seabreeze in combination with gtk #12
Comments
This is very weird... |
Please do:
with and without the Gtk import. |
I also testet the pyseabreeze backend and the problem happens only with the cseabreeze backend.
Running your code gives to following result:
|
Can you test if the newest commit on master fixes this problem? |
Unfortunately the result is the same:
A workaround would be to import gtk after |
Can you still reproduce this issue? So my guess is that it might have been a gtk3 bug, that is fixed now? Since this is the only thing I didn't test. |
At the moment I use seabreeze under windows with qt instead of gtk which works fine. `>>> import seabreeze.spectrometers as sb Traceback (most recent call last): Now I'm a bit confused, do you know why this error occurs ? |
Did you install the module properly? This happens, if you install the module via Also you closed the issue. Does this mean you also can't reproduce the bug anymore? |
Thanks for the tip, that was actually the Problem, the new version works perfectly in a different directory. |
Can you run the following code and post the output: from gi.repository import Gtk, GObject
import seabreeze.cseabreeze as cseabreeze
import numpy
import sys
print ( sys.version )
print ( cseabreeze.__file__ )
print ( Gtk._version )
print ( GObject.pygobject_version )
device, = cseabreeze.wrapper.device_list_devices()
cseabreeze.wrapper.device_open(device)
specID, = cseabreeze.wrapper.device_get_spectrometer_feature_id(device)
speclen = cseabreeze.wrapper.spectrometer_get_formatted_spectrum_length(device, specID)
out = numpy.empty((speclen,), numpy.double)
cseabreeze.wrapper.spectrometer_get_wavelengths(device, specID, out)
print ( "First ten wavelengths:" )
print ( out[:10] ) Thanks |
And also with the Gtk, GObject import after the sys import. :) Thanks. |
No problem, 3.5.1 (default, Dec 7 2015, 12:58:09)
[GCC 5.2.0]
/usr/lib/python3.5/site-packages/seabreeze-0.5.3-py3.5-linux-x86_64.egg/seabreeze/cseabreeze/__init__.py
3.0
(3, 18, 2)
1044
First ten wavelengths:
[ -6.10800000e+03 -4.42500000e+03 -3.07200000e+03 -2.01300000e+03
-1.21200000e+03 -6.33000000e+02 -2.40000000e+02 3.00000000e+00
1.32000000e+02 1.83000000e+02] Gtk after sys: 3.5.1 (default, Dec 7 2015, 12:58:09)
[GCC 5.2.0]
/usr/lib/python3.5/site-packages/seabreeze-0.5.3-py3.5-linux-x86_64.egg/seabreeze/cseabreeze/__init__.py
3.0
(3, 18, 2)
1044
First ten wavelengths:
[ -6.10800000e+03 -4.42500000e+03 -3.07200000e+03 -2.01300000e+03
-1.21200000e+03 -6.33000000e+02 -2.40000000e+02 3.00000000e+00
1.32000000e+02 1.83000000e+02] So now the wrong wavelengths are returned regardless of the position of the gtk import. Here is the output without importing gtk and gobject: 3.5.1 (default, Dec 7 2015, 12:58:09)
[GCC 5.2.0]
/usr/lib/python3.5/site-packages/seabreeze-0.5.3-py3.5-linux-x86_64.egg/seabreeze/cseabreeze/__init__.py
1044
First ten wavelengths:
[ 184.34537107 185.15048402 185.95551917 186.76047652 187.56535608
188.37015785 189.17488183 189.97952804 190.78409646 191.58858712]```
Maybe it is something distribution specific, which distribution did you use for testing ? |
I'm closing this one, because it never got reported again... 🤷 |
I'm not sure if this would better fit to the bugtracker of gtk, but maybe someone else using python-seabreeze can check if the problem exist on other computers too, and it's not a problem of my configuration.
When calling the following code with python 3.4, wrong values for the wavelength are returned:
When commenting out from gi.repository import Gtk, the right values are reported.
In both cases the intensities are correct.
I can't get my head around why gtk might interfere with seabreeze ...
The text was updated successfully, but these errors were encountered: