From a03ce9c7746c50e94f85981db51a3ae57b20a4df Mon Sep 17 00:00:00 2001
From: su530201 <olivier.kaufmann@umons.ac.be>
Date: Tue, 26 Sep 2023 11:36:39 +0200
Subject: [PATCH] Updates mux_2024 specs handling

---
 ohmpi/hardware_components/mux_2024_rev_0_0.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/ohmpi/hardware_components/mux_2024_rev_0_0.py b/ohmpi/hardware_components/mux_2024_rev_0_0.py
index 3bca1474..10391b52 100644
--- a/ohmpi/hardware_components/mux_2024_rev_0_0.py
+++ b/ohmpi/hardware_components/mux_2024_rev_0_0.py
@@ -14,11 +14,11 @@ activation_delay = 0.01
 release_delay = 0.005
 
 MUX_CONFIG = HARDWARE_CONFIG['mux'].pop('default', {})
-MUX_CONFIG.update({'voltage_max': max(0,min(MUX_CONFIG['voltage_max'],voltage_max)),
-                   'current_max': max(0,min(MUX_CONFIG['current_max'],voltage_max))})
+MUX_CONFIG.update({'voltage_max': max(0.,min(MUX_CONFIG['voltage_max'],voltage_max)),
+                   'current_max': max(0.,min(MUX_CONFIG['current_max'],voltage_max))})
 
-MUX_CONFIG.update({'activation_delay': max(MUX_CONFIG['activation_delay'],activation_delay),
-                   'release_delay': max(MUX_CONFIG['release_delay'],release_delay)})
+MUX_CONFIG.update({'activation_delay': max(MUX_CONFIG.pop('activation_delay', activation_delay),activation_delay),
+                   'release_delay': max(MUX_CONFIG.pop('release_delay', release_delay),release_delay)})
 
 # defaults to 4 roles cabling electrodes from 1 to 8
 default_mux_cabling = {(elec, role) : ('mux_1', elec) for role in ['A', 'B', 'M', 'N'] for elec in range(1,9)}
-- 
GitLab