Skip to content

0.2.1

Choose a tag to compare

@Gnpd Gnpd released this 29 May 06:04
· 83 commits to main since this release

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 internal is_driver_open flag 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 raised DriverNotOpenError when called on an already-closed driver, making it unsafe to use in
    finally blocks. It now returns silently if the driver is not open.

  • select_serial_number() — unambiguous return when already connected: previously returned 0, indistinguishable from a valid position index.
    Now returns None to clearly signal that no reselection was performed. Type signature updated to int | None.

  • IV_SelectSn — corrected return type: the Core wrapper incorrectly declared tuple[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 call verify_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")