Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • adaptive adaptive
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 36
    • Issues 36
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 5
    • Merge requests 5
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Quantum TinkererQuantum Tinkerer
  • adaptiveadaptive
  • Issues
  • #58
Closed
Open
Issue created May 28, 2018 by Adriaan@AdriaanRol

2D learner specifies a 1D point causing 2D learner to fail

This test was picked up by my online test builds for PycQED (https://travis-ci.org/DiCarloLab-Delft/PycQED_py3) and then reproduced locally.

The problem did not occur in the 0.4.0dev release with latest commit 65ca5f7b63ab387b3e. It does occur in the 0.4.0 version on PyPi.

It is not clear to me what changed at this point or what exactly is going on. Below is the traceback of my (failing test) that was working with the previous version. All the test tests is if a simple wrapping around the adaptive package works correctly.

====================================================== FAILURES ======================================================
___________________________________ Test_MeasurementControl.test_adaptive_sampling ___________________________________

self = <pycqed.tests.test_MeasurementControl.Test_MeasurementControl testMethod=test_adaptive_sampling>

    def test_adaptive_sampling(self):
        self.MC.soft_avg(1)
        self.mock_parabola.noise(0)
        self.MC.set_sweep_functions(
            [self.mock_parabola.x, self.mock_parabola.y])
        self.MC.set_adaptive_function_parameters({'adaptive_function': adaptive.Learner2D,
                                     'goal':lambda l: l.npoints>20*20,
                                     'bounds':((-50, +50),
                                               (-20, +30))})
        self.MC.set_detector_function(self.mock_parabola.parabola)
>       dat = self.MC.run('2D adaptive sampling test', mode='adaptive')

pycqed/tests/test_MeasurementControl.py:570:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pycqed/measurement/measurement_control.py:201: in run
    self.measure_soft_adaptive()
pycqed/measurement/measurement_control.py:301: in measure_soft_adaptive
    goal=self.af_pars['goal'])
../../../anaconda/lib/python3.6/site-packages/adaptive/runner.py:435: in simple
    learner.tell(x, y)
../../../anaconda/lib/python3.6/site-packages/adaptive/learner/base_learner.py:40: in tell
    self._tell(x, y)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <adaptive.learner.learner2D.Learner2D object at 0x1c25b5aa58>, point = -50, value = 2900.0000012161895

    def _tell(self, point, value):
>       point = tuple(point)
E       TypeError: 'int' object is not iterable

../../../anaconda/lib/python3.6/site-packages/adaptive/learner/learner2D.py:291: TypeError
------------------------------------------------ Captured stdout call ------------------------------------------------
Starting measurement: 2D adaptive sampling test
Sweep function 0: x
Sweep function 1: y
Detector function: parabola
Acquired 1 points, 	elapsed time: 3.6s
------------------------------------------------- Captured log call --------------------------------------------------
Assignee
Assign to
Time tracking