Big makeover with a few non-compatible changes, sorry, but I believe they
should not be too troublesome to make as you most likely relied on methods
that are still more or less compatible.
When writing the base of this package back in 2019, I had very limited Python
development experience, and some not so clever choices were made. It was time
to make clear these up and make the API easier to use.
Here are the changes:
-
More attributes are used to make the information accessible not only through
returns- Captured data stored to
Oscilloscope._time
andOscilloscope._values
- The filename finally used when saving (which might not be the same as the
the argument passed as a filename check happens to avoid overwrite) is
stored inOscilloscope.fname
Oscilloscope._raw
andOscilloscope._metadata
with unprocessed data
- Captured data stored to
-
More active use of attributes that are carried forward rather than always
setting the arguments of methods in theOscilloscope
class. This
affects some functions as their arguments have changed (see below), but
for most functions the arguments stay the same as before. The arguments
can now be used to change attributes of theOscilloscope
instance. -
Oscilloscope.__init__
and other functions will no longer use default
settings inkeyoscacquire.config
that changes the settings of the
Oscilloscope, like active channels and acquisition type, but only set
default connection and transfer settings -
Changed the name of the module
oscacq
tooscilloscope
and moved
functions not within theOscilloscope
class to other modules, see
details below -
Bugfixes and docfixes for the number of points to be transferred from the
instrument (previouslynum_points
argument, now a property). Zero will
set the to the maximum number of points available, and the number of
points can be queried. -
Moved save and plot functions to
keyoscacquire.fileio
, but are imported
in theoscilloscope
(prevoscacq
) module to keep compatibility -
New
keyoscacquire.fileio.load_trace()
function for loading saved a trace
from disk to pandas dataframe or numpy array -
Oscilloscope.query()
will now try to read the error from the
instrument if pyvisa fails -
Importing
keyoscacquire.programmes
in moduleinit.py
to make it
accessible after importing the module -
Changes in
list_visa_devices
and cli programme: now displaying different
errors more clearly; cli programme now has-n
flag that can be set to not
ask for instrument IDNs; and the cli programme will display the instrument's
serial rather than Keysight model series. -
Indicating functions for internal use only and read only attributes with
prefix_
, see name changes below -
Documentation updates, including moving from read-the-docs theme to Furo theme
-
PEP8 improvements
-
New methods:
Oscilloscope.get_error()
Oscilloscope.set_waveform_export_options()
Oscilloscope.save_trace()
(Oscilloscope.savepng
and
Oscilloscope.showplot
can be set to control its behaviour)Oscilloscope.plot_trace()
-
New properties: New properties getters querying the instrument for the
current state and setters to change the stateOscilloscope.active_channels
Oscilloscope.acq_type
Oscilloscope.num_averages
Oscilloscope.p_mode
Oscilloscope.num_points
Oscilloscope.wav_format
Oscilloscope.timeout
(this affects the pyvisa resource, not the scope
itself)
-
No compatibility: Name changes
- module
oscacq
tooscilloscope
Oscilloscope.determine_channels()
->Oscilloscope.set_channels_for_capture()
Oscilloscope.acquire_print
->Oscilloscope.verbose_acquistion
Oscilloscope.set_acquire_print()
setOscilloscope.verbose_acquistion
attribute insteadOscilloscope.capture_and_read_ascii()
->Oscilloscope._read_ascii()
(also major changes in the function)Oscilloscope.capture_and_read_binary()
->Oscilloscope._read_binary()
(also major changes in the function)Oscilloscope.inst
->Oscilloscope._inst
Oscilloscope.id
->Oscilloscope._id
Oscilloscope.address
->Oscilloscope._address
Oscilloscope.model
->Oscilloscope._model
Oscilloscope.model_series
->Oscilloscope._model_series
oscacq._screen_colors
->fileio._SCREEN_COLORS
- module
-
No compatibility: Moved functions and attributes
check_file()
fromoscacq
tofileio
interpret_visa_id()
fromoscacq
tovisa_utils
process_data()
(as well as_process_data_ascii
and
_process_data_binary
) fromoscacq
todataprocessing
_SCREEN_COLORS
(prev._screen_colors
) fromoscacq
tofileio
-
No compatibility: Some functions no longer take
sources
and
sourcesstring
as arguments, ratherOscilloscope._sources
must be set by
Oscilloscope.set_channels_for_capture()
andsourcesstring
is not in
use anymoreOscilloscope.capture_and_read()
, and its associated
Oscilloscope._read_ascii()
andOscilloscope._read_binary()
Oscilloscope.get_trace()
-
No compatibility: Misc
Oscilloscope.get_trace()
now also returnsOscilloscope.num_channels
Oscilloscope.get_active_channels()
is now a propertyactive_channels
and returns a list of ints, not charskeyoscacquire.config
does not have the_acq_type
,_num_avg
,
and_ch_nums
static variables anymore as these will not be usedkeyoscacquire.config
has two new static variables,_num_points
and_p_mode