PyPalmSens 1.4.0
The goal for this release is to remove friction when you are getting started with PyPalmSens.
New measurement command
We added a new top-level function measure() (and measure_async()) which will connect to the USB device and start a measurement:
>>> import pypalmsens as ps
>>> method = ps.ChronoAmperometry(
... interval_time=0.01,
... potential=1.0,
... run_time=10.0,
... )
>>> ps.measure(method)
Measurement(title=Chronoamperometry, timestamp=17-Nov-25 13:42:16, device=EmStat4HR)Easier to add a callback
The measure function takes a callback as an argument, so you can use this cool one-liner to impress your friends:
>>> import pypalmsens as ps
>>> ps.measure(ps.CyclicVoltammetry(), callback=print)This change also affects all other measure() methods, like InstrumentManager.measure() and InstrumentPool.measure().
>>> ...
>>> with ps.connect() as manager:
... measurement = manager.measure(method, callback=new_data_callback)As a result, passing the callback directly to these class instantiators has been deprecated.
Scan for for FTDI devices by default
pypalmsens.discover() unexpectedly returning an empty list was a common source of confusion for Linux users . The reason is that some instruments (e.g. EmStat Pico or MultiPalmsens4) use an FTDI chip which require additional drivers. We now scan for FTDI devices by default, and instead show a warning message explaining what to do if drivers are missing.
You can turn this warning off with (ps.discover(ftdi=False)).
See the driver compatibility list here.
Improved error handling and locking
We also refactored the InstrumentManager / InstrumentManagerAsync to reduce the amount of duplicated code to not silently swallow errors. The result is better error handling and management of instrument resources. This change won't be directly noticable, but makes the code easier to work with and maintain in the long run.
Better support for linux
As a result of the above change, compatibility with linux also improved. All techniques should now work as expected. If you run into any issues, let us know.
What's Changed
- Add
pypalmsens.measuremethod and improve connection handling by @stefsmeets in #173 - Scan for ftdi devices by default by @stefsmeets in #183
- Add locking to InstrumentManager by @stefsmeets in #184
- Update docstrings for methods and method settings by @stefsmeets in #180
- Single-source measurement code by @stefsmeets in #188
- Generate python docs using mkdocs by @stefsmeets in #169
- Fix missing css in Python api reference by @stefsmeets in #177
- Fix method pages not showing up by @stefsmeets in #187
Full Changelog: python-1.3.3...python-1.4.0