Repository navigation
Releases
0.3.0
First stable release of the 0.3 line, developed across five release candidates since June.
It turns PYVIUM from a single-instance wrapper into something that can drive several IviumSoft instances at once, manage their processes, and read measurement data straight off disk while a run is still going. The bundled driver is refreshed to IviumSoft 4.1247.
pip install pyvium
Highlights
Drive several IviumSoft instances safely
Selection is global in the DLL and has no getter, so concurrent calls used to be a hazard. on_instance / instance hold a process-wide driver lock across the selection and the commands that follow it, so calls from different threads never land on the wrong instance. The same applies to Ivium-n-Soft channel tabs through on_channel.
from pyvium import Pyvium
Pyvium.open_driver()
with Pyvium.on_instance(2):
Pyvium.set_cell_on()
print(Pyvium.get_potential())
device = Pyvium.instance(3) # or a handle scoped to one instance
print(device.get_device_status())Manage IviumSoft processes
Launch, adopt, reconcile and close IviumSoft instances, each mapped to the driver instance number it registered with. close() answers the "device is measuring" confirmation dialog itself, so an unattended close no longer times out and kills the process, and by default the measurement carries on running on the device.
from pyvium import Pyvium, IviumsoftInstanceManager
Pyvium.open_driver(verify_iviumsoft=False) # cold start: no IviumSoft running yet
manager = IviumsoftInstanceManager()
record = manager.launch()
manager.close(record.instance_number) # graceful; the run keeps goingRead measurements without the DLL
Read-only, WAL-safe readers for the SQLite files IviumSoft writes, so a run can be tailed while it is still being recorded. No DLL, no hardware, no IviumSoft.
from pyvium import MeasurementReader
with MeasurementReader(path) as reader:
for point in reader.read_points(after_point_id=last_seen):
...Supports incremental tailing, task and cycle scoping, per-task summaries, a curated whole-run preview, and export to CSV or pandas.
Requirements
- Windows, with IviumSoft installed. Minimum release 4.1242; 4.1247 is bundled and is required for a reconnect to adopt a measurement already running on the device.
- Python up to 3.13, cffi 2.x.
- The SQLite readers and the IDF/CSV tools are the exception: they need neither the DLL nor hardware.
Upgrading from 0.2.x
Four behaviour changes worth reading before you upgrade:
get_current_trace,get_current_we2_traceandget_potential_tracereturn the list of samples instead of a raw(result_code, values)tuple. The DLL crash that made these unusable is fixed in 4.1242.get_data_pointandget_data_point_from_scannow raise instead of silently returning the previously read point when a read fails:IndexErrorpast the end,ValueErrorbelow index 1. Both indices are 1-based, which was previously undocumented.- A DLL result code or device status outside the documented set is no longer reported as success. Both affect values nobody has observed in practice.
Full details in CHANGELOG.md.
Full Changelog: v0.2.2...v0.3.0
0.2.2
What's New
This release fixes two bugs: one in error handling for set_method_parameter and one in the FFI signature for IV_VersionDllFileStr.
Bug Fixes
-
set_method_parameternow correctly raisesDeviceNotConnectedErrorwhen no device is connected, consistent with the rest of the high-level API's error handling contract. -
IV_VersionDllFileStrFFI signature corrected fromchar*tochar**, the DLL writes a pointer, not a buffer. The returned pointer is now dereferenced directly, fixing potential crashes or garbage output when retrieving the DLL version string.
0.2.1
What's new
Patch release fixing driver lifecycle and internal state bugs introduced in 0.2.0.
Bug fixes
-
IV_open()/IV_close()— flag set after DLL call: the internalis_driver_openflag was updated before the DLL call completed. If the call
failed, the flag was left in an inconsistent state. It is now set only after a successful DLL return. -
close_driver()— now idempotent: previously raisedDriverNotOpenErrorwhen called on an already-closed driver, making it unsafe to use in
finallyblocks. It now returns silently if the driver is not open. -
select_serial_number()— unambiguous return when already connected: previously returned0, indistinguishable from a valid position index.
Now returnsNoneto clearly signal that no reselection was performed. Type signature updated toint | None. -
IV_SelectSn— corrected return type: the Core wrapper incorrectly declaredtuple[int, str]and returned the input serial number echoed back
as if it were DLL output. Simplified to return only the result code (int). -
save_method(),save_data(),save_dataset(),set_status_par()— result codes now verified: all four methods were discarding the DLL
return code entirely, making failures silent. They now callverify_result_code()and raise typed exceptions on failure. -
get_cell_status()— result code checked before processing bits: previously discarded with_, meaning a failed DLL call would process garbage
bits as valid cell status.
Upgrade notes
If you call select_serial_number() and check its return value, update your code to handle None:
index = Pyvium.select_serial_number("SN12345")
if index is None:
print("Device was already connected — no reselection needed")0.2.0
What's new
DLL upgrade: 4.1221 → 4.1239
This release bundles the updated IviumSoft driver DLL (4.1239) and exposes all new commands it introduces, across both the Core and Pyvium layers.
New commands
General
| Pyvium | Core | Description |
|---|---|---|
get_max_device_number() |
IV_MaxDevices |
Returns the maximum number of devices IviumSoft can manage |
get_version_host() |
IV_VersionHost |
Returns the DLL version required by the active IviumSoft |
check_dll_version() |
IV_VersionCheck |
Returns True if the DLL version matches the IviumSoft requirement |
get_host_handle() |
IV_HostHandle |
Returns the host handle |
get_dll_version_string() |
IV_VersionDll |
Returns the DLL build number as a string |
select_serial_number(str) |
IV_SelectSn |
Selects a device by serial number, ready to connect |
Direct Mode
| Pyvium | Core | Description |
|---|---|---|
set_device_current(int, float) |
IV_selectdevicesetvalue |
Set current on a specific IviumSoft instance |
set_device_potential(int, float) |
IV_selectdevicesetvalue |
Set potential on a specific IviumSoft instance |
set_digital_output(int) |
IV_setdigout |
Set digital output lines on the external port (bitmask) |
get_digital_input() |
IV_getdigin |
Read digital input lines on the external port (bitmask) |
set_we32_channel(int) |
IV_we32setchannel |
Select the active WE32 channel |
set_we32_offset(int, float) |
IV_we32setoffset |
Set WE32 offset for a single channel |
set_we32_offsets(int, list) |
IV_we32setoffsets |
Set WE32 offsets for multiple channels at once |
get_we32_offsets(int) |
IV_we32getoffsets |
Read current WE32 offset values for N channels |
read_we32_currents() |
IV_we32readcurrents |
Read all 32 WE32 currents simultaneously |
get_current_trace(int, float) |
IV_getcurrenttrace |
Capture a current sample sequence at a defined rate |
get_current_we2_trace(int, float) |
IV_getcurrentWE2trace |
Capture a WE2 current sample sequence |
get_potential_trace(int, float) |
IV_getpotentialtrace |
Capture a potential sample sequence |
Method Mode
| Pyvium | Core | Description |
|---|---|---|
get_db_file_name() |
IV_getDbFileName |
Returns the path of the last created SQL database file |
update_temperature(float) |
IV_UpdateTemperature |
Updates the shared temperature across all channels (beta) |
save_dataset(str) |
IV_savedataset |
Saves the full measurement list to disk |
Batch Mode (new category)
| Pyvium | Core | Description |
|---|---|---|
set_status_par(int) |
IV_StatusParSet |
Sets the global synchronisation variable |
get_status_par() |
IV_StatusParGet |
Reads the global synchronisation variable |
Bug fixes
IV_selectdevice— ffi.cdef declared return type aslong; DLL actually returnsvoid. Was reading garbage as return code on every instance switch.IV_we32setoffsets/IV_we32getoffsets/IV_we32readcurrents— all three allocated a singledouble*instead of adouble[N]array. Only the first channel value was written or read; remaining channels silently ignored.- Trace functions —
IV_getcurrenttrace,IV_getcurrentWE2trace,IV_getpotentialtracehad the same single-element array bug. Now return the full sample list. IV_getDbFileNamebuffer overflow — buffer was 16 bytes; any real filesystem path would overflow it. Increased to 260 bytes.get_active_iviumsoft_instancesoff-by-one —range(1, 32)silently excluded instance 32. Fixed torange(1, 33).get_device_statuswrong label — status code0was labelled'connected'; DLL defines it as'not connected'.- Trace functions missing state guards —
get_current_trace,get_current_we2_trace,get_potential_tracecalled Core directly without verifying driver/device state. IV_getDbFileNamein wrong module — was inGenericFunctions; moved toMethodModeFunctionsto match DLL documentation.
Documentation
Nine Jupyter notebooks covering the full pyvium API from first connection to multi-device synchronization:
| Notebook | Topic |
|---|---|
01_getting_started |
Installation, driver lifecycle, error handling reference |
02_device_and_instance_management |
Connecting devices, switching instances, serial number selection |
03_direct_mode_basics |
Potential/current control, cell on/off, current ranges |
04_direct_mode_signals |
DAC/ADC, digital I/O, AC signal, MUX channel |
05_bipotentiostat_and_we32 |
BiStat WE2 channel and 32-channel WE32 array |
06_method_mode |
Load, parameterize, run, monitor, and save experiments |
07_data_processing |
Parse IDF files and export to CSV (no hardware needed) |
08_batch_and_synchronization |
Multi-device setpoints, parallel runs, synchronized channel start |
09_trigger_reference |
Complete reference for all Python–IviumSoft trigger mechanisms |
feedback welcome via GitHub Issues.
Full method list
See docs/method_list.md for the complete mapping of all Pyvium and Core methods.
0.1.21
0.1.19b0
0.1.4beta
What's Changed
- chore(dlls): update dlls to version 4.1098.8434.0 by @raulmarindev in #36
- Chore/update-iviumsoft-4.1100 by @raulmarindev in #37
Full Changelog: v0.1.3-beta.0...0.1.4beta
v0.1.3-beta.0
What's Changed
Full Changelog: v0.1.2b0...v0.1.3-beta.0
v0.1.2-beta.0 🚀
What's Changed
- Chore/add-contributing-and-issues-templates by @raulmarindev in #30
- fix(core.py): use the right type for double pointers by @raulmarindev in #32
- fix(pyvium_verifiers.py): fix the code for the verify_cell_is_on by @raulmarindev in #33
- increase version to beta and update dependencies by @raulmarindev in #34
Full Changelog: v0.1.1a9-alpha...v0.1.2b0