Skip to content

Commit

Permalink
fix: Make do1d log its dataset ID (#23)
Browse files Browse the repository at this point in the history
second part of commit
  • Loading branch information
WilliamHPNielsen authored and jenshnielsen committed Nov 17, 2017
1 parent 8f31f27 commit 7c69cc6
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion qcodes/utils/wrappers.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,10 @@ def init(mainfolder:str, sample_name: str, station, plot_x_position=0.66,
raise RuntimeWarning("History can't be saved refusing to proceed (use IPython/jupyter)")
else:
logfile = "{}{}".format(path_to_experiment_folder, "commands.log")
CURRENT_EXPERIMENT['logfile'] = logfile
if not CURRENT_EXPERIMENT["logging_enabled"]:
log.debug("Logging commands to: t{}".format(logfile))
ipython.magic("%logstart -t {} {}".format(logfile, "append"))
ipython.magic("%logstart -t -o {} {}".format(logfile, "append"))
CURRENT_EXPERIMENT["logging_enabled"] = True
else:
log.debug("Logging already started at {}".format(logfile))
Expand Down Expand Up @@ -223,6 +224,12 @@ def do1d(inst_set, start, stop, num_points, delay, *inst_meas):
if CURRENT_EXPERIMENT.get('device_image'):
log.debug('Saving device image')
save_device_image()

# add the measurement ID to the logfile
with open(CURRENT_EXPERIMENT['logfile'], 'a') as fid:
print("#[QCoDeS]# Saved dataset to: {}".format(data.location),
file=fid)

return plot, data


Expand Down Expand Up @@ -258,6 +265,12 @@ def do1dDiagonal(inst_set, inst2_set, start, stop, num_points, delay, start2, sl
_save_individual_plots(data, plottables)
if CURRENT_EXPERIMENT.get('device_image'):
save_device_image()

# add the measurement ID to the logfile
with open(CURRENT_EXPERIMENT['logfile'], 'a') as fid:
print("#[QCoDeS]# Saved dataset to: {}".format(data.location),
file=fid)

return plot, data


Expand Down Expand Up @@ -298,6 +311,12 @@ def do2d(inst_set, start, stop, num_points, delay, inst_set2, start2, stop2, num
_save_individual_plots(data, plottables)
if CURRENT_EXPERIMENT.get('device_image'):
save_device_image()

# add the measurement ID to the logfile
with open(CURRENT_EXPERIMENT['logfile'], 'a') as fid:
print("#[QCoDeS]# Saved dataset to: {}".format(data.location),
file=fid)

return plot, data


Expand Down

0 comments on commit 7c69cc6

Please sign in to comment.