Version 2.0.0
pslab-python 2.0.0 Release Notes
pslab-python 2.0 is now available!
Large parts of pslab-python have been rewritten to improve user friendliness. pslab-python version 1.0 was written primarily as a back end for pslab-desktop. While it could be used as a standalone library, it was not designed with that use case foremost in mind.
pslab-python 2.0 still serves as the back end for pslab-desktop, but it has been rewritten to be more user-friendly when being used as a standalone library.
Also worth mentioning is pslab-python's new test suite. Although tests are not immediately useful for users, they help developers avoid accidentally introducing regressions, which in turn makes pslab-python more pleasant to use.
The rewrite touches almost every part of pslab-python and is too extensive to go into detail, so here are the most important user-facing improvements:
Highlights
General
- Package renamed from
PSLtopslab. - Simplified API.
- Improved documentation now available on readthedocs.
- pslab-python now has a command line interface. Type
pslab --helpin a terminal for more information. - pslab-python can now be installed from PyPI:
pip install pslab - Reworked exception handling. Exceptions are now raised as soon as possible instead of being suppressed and allowed to propagate.
- Many, many bug fixes.
Oscilloscope
- Oscilloscope-related functionality can now be found in the
Oscilloscopeclass. - The many different capture methods (
capture1,capture2,capture4,capture_multiple,capture_fullspeed,capture_fullspeed_hr,capture_traces,capture_highres_traces) have been combined into a singlecapturemethod. - Trigger settings can optionally be configured directly in the
capturecall, without the need to callconfigure_triggerseparately.
Logic Analyzer
- Logic analyzer-related functionality can now be found in the
LogicAnalyzerclass. - The many different capture methods (
capture_edges1,start_one_channel_LA,start_two_channel_LA,start_three_channel_LA,start_four_channel_LA,start_one_channel_LA_backup__) have been combined into a singlecapturemethod. - The type of logic event to capture is now given as a string instead of a number (e.g. "falling" instead of 2 to capture only falling edges).
Multimeter
- Multimeter-related functionality can now be found in the
Multimeterclass. - Several different methods for measuring capacitance (
capacitance_via_RC_dischan rge,get_capacitor_range,get_capacitance) have been combined intomeasure_capacitance. calibrate_capacitancemethod added, which allows for measurement of very small (single picofarad) capacitors.
Waveform Generator
- Analog waveform-related functionality can now be found in the
WaveformGeneratorclass. - The many different methods for generating waveforms (
set_wave,set_sine1,set_sine2,set_w1,set_w2,set_waves) have been combined into a singlegeneratemethod. - Waveform amplitude is now set directly as part of a loaded function. For example
load_function("SI1", lambda x: np.sin(x), [0, 2*np.pi])will have an amplitide of 1 V, whileload_function("SI1", lambda x: 2*np.sin(x), [0, 2*np.pi])will have an amplitude of 2 V.
PWM Generator
- PWM-related functionality can now be found in the
PWMGeneratorclass. - Several different methods for generator PWM signals (
sqr1,sqr1_pattern,sqr2,set_sqrs,sqrPWM) have been combined into a singlegeneratemethod.
Power Supply
- Power supply-related functionality can now be found in the PowerSupply class.
- Voltage and current are now set via properties, e.g. to set the voltage on pin PV1 to 3 V, write
power_supply.pv1 = 3. - The load resistance limitation on PCS is now clearly documented.
I2C
- The
I2Cclass has been split into theI2CMasterandI2CSlaveclasses. - Primitive I2C calls (start, stop, wait, restart, etc.) are no longer available. Instead, use
readandwritewhich take care of I2C session handling under the hood.
Known issues
- Not every part of pslab-python has been rewritten. Specifically, the
externalsubpackage (previously known asSENSORS) contains many sensor classes which remain untested.