Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Parametric Sweeps and DataContainer improvements #494

Open
wants to merge 9 commits into
base: develop
Choose a base branch
from
Prev Previous commit
Next Next commit
Fix some axis doneness problems
grahamrow committed Apr 14, 2021
commit 91f23b7504e8f53a9e0864182df4f299c0ba6ad6
12 changes: 7 additions & 5 deletions src/auspex/stream.py
Original file line number Diff line number Diff line change
@@ -152,17 +152,19 @@ def update(self):
""" Update value after each run.
"""
if self.step < self.num_points():
if self.callback_func:
self.callback_func(self, self.experiment)
self.value = self.points[self.step]
if self.metadata is not None:
self.metadata_value = self.metadata[self.step]
if self.callback_func:
self.callback_func(self.value, self.experiment)
logger.debug("Sweep Axis '{}' at step {} takes value: {}.".format(self.name,
self.step,self.value))
self.step+1,self.value))
self.push()
self.step += 1
self.done = False
elif self.step == self.num_points():

if self.step == self.num_points():
logger.debug("Sweep Axis '{}' claims to be done.".format(self.name))
self.step = 0
self.done = True

@@ -263,7 +265,7 @@ def num_points(self):

def expected_num_points(self):
if len(self.axes)>0:
return reduce(lambda x,y: x*y, [len(a.original_points) for a in self.axes])
return reduce(lambda x,y: x*y, [len(a.points) for a in self.axes])
else:
return 0