ap--/python-seabreeze

Version 2.0.1 crashes on read

drmcnelson opened this issue ยท 12 comments

spectrometer and system information

  • model: (i.e. USB2000, STS, etc...)

USB2000+

  • operating system: (i.e. Windows 7 64bit)

Fedora 35

  • python version: (output of python --version)

Python 3.10.1

  • python-seabreeze version: (i.e. 0.5.3 or 'current master')

python seabreeze 2.0.1

  • installed-via: (conda, wheel, or python setup.py install)

sudo pip install seabreeze[pyseabreeze] --no-use-pep517 --no-build-isolation --install-option="--without-cseabreeze" --no-cache-dir

current problem

The intensities() api is broken, produces the following error message.

This is specific to 2.0.1, I uninstalled it and installed 1.3.0 in its place, and that earlier version works perfectly.

steps to reproduce

Run any simple program with the call to intensities().

File "/usr/local/lib/python3.10/site-packages/seabreeze/spectrometers.py", line 212, in intensities
out = self._dev.f.spectrometer.get_intensities()
File "/usr/local/lib/python3.10/site-packages/seabreeze/pyseabreeze/features/spectrometer.py", line 147, in get_intensities
tmp = self._get_spectrum_raw()
File "/usr/local/lib/python3.10/site-packages/seabreeze/pyseabreeze/features/spectrometer.py", line 167, in _get_spectrum_raw
tmp[:] = self.protocol.receive(
ValueError: invalid literal for int() with base 10: b'\x07\x00\xf6-H\x02<\x02-\x02N\x02&\x02E\x02.\x02I\x02V\x02a\x02Q\x02e\x02Z\x02h\x02l\x02q\x02g\x02\x8b\x02\xa3\x02\x96\x02\x92\x02\xa1\x02\x9e\x02\xab\x02\xa3\x02\x9c\x02\xc7\x02\xa9\x02\xcd\x02\xd2

ap-- commented

Hey @drmcnelson,

This is a regression due to some refactoring within pyseabreeze.
I'll try to get a fix out soon.

Thanks for reporting!
Cheers,
Andreas ๐Ÿ˜ƒ

ap-- commented

https://github.com/ap--/python-seabreeze/actions/runs/1725616126

There's new wheels ready for download on the current PR where I try to fix the described issue.

Could you download the wheels artifact from the link above, extract it, and install the corresponding wheel for your os and python version and test if it works?

Cheers,
Andreas ๐Ÿ˜ƒ

Another bug, perhaps, the following installation command line produces an error that option "--without-cseabreeze" is not recognized.

sudo pip install seabreeze[pyseabreeze] --no-use-pep517 --no-build-isolation --install-option="--without-cseabreeze"

ap-- commented

Once v2.0.2 is out you should just be able to do:
(This pipeline has to finish to upload the new wheels: https://github.com/ap--/python-seabreeze/actions/runs/1728412220)

pip install -U seabreeze

and it should work.

Regarding the issue with

pip install seabreeze[pyseabreeze] --no-use-pep517 --no-build-isolation --install-option="--without-cseabreeze"

I would need more information about your current environment. please run pip freeze and report back with the versions of installed python libraries on your machine.

In case v2.0.2 fixes the original issue, please close this issue ๐Ÿ˜ƒ

Hi, here is the pip freeze. If you can tell me how to download and install the wheel, I can give it a try.

pip.freeze.txt

ap-- commented

Sorry, could you run pip freeze --all?

And installing the wheel is not necessary. I made a new release, so just running pip install -U seabreeze on your machine should install v2.0.2 with the newest fixes.

Cheers,
Andreas ๐Ÿ˜ƒ

ap-- commented

Thanks for the info. I moved the discussion regarding the pip install problems to a new issue: #150

In case version v2.0.2 fixes the issue regarding crashes on .read please close this issue.

Cheers,
Andreas ๐Ÿ˜ƒ

Version 2.0.2 seems to be a winner. Installs easily and runs well.

Thank you

ap-- commented

Awesome. Great that it works!

Regarding the ADC1000USB, I'll open another issue for improving the docs on how to add new spectrometers and I'll start a draft pull-request sketching out what needs to be done to integrate the adc1000usb code.

Cheers,
Andreas ๐Ÿ˜ƒ