Skip to content

Commit

Permalink
Fix issue in fixtures
Browse files Browse the repository at this point in the history
  • Loading branch information
jenshnielsen committed Feb 3, 2024
1 parent 8efe93b commit 324290b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
12 changes: 7 additions & 5 deletions src/qcodes/tests/dataset/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -593,16 +593,18 @@ def __init__(self, name, instrument, **kwargs):
self.start = 0
self.stop = 2e6

class Spectrum(BaseSpectrum):

def get_raw(self):
def get_data(self):
# This is how it should be: the setpoints are generated at the
# time we get. But that will of course not work with the old Loop
self.setpoints = (tuple(np.linspace(self.start, self.stop,
self.npts)),)
# not the best SA on the market; it just returns noise...
return np.random.randn(self.npts)

class Spectrum(BaseSpectrum):
def get_raw(self):
return super().get_data()

class MultiDimSpectrum(ArrayParameter):

def __init__(self, name, instrument, **kwargs):
Expand Down Expand Up @@ -635,13 +637,13 @@ def get_raw(self):
class ListSpectrum(BaseSpectrum):

def get_raw(self):
output = super().get_raw()
output = super().get_data()
return list(output)

class TupleSpectrum(BaseSpectrum):

def get_raw(self):
output = super().get_raw()
output = super().get_data()
return tuple(output)

SA = DummyInstrument('dummy_SA')
Expand Down
12 changes: 7 additions & 5 deletions tests/dataset/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -592,16 +592,18 @@ def __init__(self, name, instrument, **kwargs):
self.start = 0
self.stop = 2e6

class Spectrum(BaseSpectrum):

def get_raw(self):
def get_data(self):
# This is how it should be: the setpoints are generated at the
# time we get. But that will of course not work with the old Loop
self.setpoints = (tuple(np.linspace(self.start, self.stop,
self.npts)),)
# not the best SA on the market; it just returns noise...
return np.random.randn(self.npts)

class Spectrum(BaseSpectrum):
def get_raw(self):
return super().get_data()

class MultiDimSpectrum(ArrayParameter):

def __init__(self, name, instrument, **kwargs):
Expand Down Expand Up @@ -634,13 +636,13 @@ def get_raw(self):
class ListSpectrum(BaseSpectrum):

def get_raw(self):
output = super().get_raw()
output = super().get_data()
return list(output)

class TupleSpectrum(BaseSpectrum):

def get_raw(self):
output = super().get_raw()
output = super().get_data()
return tuple(output)

SA = DummyInstrument('dummy_SA')
Expand Down

0 comments on commit 324290b

Please sign in to comment.