Commit d9d64203 authored by Guillaume Blanchy's avatar Guillaume Blanchy
Browse files

Merge branch 'v2024_rc' of gitlab-ssh.irstea.fr:reversaal/OhmPi into v2024_rc

Showing with 4 additions and 3 deletions
+4 -3
......@@ -44,6 +44,7 @@ class Ctl(CtlAbstract):
except RuntimeWarning:
pass
warnings.resetwarnings()
# Extended I2C
try:
self.interfaces['i2c_ext'] = ExtendedI2C(4) # 4 is defined
......@@ -52,7 +53,7 @@ class Ctl(CtlAbstract):
except Exception as e:
self.exec_logger.warning(f'Could not initialize Extended I2C:\n{e}')
warnings.resetwarnings()
# modbus
try:
......
......@@ -276,7 +276,7 @@ class OhmPi(object):
headers[i] = 'R [Ohm]'
icols = list(np.where(np.in1d(headers, ['A', 'B', 'M', 'N', 'R [Ohm]']))[0])
data = np.loadtxt(os.path.join(ddir, fname), delimiter=',',
skiprows=1, usecols=icols, ndmin=2)
skiprows=1, usecols=icols)
data = data[None, :] if len(data.shape) == 1 else data
ddic[fname.replace('.csv', '')] = {
'a': data[:, 0].astype(int).tolist(),
......@@ -325,7 +325,7 @@ class OhmPi(object):
Array of shape (number quadrupoles * 4).
"""
self.exec_logger.debug(f'Loading sequence {filename}')
sequence = np.loadtxt(filename, delimiter=" ", dtype=np.uint32) # load quadrupole file
sequence = np.loadtxt(filename, delimiter=" ", dtype=np.uint32, ndmin=2) # load quadrupole file
if sequence is not None:
self.exec_logger.debug(f'Sequence of {sequence.shape[0]:d} quadrupoles read.')
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment