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

Merge branch '204_fix_issue' into 'master'

v2024.0.15

Closes #204

See merge request ohmpi/ohmpi!48
Showing with 13 additions and 10 deletions
+13 -10
...@@ -53,7 +53,7 @@ except Exception as error: ...@@ -53,7 +53,7 @@ except Exception as error:
print(colored(f'Unexpected error: {error}', 'red')) print(colored(f'Unexpected error: {error}', 'red'))
arm64_imports = None arm64_imports = None
VERSION = 'v2024.0.14' VERSION = 'v2024.0.15'
class OhmPi(object): class OhmPi(object):
...@@ -953,9 +953,10 @@ class OhmPi(object): ...@@ -953,9 +953,10 @@ class OhmPi(object):
self.thread = Thread(target=func) self.thread = Thread(target=func)
self.thread.start() self.thread.start()
def run_sequence(self, fw_in_csv=None, fw_in_zip=None, cmd_id=None, save_strategy_fw=False, **kwargs): def run_sequence(self, fw_in_csv=None, fw_in_zip=None, cmd_id=None, save_strategy_fw=False,
export_path=None, **kwargs):
"""Runs sequence synchronously (=blocking on main thread). """Runs sequence synchronously (=blocking on main thread).
Additional arguments are passed to run_measurement(). Additional arguments (kwargs) are passed to run_measurement().
Parameters Parameters
---------- ----------
...@@ -966,6 +967,10 @@ class OhmPi(object): ...@@ -966,6 +967,10 @@ class OhmPi(object):
fw_in_zip : bool, optional fw_in_zip : bool, optional
Whether to save the full-waveform data in a separate .csv in long format to be zipped to Whether to save the full-waveform data in a separate .csv in long format to be zipped to
spare space. If None, default is read from default.json. spare space. If None, default is read from default.json.
save_strategy_fw : bool, optional
Whether to save the strategy used.
export_path : str, optional
Path where to save the results. Default taken from settings.json.
cmd_id : str, optional cmd_id : str, optional
Unique command identifier. Unique command identifier.
""" """
...@@ -985,12 +990,10 @@ class OhmPi(object): ...@@ -985,12 +990,10 @@ class OhmPi(object):
self.reset_mux() self.reset_mux()
# create filename with timestamp # create filename with timestamp
if self.settings["export_path"] is None: if export_path is None:
filename = self.settings['export_path'].replace( export_path = self.settings['export_path']
'.csv', f'_{datetime.now().strftime("%Y%m%dT%H%M%S")}.csv') filename = export_path.replace(
else: '.csv', f'_{datetime.now().strftime("%Y%m%dT%H%M%S")}.csv')
filename = self.settings["export_path"].replace('.csv',
f'_{datetime.now().strftime("%Y%m%dT%H%M%S")}.csv')
self.exec_logger.debug(f'Saving to {filename}') self.exec_logger.debug(f'Saving to {filename}')
# measure all quadrupole of the sequence # measure all quadrupole of the sequence
...@@ -1070,7 +1073,7 @@ class OhmPi(object): ...@@ -1070,7 +1073,7 @@ class OhmPi(object):
def run_sequence_async(self, cmd_id=None, **kwargs): def run_sequence_async(self, cmd_id=None, **kwargs):
"""Runs the sequence in a separate thread. Can be stopped by 'OhmPi.interrupt()'. """Runs the sequence in a separate thread. Can be stopped by 'OhmPi.interrupt()'.
Additional arguments are passed to run_measurement(). Additional arguments are passed to run_sequence().
Parameters Parameters
---------- ----------
......
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