Skip to content

Commit 95c577a

Browse files
rsbrosti-am-mounce
authored andcommitted
chore: fixing error causing build and tests to fail.
1 parent afab09b commit 95c577a

File tree

3 files changed

+13
-9
lines changed

3 files changed

+13
-9
lines changed

pyscan/measurement/abstract_experiment.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -293,8 +293,8 @@ class MetaSweep(AbstractExperiment):
293293
'''
294294
Present for backwards compatibility. Renamed to :class:`.AbstractExperiment`.
295295
'''
296-
297-
warning_msg = ("Use of legacy nomenclature detected but no longer supported.\n"
298-
+ "You entered MetaSweep, use AbstractExperiment instead.")
299-
raise DeprecationWarning(f"\033[93m*** WARNING! ***: {warning_msg} \033[0m")
300-
assert False, f"\033[93m*** WARNING! ***: {warning_msg} \033[0m"
296+
def __init__(self, runinfo, devices, data_dir):
297+
warning_msg = ("Use of legacy nomenclature detected but no longer supported.\n"
298+
+ "You entered MetaSweep, use AbstractExperiment instead.")
299+
raise DeprecationWarning(f"\033[93m*** WARNING! ***: {warning_msg} \033[0m")
300+
assert False, f"\033[93m*** WARNING! ***: {warning_msg} \033[0m"

pyscan/measurement/experiment.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,8 @@ class Sweep(Experiment):
272272
Present for backwards compatibility. Renamed to :class:`.Experiment`.
273273
'''
274274

275-
warning_msg = ("Use of legacy nomenclature detected but no longer supported.\n"
276-
+ "You entered Sweep, use Experiment instead.")
277-
raise DeprecationWarning(f"\033[93m*** WARNING! ***: {warning_msg} \033[0m")
278-
assert False, f"\033[93m*** WARNING! ***: {warning_msg} \033[0m"
275+
def __init__(self, runinfo, devices, data_dir=None, verbose=False, time=False):
276+
warning_msg = ("Use of legacy nomenclature detected but no longer supported.\n"
277+
+ "You entered Sweep, use Experiment instead.")
278+
raise DeprecationWarning(f"\033[93m*** WARNING! ***: {warning_msg} \033[0m")
279+
assert False, f"\033[93m*** WARNING! ***: {warning_msg} \033[0m"

test/legacy/test_legacy.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,6 @@ def test_legacy():
1919
with pytest.raises(Exception):
2020
sweep = ps.Sweep(runinfo, devices)
2121
assert isinstance(sweep, ps.Experiment)
22+
with pytest.raises(Exception):
23+
metasweep = ps.MetaSweep(runinfo, devices, None)
24+
assert isinstance(metasweep, ps.AbstractExperiment)

0 commit comments

Comments
 (0)