diff --git a/ohmpi/hardware_components/raspberry_pi.py b/ohmpi/hardware_components/raspberry_pi.py index d3333c085c675b8db59c1a02d9b1171e0766a39c..3bfa2af74e338b0ffbcb3775b750ac9e8af4ba29 100644 --- a/ohmpi/hardware_components/raspberry_pi.py +++ b/ohmpi/hardware_components/raspberry_pi.py @@ -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: diff --git a/ohmpi/ohmpi.py b/ohmpi/ohmpi.py index b21db3795f53b1098b4a8a2777062ddab891191a..ad45153b69451e6e96f8e9268a80618229d8e530 100644 --- a/ohmpi/ohmpi.py +++ b/ohmpi/ohmpi.py @@ -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.')