From ddbbd47d8d536df4d8d21d1eaa3c0572a9b5e910 Mon Sep 17 00:00:00 2001
From: Guillaume <sagitta1618@gmail.com>
Date: Sat, 2 Mar 2024 20:04:38 +0000
Subject: [PATCH] Add sequence generator

---
 .dev/test_mb_2024_4_mux_2023_dps5005.py           | 3 ++-
 configs/config_mb_2024_0_2__4_mux_2023_dps5005.py | 2 +-
 ohmpi/ohmpi.py                                    | 4 +++-
 3 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/.dev/test_mb_2024_4_mux_2023_dps5005.py b/.dev/test_mb_2024_4_mux_2023_dps5005.py
index 73fc7bfb..1eaccef6 100644
--- a/.dev/test_mb_2024_4_mux_2023_dps5005.py
+++ b/.dev/test_mb_2024_4_mux_2023_dps5005.py
@@ -82,9 +82,10 @@ if within_ohmpi:
     k = OhmPi()
     # A, B, M, N = (32, 29, 31, 30)
     k.reset_mux()
-    k.create_sequence(nelec=6, params=[('dpdp', 1, 1), ('wenner', 1)], ireciprocal=True)
+    k.create_sequence(nelec=6, params=[('wenner', 1)], ireciprocal=True)
     print(k.sequence)
     k.run_sequence(cycles=1, tx_vold=5, cycle_duration=0.2)
+    k.plot_last_fw()
     k.export(ftype='bert')
     # k.export(fnames=['data/measurements_20240226T180635.csv'], ftype='bert')
     # k.download_data()
diff --git a/configs/config_mb_2024_0_2__4_mux_2023_dps5005.py b/configs/config_mb_2024_0_2__4_mux_2023_dps5005.py
index d555152d..57cd2686 100644
--- a/configs/config_mb_2024_0_2__4_mux_2023_dps5005.py
+++ b/configs/config_mb_2024_0_2__4_mux_2023_dps5005.py
@@ -64,7 +64,7 @@ HARDWARE_CONFIG = {
                           'electrodes': range(1, 65),
                           }
                  },
-            'default': {'interface_name': 'i2c',
+            'default': {'interface_name': 'i2c_ext',
                              'voltage_max': 50.,
                              'current_max': 3.}
                 }
diff --git a/ohmpi/ohmpi.py b/ohmpi/ohmpi.py
index 7ec737b9..fffa5024 100644
--- a/ohmpi/ohmpi.py
+++ b/ohmpi/ohmpi.py
@@ -273,10 +273,12 @@ class OhmPi(object):
             pok = [int(p[i]) for i in np.arange(1, len(p))]  # make sure all are int
             qs.append(fdico[p[0]](nelec, *pok).values.astype(int))
         quad = np.vstack(qs)
+        if len(quad.shape) == 1:  # only one quadrupole
+            quad = quad[None, :]
 
         # add reciprocal
         if ireciprocal:
-            quad = np.r_[quad, quad[[2, 3, 0, 1]]]
+            quad = np.r_[quad, quad[:, [2, 3, 0, 1]]]
         self.sequence = quad
 
         # save sequence
-- 
GitLab