镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Qcodes.Task #61

Closed
Closed

Description

@damazter

When I run my simulation with the following loop:

experiment = qcodes.Loop(system.L[10:100:1], delay=0).each(
    system.build, 
    qcodes.Loop(system.parameters["energy"][0:1:0.1], delay=0)
)

I get the error

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-25-ccd2d38d651b> in <module>()
----> 1 data = experiment.run(background=False, location='testsweep', overwrite=True, data_manager=False)

d:\damaz\pycharm\qcodes\qcodes\loops.py in run(self, background, use_async, enqueue, quiet, data_manager, **kwargs)
    446             self.data_set.mode = DataMode.PULL_FROM_SERVER
    447         else:
--> 448             loop_fn()
    449             self.data_set.read()
    450 

d:\damaz\pycharm\qcodes\qcodes\loops.py in _run_wrapper(self, *args, **kwargs)
    486     def _run_wrapper(self, *args, **kwargs):
    487         try:
--> 488             self._run_loop(*args, **kwargs)
    489         finally:
    490             if(hasattr(self, 'data_set') and hasattr(self.data_set, 'close')):

d:\damaz\pycharm\qcodes\qcodes\loops.py in _run_loop(self, first_delay, action_indices, loop_indices, current_values, **ignore_kwargs)
    526                 f(first_delay=delay,
    527                   loop_indices=new_indices,
--> 528                   current_values=new_values)
    529 
    530                 # after the first action, no delay is inherited

TypeError: build() got an unexpected keyword argument 'first_delay'

If I run the code with

experiment = qcodes.Loop(system.L[10:100:1], delay=0).each(
    qcodes.Task(system.build), 
    qcodes.Loop(system.parameters["energy"][0:1:0.1], delay=0)
)

it works fine. I feel that the syntax without the Task method is nicer, but it seems to require that my build is able to receive arbitrary arguments. Although this is easy to achieve, it also feels unnecessary. But I don't know how you all think about that.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions