Disregarded fixes for bugs in the Python wrapper

Post your Python discussions here.
Post Reply
stefanct
Newbie
Posts: 0
Joined: Mon Jun 24, 2024 12:54 pm

Disregarded fixes for bugs in the Python wrapper

Post by stefanct »

Hey,
I was trying out the Python wrappers for the first time today and ran into one very obvious problem with the example code in the readme. I have noticed that this was actually already fixed years ago by a community member who has made a pull request on the github repo. There are a number of other fixes there already and it would be nice if somebody could take care of the mentioned problems there (again - there have been a number of changes merged from previous PRs).

The one problem I ran into specifically was while running the example discovery code (btw why is that not included as a file?):

Code: Select all

from picosdk.discover import find_all_units

scopes = find_all_units()

for scope in scopes:
    print(scope.info)
    scope.close()

Code: Select all

Traceback (most recent call last):
  File ".../discover.py", line 3, in 
    scopes = find_all_units()
             ^^^^^^^^^^^^^^^^
  File ".../picosdk_venv/lib/python3.11/site-packages/picosdk/discover.py", line 46, in find_all_units
    device = driver.open_unit()
             ^^^^^^^^^^^^^^^^^^
  File ".../picosdk_venv/lib/python3.11/site-packages/picosdk/library.py", line 140, in open_unit
    return Device(self, self._python_open_unit(serial=serial, resolution=resolution))
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../picosdk_venv/lib/python3.11/site-packages/picosdk/library.py", line 152, in _python_open_unit
    handle, status = self._python_open_any_unit(resolution)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../picosdk_venv/lib/python3.11/site-packages/picosdk/library.py", line 169, in _python_open_any_unit
    resolution = self.DEFAULT_RESOLUTION
                 ^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'Ps6000alib' object has no attribute 'DEFAULT_RESOLUTION'
It gets fixed by https://github.com/picotech/picosdk-pyt ... rs/pull/38

NeilH
PICO STAFF
PICO STAFF
Posts: 290
Joined: Tue Jul 18, 2017 8:28 am

Re: Disregarded fixes for bugs in the Python wrapper

Post by NeilH »

For these fixes we have implemented them in an upcoming update to the python wrappers repo in a different way for the default resolution so we will be using our implementation rather than taking the pull request.
Neil
Technical Support Engineer

Post Reply