Labbench

Latest version: v0.37.0

Safety actively analyzes 629004 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 5 of 7

0.20

Added
Changed
- Explicitly removed support for python 2.x
- Fixes for docstrings in Device.state and Device.settings objects
- All trait type definitions now support the `remap` keyword.
This dictionary value is formed of keys of the validated type of the trait (e.g. lb.Bool should be python bool values)
and values of the desired output that goes "over the wire" to the Device. This generalizes
(and replaces) the functionality that was implemented in the trues_ and falses_ keyword in lb.Bool.
- Added traceback_delay keyword argument to lb.concurrently to configure
whether to immediately display traceback information. This now defaults to
True, which waits to display traceback information until all threads have
finished. When only one thread raises an exception, this reduces superfluous
debug output, which can be overwhelming when lb.concurrently is called in an
inner loop.
- Address a pandas warning about sorting
- Corrected a state and setting bug where setters caused unnecessary extra getter calls
- Fixed the bug in jupyter notebook front panel re-display for objects that already exist
- If Device.state and/or Device.settings are declared with no parent class, automatically subclass from corresponding attribute in the parent class
- Count the number of threads running in lb.concurrently to clear the stop request event, so lb.sleep does not unexpectedly raise ThreadEndedByMaster

Removed

0.19

Added
- `labbench.retry` calls a function exception up to a specified number of times
- `labbench.SQLiteLogger.observe_settings` for capturing settings into the database
- `labbench.Email` "device" notifies on disconnection, with info text that includes stderr and any exceptions
- `labbench.sleep` emulates time.sleep, but includes goodies to raise exceptions to end threads at the request of the master thread
- `labbench.until_timeout` (decorator) repeats a function call, suppressing a specified exception until the specified timeout period has expired
- `labbench.kill_by_name` kills a process by name
- `labbench.stopwatch` to time a block of code using a `with` statement
- `labbench.DeviceConnectionLost` exception
- `labbench.check_master` raises ThreadEndedByMaster if the master has requested threads to quit

Changed
- Fixed exception bug in host.py when Host.disconnect() is called after it is already disconnected
- disconnect attribute behavior is now customized for Device subclasses - all disconnect methods in the Device driver MRO are called up to Device.disconnect
- disconnect exceptions are suppressed, though their tracebacks are printed to stderr
- connect attribute behavior is now customized for Device subclasses - all connect methods in the Device driver MRO are starting from Device.connect
- Testbed now includes a stderr attribute, which produces an output log in stderr.log after the Testbed disconnects
- Fix some unicode decode errors that may be raised on special console characters in CommandLineWrapper
- Access to VISADevice.backend now injects the labbench sleep function into the time module, in order to hack thread support into visa queries
- Fixed bugs that sometimes caused duplicated logger output messages on the screen
- VISADevice includes a hack to replace time.sleep with labbench.sleep for responsiveness to exceptions
- labbench.concurrently now supports dictionary inputs, making exceptions more informative
- Device.command_set and Device.command_get have been replaced by the Device.state.getter and Device.state.setter
decorators to follow the same property-like behavior of trait getters and setters
- Automatically generate wrappers for `__init__` methods of device subclasses in order to
help autogenerate documentation and autocomplete in IDEs
- lb.read_relational now skips expanding from files in rows that are '' or None
- lb.panel now supports a testbed keyword to search a Testbed instance for devices instead of the parent namespace
- When only a single thread raises an exception, `labbench.concurrently` now raises that exception instead of `ConcurrentException`
- Fixed a rare race condition in command line execution
- Raise AttributeError on attempts to assign to a state or setting that hasn't been defined
- feather-format is no longer a dependency; it has been replaced with pyarrow
- Use `pyarrow` instead of `feather-format` to implement feather support, reducing the number of dependencies
- Fixed a bug in VISADevice.list_devices

Removed
- CSVLogger may be bitrotten; needs to be checked and possibly deprecated?
- Device.cleanup (it is superceded by the new Device.disconnect behavior)
- Device.setup (superceded by the new Device.connect behavior)
- pythonnet is no longer a required dependency (though it is required if you use lb.DotNetDevice)

