microsoft / microsoft/Qcodes

SweepValues, Troubles ?

Open
#465 4 comments 0 reactions 1 assignee View on GitHub

@giulioungaretti is already working on this.

Since May 8, 2017.

bug
Dominant language
Python
Stars
459
Forks
359
Avg merge
3d 6h
Merged PRs (30d)
73

Description

Is this the behavior one wants?

from unittest import TestCase
from qcodes.instrument.parameter import ManualParameter

from qcodes.utils.validators import Numbers


class TestSweepValues(TestCase):
    def setUp(self):
        self.c0 = ManualParameter('c0', vals=Numbers(-10, 10))

    def test_slicing(self):
        c0 = self.c0
        self.assertEquals(list(c0[1:2:1]), list(c0.sweep(1,2,1)))

Run tests

>>>AssertionError: Lists differ: [1] != [1.0, 2.0]
  • The types are different (it's python so meh, but hella confusing none the less)
  • The sweep values one gets are very different

@alexcjohnson maybe it's by design (or I am sure it's by design, given the fact that it's almost clone of numpy.arange) ?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.