0.18

Added
- Device.settings for settings traits that are cached locally and do not require communication with the device
- Device.settings.define makes a new settings subclass with adjusted default values

Changed
- Streamlined display of exception tracebacks in concurrent excecution by removing lines with distracing labbench.util internals
- Exceptions raised during connect or disconnect of a Device instance using a `with` block now display information about which instance failed. This should help to reduce confusion debugging failures when connecting multiple devices.
- Simplified the Device.state.connected logic by replacing __getattribute__ munging with a dynamic check for whether Device.backend is a DisconnectedBackend instance or not.
- Bugfixes for CommandLineWrapper
- always and never arguments observe_states are now only applied if they are not empty
- concurrently() now responds to exceptions in the main thread within 100ms, instead of waiting until after the next thread finishes

Removed
- Local state trait classes (local states are now implemented by use of the settings traits)

0.16

Added
- LocalList state trait
- support for customizing background processes in CommandLineWrapper via respawn, exception_on_stderr, and no_state_arguments context managers
- refactored all output data munging into a single class, DirectoryMunger, to contain the ugliness that is munging
- new FilenameDict for managing short lists of parameters as single config filenames

Changed
- Local state traits now support the command keyword
- Local state traits now by default support None values
- database .append() now by default makes a deep copy of the passed data,
which is important for thread safety and for cases where a dictionary is reused.
this can be disabled (for example, to improve performance) by passing copy=False
to the append method.
- support waiting for a specified number of queue entries in CommandLineWrapper.read_stdout
- switch to copy instead of move when importing a file into the tree
- debug messages on successful completion of Device setup method after connection
- better detail for debug information in certain rare exceptions in SQLiteLogger
- move imports to __init__ and the root of backends.py to improve threadsafety
- CommandLineWrapper uses subprocess.run instead of subprocess.check_output now for win32 threadsafety
- fixed tests/test_db.py to match current labbench
- moved expensive imports from the top of `backends.py` to `Device.__imports__` method to speed up `labbench` import

Removed

0.15

Added
- new `sequentially` function reproduces behavior of `concurrently` for single-threaded behavior
- new util.ThreadSandbox wrapper delegates calls to a device backend to a background thread, providing threadsafety by blocking until the background thread is free
- backends.py
- data.py

Changed
- call __exit__ last for Device instances for with blocks that use lb.concurrently
- small bugfixes to database management
- support for passing arbitrary metadata to SQLiteLogger by keyword argument
- `concurrently` and `sequentially` now accept parameter inputs that are dictionaries, which are "passed through" through by updating to the result
- minor concurrency updates
- The base Device implementation now includes a concurrency_support state trait indicating whether the driver supports labbench concurrency
- Reverted the previous change to Device.__repr__, which made the string representation of a class unweildy in many cases
- database writes for strings that contain paths to existing files on disk now move that file into the relational file heirarchy
- many bugfixes mean the new win32 COM driver backend support works, including threading support via util.ThreadSandbox
- feather-format support is now a requirement for python3 installation
- All concurrency support in concurrency.py now in util.py
- Support for a user-defined preprocessing function in database managers that is called before writing to disk
- Remove spurious extra connect() calls in concurrently()
- Extra info messages in concurrent context entry
- Combined all backends into backends.py to cut down on number of files
- Documentation refresh
- managedata.py is now data.py

Removed
- concurrency.py
- win32com.py
- dotnet.py
- labview.py
- visa.py
- commandline.py
- managedata.py
- emulated.py

0.14

Added
- list_devices() function lists Device instances in the current frame
- ConfigStore and ConcurrentRunner classes for supporting high-level testbed development

Changed
- the concurrently function now supports concurrently context managers entry for concurrent connection to Device instances
- expanded the Device __repr__ to show the all parameters passed to __init__
- SQLiteLogger now stores the master database in {base-folder}/master.db instead of {base-folder}.db to keep all folders together
- Skipped to 0.14 because tag whoops

Removed
- notebooks.enumerate_devices (replaced by the list_devices function in __init__.py)

Page 5 of 7

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.