Skip to content

change simpleexpression for equality handling #430

change simpleexpression for equality handling

change simpleexpression for equality handling #430

GitHub Actions / Test Results failed Jul 10, 2024 in 0s

38 errors, 23 fail, 61 skipped, 990 pass in 4m 40s

    6 files  ±0      6 suites  ±0   4m 40s ⏱️ + 2m 54s
1 112 tests ±0    990 ✅ + 6   61 💤 ±0  23 ❌  -  6  38 🔥 ±0 
4 372 runs  ±0  3 962 ✅ +24  244 💤 ±0  90 ❌  - 24  76 🔥 ±0 

Results for commit b3176f0. ± Comparison against earlier commit fc8aee4.

Annotations

Check warning on line 0 in tests.pulses.constant_pulse_template_tests.TestConstantPulseTemplate

See this annotation in the file changed.

@github-actions github-actions / Test Results

All 4 runs failed: test_ConstantPulseTemplate (tests.pulses.constant_pulse_template_tests.TestConstantPulseTemplate)

artifacts/Unit Test Results ( 3.10-fractions )/pytest.xml [took 0s]
artifacts/Unit Test Results ( 3.10-gmpy2 )/pytest.xml [took 0s]
artifacts/Unit Test Results ( 3.9-fractions )/pytest.xml [took 0s]
artifacts/Unit Test Results ( 3.9-gmpy2 )/pytest.xml [took 0s]
Raw output
AssertionError: {'P1': ExpressionScalar('50.0000000000000'), 'P2[35 chars]00')} != {'P1': 50, 'P2': 25}
+ {'P1': 50, 'P2': 25}
- {'P1': ExpressionScalar('50.0000000000000'),
-  'P2': ExpressionScalar('25.0000000000000')}
self = <tests.pulses.constant_pulse_template_tests.TestConstantPulseTemplate testMethod=test_ConstantPulseTemplate>

    def test_ConstantPulseTemplate(self):
        pt = ConstantPulseTemplate(100, {'P1': .5, 'P2': .25})
>       self.assertEqual(pt.integral, {'P1': 50, 'P2': 25})
E       AssertionError: {'P1': ExpressionScalar('50.0000000000000'), 'P2[35 chars]00')} != {'P1': 50, 'P2': 25}
E       + {'P1': 50, 'P2': 25}
E       - {'P1': ExpressionScalar('50.0000000000000'),
E       -  'P2': ExpressionScalar('25.0000000000000')}

tests/pulses/constant_pulse_template_tests.py:22: AssertionError

Check warning on line 0 in tests.pulses.constant_pulse_template_tests.ConstantPulseTemplateSerializationTests

See this annotation in the file changed.

@github-actions github-actions / Test Results

All 4 runs failed: test_legacy_deserialization (tests.pulses.constant_pulse_template_tests.ConstantPulseTemplateSerializationTests)

artifacts/Unit Test Results ( 3.10-fractions )/pytest.xml [took 0s]
artifacts/Unit Test Results ( 3.10-gmpy2 )/pytest.xml [took 0s]
artifacts/Unit Test Results ( 3.9-fractions )/pytest.xml [took 0s]
artifacts/Unit Test Results ( 3.9-gmpy2 )/pytest.xml [took 0s]
Raw output
AssertionError: ExpressionScalar(62848) != ExpressionScalar(62848.0)
self = <tests.pulses.constant_pulse_template_tests.ConstantPulseTemplateSerializationTests testMethod=test_legacy_deserialization>

    def test_legacy_deserialization(self):
        serialized = """{
            "#amplitudes": {
                "ZI0_A_MARKER_FRONT": 1
            },
            "#type": "qupulse.pulses.constant_pulse_template.ConstantPulseTemplate",
            "duration": 62848.0,
            "name": "constant_pulse"
        }"""
        backend = DictBackend()
        backend.storage['my_pt'] = serialized
    
        ps = PulseStorage(backend)
    
        deserialized = ps['my_pt']
        expected = ConstantPulseTemplate(
            amplitude_dict={"ZI0_A_MARKER_FRONT": 1},
            duration=62848, name="constant_pulse"
        )
>       self.assert_equal_instance(expected, deserialized)

tests/pulses/constant_pulse_template_tests.py:188: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/serialization_tests.py:75: in assert_equal_instance
    self.assert_equal_instance_except_id(lhs, rhs)
tests/pulses/constant_pulse_template_tests.py:167: in assert_equal_instance_except_id
    self.assertEqual(lhs.duration, rhs.duration)
tests/serialization_tests.py:63: in assertEqual
    unittest.TestCase.assertEqual(self, first, second, msg=msg)
E   AssertionError: ExpressionScalar(62848) != ExpressionScalar(62848.0)

Check warning on line 0 in tests.pulses.table_pulse_template_tests.TableEntryTest

See this annotation in the file changed.

@github-actions github-actions / Test Results

All 4 runs failed: test_sequence_integral (tests.pulses.table_pulse_template_tests.TableEntryTest)

artifacts/Unit Test Results ( 3.10-fractions )/pytest.xml [took 0s]
artifacts/Unit Test Results ( 3.10-gmpy2 )/pytest.xml [took 0s]
artifacts/Unit Test Results ( 3.9-fractions )/pytest.xml [took 0s]
artifacts/Unit Test Results ( 3.9-gmpy2 )/pytest.xml [took 0s]
Raw output
AssertionError: ExpressionScalar(0.5) != ExpressionScalar('1/2')
self = <tests.pulses.table_pulse_template_tests.TableEntryTest testMethod=test_sequence_integral>

    def test_sequence_integral(self):
        def get_sympy(v):
            return v.sympified_expression
    
        entries = [TableEntry(0, 0), TableEntry(1, 0, 'hold')]
        self.assertEqual(ExpressionScalar(0), TableEntry._sequence_integral(entries, get_sympy))
    
        entries = [TableEntry(0, 1), TableEntry(1, 1, 'hold')]
        self.assertEqual(ExpressionScalar(1), TableEntry._sequence_integral(entries, get_sympy))
    
        entries = [TableEntry(0, 0), TableEntry(1, 1, 'linear')]
>       self.assertEqual(ExpressionScalar(.5), TableEntry._sequence_integral(entries, get_sympy))
E       AssertionError: ExpressionScalar(0.5) != ExpressionScalar('1/2')

tests/pulses/table_pulse_template_tests.py:53: AssertionError

Check warning on line 0 in tests.pulses.table_pulse_template_tests.TablePulseTemplateSequencingTests

See this annotation in the file changed.

@github-actions github-actions / Test Results

All 4 runs failed: test_build_waveform_time_type (tests.pulses.table_pulse_template_tests.TablePulseTemplateSequencingTests)

artifacts/Unit Test Results ( 3.10-fractions )/pytest.xml [took 0s]
artifacts/Unit Test Results ( 3.10-gmpy2 )/pytest.xml [took 0s]
artifacts/Unit Test Results ( 3.9-fractions )/pytest.xml [took 0s]
artifacts/Unit Test Results ( 3.9-gmpy2 )/pytest.xml [took 0s]
Raw output
qupulse.expressions.NonNumericEvaluation: The result of evaluate_numeric is of type <class 'qupulse.utils.types.TimeType'> which is not a number
self = ExpressionScalar('foo')
scope = {'b': TimeType(2, 1), 'bar': TimeType(4, 1), 'foo': TimeType(11, 10), 'l': TimeType(1, 1), ...}

    def evaluate_with_exact_rationals(self, scope: Mapping) -> Union[Number, numpy.ndarray]:
        parsed_kwargs = self._parse_evaluate_numeric_arguments(scope)
        result, self._exact_rational_lambdified = evaluate_lamdified_exact_rational(self.sympified_expression,
                                                                                    self.variables,
                                                                                    parsed_kwargs,
                                                                                    self._exact_rational_lambdified)
        try:
>           return _parse_evaluate_numeric(result)

qupulse/expressions/sympy.py:453: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

result = TimeType(11, 10)

    def _parse_evaluate_numeric(result) -> Union[Number, numpy.ndarray]:
        """Tries to parse the result as a scalar if possible. Falls back to an array otherwise.
        Raises:
            ValueError if scalar result is not parsable
        """
        allowed_scalar = ALLOWED_NUMERIC_SCALAR_TYPES
    
        if isinstance(result, allowed_scalar):
            # fast path for regular evaluations
            return result
        if isinstance(result, tuple):
            result, = result
        elif isinstance(result, numpy.ndarray):
            result = result[()]
    
        if isinstance(result, allowed_scalar):
            return result
        if isinstance(result, sympy.Float):
            return float(result)
        elif isinstance(result, sympy.Integer):
            return int(result)
    
        if isinstance(result, numpy.ndarray):
            # allow numeric vector values
            return _parse_evaluate_numeric_vector(result)
>       raise ValueError("Non numeric result", result)
E       ValueError: ('Non numeric result', TimeType(11, 10))

qupulse/expressions/sympy.py:57: ValueError

The above exception was the direct cause of the following exception:

self = <tests.pulses.table_pulse_template_tests.TablePulseTemplateSequencingTests testMethod=test_build_waveform_time_type>

    def test_build_waveform_time_type(self):
        from qupulse.utils.types import TimeType
    
        table = TablePulseTemplate({0: [(0, 0),
                                        ('foo', 'v', 'linear'),
                                        ('bar', 0, 'jump')]},
                                   parameter_constraints=['foo>1'],
                                   measurements=[('M', 'b', 'l'),
                                                 ('N', 1, 2)])
    
        parameters = {'v': 2.3,
                      'foo': TimeType.from_float(1.), 'bar': TimeType.from_float(4),
                      'b': TimeType.from_float(2), 'l': TimeType.from_float(1)}
        channel_mapping = {0: 'ch'}
    
        with self.assertRaises(ParameterConstraintViolation):
            table.build_waveform(parameters=parameters,
                                 channel_mapping=channel_mapping)
    
        parameters['foo'] = TimeType.from_float(1.1)
>       waveform = table.build_waveform(parameters=parameters,
                                        channel_mapping=channel_mapping)

tests/pulses/table_pulse_template_tests.py:674: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
qupulse/pulses/table_pulse_template.py:321: in build_waveform
    for channel, instantiated_channel in self.get_entries_instantiated(parameters).items()
qupulse/pulses/table_pulse_template.py:250: in get_entries_instantiated
    instantiated = [entry.instantiate(parameters)
qupulse/pulses/table_pulse_template.py:250: in <listcomp>
    instantiated = [entry.instantiate(parameters)
qupulse/pulses/table_pulse_template.py:55: in instantiate
    return TableWaveformEntry(self.t.evaluate_with_exact_rationals(parameters),
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = ExpressionScalar('foo')
scope = {'b': TimeType(2, 1), 'bar': TimeType(4, 1), 'foo': TimeType(11, 10), 'l': TimeType(1, 1), ...}

    def evaluate_with_exact_rationals(self, scope: Mapping) -> Union[Number, numpy.ndarray]:
        parsed_kwargs = self._parse_evaluate_numeric_arguments(scope)
        result, self._exact_rational_lambdified = evaluate_lamdified_exact_rational(self.sympified_expression,
                                                                                    self.variables,
                                                                                    parsed_kwargs,
                                                                                    self._exact_rational_lambdified)
        try:
            return _parse_evaluate_numeric(result)
        except ValueError as err:
>           raise qupulse.expressions.NonNumericEvaluation(self, result, scope) from err
E           qupulse.expressions.NonNumericEvaluation: The result of evaluate_numeric is of type <class 'qupulse.utils.types.TimeType'> which is not a number

qupulse/expressions/sympy.py:455: NonNumericEvaluation

Check warning on line 0 in tests.expressions.expression_tests.ExpressionScalarTests

See this annotation in the file changed.

@github-actions github-actions / Test Results

All 4 runs failed: test_evaluate_with_exact_rationals (tests.expressions.expression_tests.ExpressionScalarTests)

artifacts/Unit Test Results ( 3.10-fractions )/pytest.xml [took 0s]
artifacts/Unit Test Results ( 3.10-gmpy2 )/pytest.xml [took 0s]
artifacts/Unit Test Results ( 3.9-fractions )/pytest.xml [took 0s]
artifacts/Unit Test Results ( 3.9-gmpy2 )/pytest.xml [took 0s]
Raw output
qupulse.expressions.NonNumericEvaluation: The result of evaluate_numeric is of type <class 'qupulse.utils.types.TimeType'> which is not a number
self = ExpressionScalar('1 / 3'), scope = {}

    def evaluate_with_exact_rationals(self, scope: Mapping) -> Union[Number, numpy.ndarray]:
        parsed_kwargs = self._parse_evaluate_numeric_arguments(scope)
        result, self._exact_rational_lambdified = evaluate_lamdified_exact_rational(self.sympified_expression,
                                                                                    self.variables,
                                                                                    parsed_kwargs,
                                                                                    self._exact_rational_lambdified)
        try:
>           return _parse_evaluate_numeric(result)

qupulse/expressions/sympy.py:453: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

result = TimeType(1, 3)

    def _parse_evaluate_numeric(result) -> Union[Number, numpy.ndarray]:
        """Tries to parse the result as a scalar if possible. Falls back to an array otherwise.
        Raises:
            ValueError if scalar result is not parsable
        """
        allowed_scalar = ALLOWED_NUMERIC_SCALAR_TYPES
    
        if isinstance(result, allowed_scalar):
            # fast path for regular evaluations
            return result
        if isinstance(result, tuple):
            result, = result
        elif isinstance(result, numpy.ndarray):
            result = result[()]
    
        if isinstance(result, allowed_scalar):
            return result
        if isinstance(result, sympy.Float):
            return float(result)
        elif isinstance(result, sympy.Integer):
            return int(result)
    
        if isinstance(result, numpy.ndarray):
            # allow numeric vector values
            return _parse_evaluate_numeric_vector(result)
>       raise ValueError("Non numeric result", result)
E       ValueError: ('Non numeric result', TimeType(1, 3))

qupulse/expressions/sympy.py:57: ValueError

The above exception was the direct cause of the following exception:

self = <tests.expressions.expression_tests.ExpressionScalarTests testMethod=test_evaluate_with_exact_rationals>

    def test_evaluate_with_exact_rationals(self):
        expr = ExpressionScalar('1 / 3')
>       self.assertEqual(TimeType.from_fraction(1, 3), expr.evaluate_with_exact_rationals({}))

tests/expressions/expression_tests.py:433: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = ExpressionScalar('1 / 3'), scope = {}

    def evaluate_with_exact_rationals(self, scope: Mapping) -> Union[Number, numpy.ndarray]:
        parsed_kwargs = self._parse_evaluate_numeric_arguments(scope)
        result, self._exact_rational_lambdified = evaluate_lamdified_exact_rational(self.sympified_expression,
                                                                                    self.variables,
                                                                                    parsed_kwargs,
                                                                                    self._exact_rational_lambdified)
        try:
            return _parse_evaluate_numeric(result)
        except ValueError as err:
>           raise qupulse.expressions.NonNumericEvaluation(self, result, scope) from err
E           qupulse.expressions.NonNumericEvaluation: The result of evaluate_numeric is of type <class 'qupulse.utils.types.TimeType'> which is not a number

qupulse/expressions/sympy.py:455: NonNumericEvaluation

Check warning on line 0 in tests.expressions.expression_tests.ExpressionScalarTests

See this annotation in the file changed.

@github-actions github-actions / Test Results

All 4 runs failed: test_is_nan (tests.expressions.expression_tests.ExpressionScalarTests)

artifacts/Unit Test Results ( 3.10-fractions )/pytest.xml [took 0s]
artifacts/Unit Test Results ( 3.10-gmpy2 )/pytest.xml [took 0s]
artifacts/Unit Test Results ( 3.9-fractions )/pytest.xml [took 0s]
artifacts/Unit Test Results ( 3.9-gmpy2 )/pytest.xml [took 0s]
Raw output
ZeroDivisionError
ValueError: Error from parse_expr with transformed code: "Float ('0.' )/Float ('0.' )"

The above exception was the direct cause of the following exception:

self = <tests.expressions.expression_tests.ExpressionScalarTests testMethod=test_is_nan>

    def test_is_nan(self):
        self.assertTrue(ExpressionScalar('nan').is_nan())
>       self.assertTrue(ExpressionScalar('0./0.').is_nan())

tests/expressions/expression_tests.py:419: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
qupulse/expressions/sympy.py:87: in __call__
    return type.__call__(cls, *args, **kwargs)
qupulse/expressions/sympy.py:313: in __init__
    self._sympified_expression = sympify(ex)
qupulse/utils/sympy.py:272: in sympify
    return sympy.sympify(expr, **kwargs, locals=sympify_namespace)
/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/site-packages/sympy/core/sympify.py:481: in sympify
    expr = parse_expr(a, local_dict=locals, transformations=transformations, evaluate=evaluate)
/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/site-packages/sympy/parsing/sympy_parser.py:1090: in parse_expr
    raise e from ValueError(f"Error from parse_expr with transformed code: {code!r}")
/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/site-packages/sympy/parsing/sympy_parser.py:1081: in parse_expr
    rv = eval_expr(code, local_dict, global_dict)
/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/site-packages/sympy/parsing/sympy_parser.py:909: in eval_expr
    expr = eval(
<string>:1: in <module>
    ???
/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/site-packages/sympy/core/decorators.py:65: in __sympifyit_wrapper
    return func(a, b)
/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/site-packages/sympy/core/numbers.py:1042: in __truediv__
    return Float._new(mlib.mpf_div(self._mpf_, rhs, prec, rnd), prec)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

s = (0, mpz(0), 0, 0), t = (0, mpz(0), 0, 0), prec = 53, rnd = 'n'

    def mpf_div(s, t, prec, rnd=round_fast):
        """Floating-point division"""
        ssign, sman, sexp, sbc = s
        tsign, tman, texp, tbc = t
        if not sman or not tman:
            if s == fzero:
>               if t == fzero: raise ZeroDivisionError
E               ZeroDivisionError

/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/site-packages/mpmath/libmp/libmpf.py:956: ZeroDivisionError

Check warning on line 0 in tests.program.linspace_tests.SingleRampTest

See this annotation in the file changed.

@github-actions github-actions / Test Results

All 4 runs failed: test_commands (tests.program.linspace_tests.SingleRampTest)

artifacts/Unit Test Results ( 3.10-fractions )/pytest.xml [took 0s]
artifacts/Unit Test Results ( 3.10-gmpy2 )/pytest.xml [took 0s]
artifacts/Unit Test Results ( 3.9-fractions )/pytest.xml [took 0s]
artifacts/Unit Test Results ( 3.9-gmpy2 )/pytest.xml [took 0s]
Raw output
TypeError: __init__() missing 1 required positional argument: 'channels'
self = <tests.program.linspace_tests.SingleRampTest testMethod=test_commands>

    def setUp(self):
        hold = ConstantPT(10 ** 6, {'a': '-1. + idx * 0.01'})
        self.pulse_template = hold.with_iteration('idx', 200)
    
        self.program = LinSpaceIter(
            length=200,
>           body=(LinSpaceHold(
                bases=(-1.,),
                factors=((0.01,),),
                duration_base=TimeType(10**6),
                duration_factors=None
            ),)
        )
E       TypeError: __init__() missing 1 required positional argument: 'channels'

tests/program/linspace_tests.py:16: TypeError

Check warning on line 0 in tests.program.linspace_tests.SingleRampTest

See this annotation in the file changed.

@github-actions github-actions / Test Results

All 4 runs failed: test_program (tests.program.linspace_tests.SingleRampTest)

artifacts/Unit Test Results ( 3.10-fractions )/pytest.xml [took 0s]
artifacts/Unit Test Results ( 3.10-gmpy2 )/pytest.xml [took 0s]
artifacts/Unit Test Results ( 3.9-fractions )/pytest.xml [took 0s]
artifacts/Unit Test Results ( 3.9-gmpy2 )/pytest.xml [took 0s]
Raw output
TypeError: __init__() missing 1 required positional argument: 'channels'
self = <tests.program.linspace_tests.SingleRampTest testMethod=test_program>

    def setUp(self):
        hold = ConstantPT(10 ** 6, {'a': '-1. + idx * 0.01'})
        self.pulse_template = hold.with_iteration('idx', 200)
    
        self.program = LinSpaceIter(
            length=200,
>           body=(LinSpaceHold(
                bases=(-1.,),
                factors=((0.01,),),
                duration_base=TimeType(10**6),
                duration_factors=None
            ),)
        )
E       TypeError: __init__() missing 1 required positional argument: 'channels'

tests/program/linspace_tests.py:16: TypeError

Check warning on line 0 in tests.program.linspace_tests.PlainCSDTest

See this annotation in the file changed.

@github-actions github-actions / Test Results

All 4 runs failed: test_increment_commands (tests.program.linspace_tests.PlainCSDTest)

artifacts/Unit Test Results ( 3.10-fractions )/pytest.xml [took 0s]
artifacts/Unit Test Results ( 3.10-gmpy2 )/pytest.xml [took 0s]
artifacts/Unit Test Results ( 3.9-fractions )/pytest.xml [took 0s]
artifacts/Unit Test Results ( 3.9-gmpy2 )/pytest.xml [took 0s]
Raw output
TypeError: __init__() missing 1 required positional argument: 'channels'
self = <tests.program.linspace_tests.PlainCSDTest testMethod=test_increment_commands>

    def setUp(self):
        hold = ConstantPT(10**6, {'a': '-1. + idx_a * 0.01', 'b': '-.5 + idx_b * 0.02'})
        scan_a = hold.with_iteration('idx_a', 200)
        self.pulse_template = scan_a.with_iteration('idx_b', 100)
    
        self.program = LinSpaceIter(length=100, body=(LinSpaceIter(
            length=200,
>           body=(LinSpaceHold(
                bases=(-1., -0.5),
                factors=((0.0, 0.01),
                         (0.02, 0.0)),
                duration_base=TimeType(10**6),
                duration_factors=None
            ),)
        ),))
E       TypeError: __init__() missing 1 required positional argument: 'channels'

tests/program/linspace_tests.py:53: TypeError

Check warning on line 0 in tests.program.linspace_tests.PlainCSDTest

See this annotation in the file changed.

@github-actions github-actions / Test Results

All 4 runs failed: test_program (tests.program.linspace_tests.PlainCSDTest)

artifacts/Unit Test Results ( 3.10-fractions )/pytest.xml [took 0s]
artifacts/Unit Test Results ( 3.10-gmpy2 )/pytest.xml [took 0s]
artifacts/Unit Test Results ( 3.9-fractions )/pytest.xml [took 0s]
artifacts/Unit Test Results ( 3.9-gmpy2 )/pytest.xml [took 0s]
Raw output
TypeError: __init__() missing 1 required positional argument: 'channels'
self = <tests.program.linspace_tests.PlainCSDTest testMethod=test_program>

    def setUp(self):
        hold = ConstantPT(10**6, {'a': '-1. + idx_a * 0.01', 'b': '-.5 + idx_b * 0.02'})
        scan_a = hold.with_iteration('idx_a', 200)
        self.pulse_template = scan_a.with_iteration('idx_b', 100)
    
        self.program = LinSpaceIter(length=100, body=(LinSpaceIter(
            length=200,
>           body=(LinSpaceHold(
                bases=(-1., -0.5),
                factors=((0.0, 0.01),
                         (0.02, 0.0)),
                duration_base=TimeType(10**6),
                duration_factors=None
            ),)
        ),))
E       TypeError: __init__() missing 1 required positional argument: 'channels'

tests/program/linspace_tests.py:53: TypeError

Check warning on line 0 in tests.program.linspace_tests.TiltedCSDTest

See this annotation in the file changed.

@github-actions github-actions / Test Results

All 4 runs failed: test_increment_commands (tests.program.linspace_tests.TiltedCSDTest)

artifacts/Unit Test Results ( 3.10-fractions )/pytest.xml [took 0s]
artifacts/Unit Test Results ( 3.10-gmpy2 )/pytest.xml [took 0s]
artifacts/Unit Test Results ( 3.9-fractions )/pytest.xml [took 0s]
artifacts/Unit Test Results ( 3.9-gmpy2 )/pytest.xml [took 0s]
Raw output
TypeError: __init__() missing 1 required positional argument: 'channels'
self = <tests.program.linspace_tests.TiltedCSDTest testMethod=test_increment_commands>

    def setUp(self):
        hold = ConstantPT(10**6, {'a': '-1. + idx_a * 0.01 + idx_b * 1e-3', 'b': '-.5 + idx_b * 0.02 - 3e-3 * idx_a'})
        scan_a = hold.with_iteration('idx_a', 200)
        self.pulse_template = scan_a.with_iteration('idx_b', 100)
        self.repeated_pt = self.pulse_template.with_repetition(42)
    
        self.program = LinSpaceIter(length=100, body=(LinSpaceIter(
            length=200,
>           body=(LinSpaceHold(
                bases=(-1., -0.5),
                factors=((1e-3, 0.01),
                         (0.02, -3e-3)),
                duration_base=TimeType(10**6),
                duration_factors=None
            ),)
        ),))
E       TypeError: __init__() missing 1 required positional argument: 'channels'

tests/program/linspace_tests.py:108: TypeError

Check warning on line 0 in tests.program.linspace_tests.TiltedCSDTest

See this annotation in the file changed.

@github-actions github-actions / Test Results

All 4 runs failed: test_program (tests.program.linspace_tests.TiltedCSDTest)

artifacts/Unit Test Results ( 3.10-fractions )/pytest.xml [took 0s]
artifacts/Unit Test Results ( 3.10-gmpy2 )/pytest.xml [took 0s]
artifacts/Unit Test Results ( 3.9-fractions )/pytest.xml [took 0s]
artifacts/Unit Test Results ( 3.9-gmpy2 )/pytest.xml [took 0s]
Raw output
TypeError: __init__() missing 1 required positional argument: 'channels'
self = <tests.program.linspace_tests.TiltedCSDTest testMethod=test_program>

    def setUp(self):
        hold = ConstantPT(10**6, {'a': '-1. + idx_a * 0.01 + idx_b * 1e-3', 'b': '-.5 + idx_b * 0.02 - 3e-3 * idx_a'})
        scan_a = hold.with_iteration('idx_a', 200)
        self.pulse_template = scan_a.with_iteration('idx_b', 100)
        self.repeated_pt = self.pulse_template.with_repetition(42)
    
        self.program = LinSpaceIter(length=100, body=(LinSpaceIter(
            length=200,
>           body=(LinSpaceHold(
                bases=(-1., -0.5),
                factors=((1e-3, 0.01),
                         (0.02, -3e-3)),
                duration_base=TimeType(10**6),
                duration_factors=None
            ),)
        ),))
E       TypeError: __init__() missing 1 required positional argument: 'channels'

tests/program/linspace_tests.py:108: TypeError

Check warning on line 0 in tests.program.linspace_tests.TiltedCSDTest

See this annotation in the file changed.

@github-actions github-actions / Test Results

All 4 runs failed: test_repeated_increment_commands (tests.program.linspace_tests.TiltedCSDTest)

artifacts/Unit Test Results ( 3.10-fractions )/pytest.xml [took 0s]
artifacts/Unit Test Results ( 3.10-gmpy2 )/pytest.xml [took 0s]
artifacts/Unit Test Results ( 3.9-fractions )/pytest.xml [took 0s]
artifacts/Unit Test Results ( 3.9-gmpy2 )/pytest.xml [took 0s]
Raw output
TypeError: __init__() missing 1 required positional argument: 'channels'
self = <tests.program.linspace_tests.TiltedCSDTest testMethod=test_repeated_increment_commands>

    def setUp(self):
        hold = ConstantPT(10**6, {'a': '-1. + idx_a * 0.01 + idx_b * 1e-3', 'b': '-.5 + idx_b * 0.02 - 3e-3 * idx_a'})
        scan_a = hold.with_iteration('idx_a', 200)
        self.pulse_template = scan_a.with_iteration('idx_b', 100)
        self.repeated_pt = self.pulse_template.with_repetition(42)
    
        self.program = LinSpaceIter(length=100, body=(LinSpaceIter(
            length=200,
>           body=(LinSpaceHold(
                bases=(-1., -0.5),
                factors=((1e-3, 0.01),
                         (0.02, -3e-3)),
                duration_base=TimeType(10**6),
                duration_factors=None
            ),)
        ),))
E       TypeError: __init__() missing 1 required positional argument: 'channels'

tests/program/linspace_tests.py:108: TypeError

Check warning on line 0 in tests.program.linspace_tests.TiltedCSDTest

See this annotation in the file changed.

@github-actions github-actions / Test Results

All 4 runs failed: test_repeated_program (tests.program.linspace_tests.TiltedCSDTest)

artifacts/Unit Test Results ( 3.10-fractions )/pytest.xml [took 0s]
artifacts/Unit Test Results ( 3.10-gmpy2 )/pytest.xml [took 0s]
artifacts/Unit Test Results ( 3.9-fractions )/pytest.xml [took 0s]
artifacts/Unit Test Results ( 3.9-gmpy2 )/pytest.xml [took 0s]
Raw output
TypeError: __init__() missing 1 required positional argument: 'channels'
self = <tests.program.linspace_tests.TiltedCSDTest testMethod=test_repeated_program>

    def setUp(self):
        hold = ConstantPT(10**6, {'a': '-1. + idx_a * 0.01 + idx_b * 1e-3', 'b': '-.5 + idx_b * 0.02 - 3e-3 * idx_a'})
        scan_a = hold.with_iteration('idx_a', 200)
        self.pulse_template = scan_a.with_iteration('idx_b', 100)
        self.repeated_pt = self.pulse_template.with_repetition(42)
    
        self.program = LinSpaceIter(length=100, body=(LinSpaceIter(
            length=200,
>           body=(LinSpaceHold(
                bases=(-1., -0.5),
                factors=((1e-3, 0.01),
                         (0.02, -3e-3)),
                duration_base=TimeType(10**6),
                duration_factors=None
            ),)
        ),))
E       TypeError: __init__() missing 1 required positional argument: 'channels'

tests/program/linspace_tests.py:108: TypeError

Check warning on line 0 in tests.program.linspace_tests.SingletLoadProcessing

See this annotation in the file changed.

@github-actions github-actions / Test Results

All 4 runs failed: test_singlet_scan_commands (tests.program.linspace_tests.SingletLoadProcessing)

artifacts/Unit Test Results ( 3.10-fractions )/pytest.xml [took 0s]
artifacts/Unit Test Results ( 3.10-gmpy2 )/pytest.xml [took 0s]
artifacts/Unit Test Results ( 3.9-fractions )/pytest.xml [took 0s]
artifacts/Unit Test Results ( 3.9-gmpy2 )/pytest.xml [took 0s]
Raw output
TypeError: __init__() missing 1 required positional argument: 'channels'
self = <tests.program.linspace_tests.SingletLoadProcessing testMethod=test_singlet_scan_commands>

    def setUp(self):
        wait = ConstantPT(10 ** 6, {'a': '-1. + idx_a * 0.01', 'b': '-.5 + idx_b * 0.02'})
        load_random = ConstantPT(10 ** 5, {'a': -.4, 'b': -.3})
        meas = ConstantPT(10 ** 5, {'a': 0.05, 'b': 0.06})
    
        singlet_scan = (load_random @ wait @ meas).with_iteration('idx_a', 200).with_iteration('idx_b', 100)
        self.pulse_template = singlet_scan
    
        self.program = LinSpaceIter(length=100, body=(LinSpaceIter(
            length=200,
            body=(
>               LinSpaceHold(bases=(-0.4, -0.3), factors=(None, None), duration_base=TimeType(10 ** 5),
                             duration_factors=None),
                LinSpaceHold(bases=(-1., -0.5),
                             factors=((0.0, 0.01),
                                      (0.02, 0.0)),
                             duration_base=TimeType(10 ** 6),
                             duration_factors=None),
                LinSpaceHold(bases=(0.05, 0.06), factors=(None, None), duration_base=TimeType(10 ** 5),
                             duration_factors=None),
            )
        ),))
E       TypeError: __init__() missing 1 required positional argument: 'channels'

tests/program/linspace_tests.py:183: TypeError

Check warning on line 0 in tests.program.linspace_tests.SingletLoadProcessing

See this annotation in the file changed.

@github-actions github-actions / Test Results

All 4 runs failed: test_singlet_scan_program (tests.program.linspace_tests.SingletLoadProcessing)

artifacts/Unit Test Results ( 3.10-fractions )/pytest.xml [took 0s]
artifacts/Unit Test Results ( 3.10-gmpy2 )/pytest.xml [took 0s]
artifacts/Unit Test Results ( 3.9-fractions )/pytest.xml [took 0s]
artifacts/Unit Test Results ( 3.9-gmpy2 )/pytest.xml [took 0s]
Raw output
TypeError: __init__() missing 1 required positional argument: 'channels'
self = <tests.program.linspace_tests.SingletLoadProcessing testMethod=test_singlet_scan_program>

    def setUp(self):
        wait = ConstantPT(10 ** 6, {'a': '-1. + idx_a * 0.01', 'b': '-.5 + idx_b * 0.02'})
        load_random = ConstantPT(10 ** 5, {'a': -.4, 'b': -.3})
        meas = ConstantPT(10 ** 5, {'a': 0.05, 'b': 0.06})
    
        singlet_scan = (load_random @ wait @ meas).with_iteration('idx_a', 200).with_iteration('idx_b', 100)
        self.pulse_template = singlet_scan
    
        self.program = LinSpaceIter(length=100, body=(LinSpaceIter(
            length=200,
            body=(
>               LinSpaceHold(bases=(-0.4, -0.3), factors=(None, None), duration_base=TimeType(10 ** 5),
                             duration_factors=None),
                LinSpaceHold(bases=(-1., -0.5),
                             factors=((0.0, 0.01),
                                      (0.02, 0.0)),
                             duration_base=TimeType(10 ** 6),
                             duration_factors=None),
                LinSpaceHold(bases=(0.05, 0.06), factors=(None, None), duration_base=TimeType(10 ** 5),
                             duration_factors=None),
            )
        ),))
E       TypeError: __init__() missing 1 required positional argument: 'channels'

tests/program/linspace_tests.py:183: TypeError

Check warning on line 0 in tests.program.linspace_tests.TransformedRampTest

See this annotation in the file changed.

@github-actions github-actions / Test Results

All 4 runs failed: test_global_trafo_program (tests.program.linspace_tests.TransformedRampTest)

artifacts/Unit Test Results ( 3.10-fractions )/pytest.xml [took 0s]
artifacts/Unit Test Results ( 3.10-gmpy2 )/pytest.xml [took 0s]
artifacts/Unit Test Results ( 3.9-fractions )/pytest.xml [took 0s]
artifacts/Unit Test Results ( 3.9-gmpy2 )/pytest.xml [took 0s]
Raw output
TypeError: __init__() missing 1 required positional argument: 'channels'
self = <tests.program.linspace_tests.TransformedRampTest testMethod=test_global_trafo_program>

    def setUp(self):
        hold = ConstantPT(10 ** 6, {'a': '-1. + idx * 0.01'})
        self.pulse_template = hold.with_iteration('idx', 200)
        self.transformation = ScalingTransformation({'a': 2.0})
    
        self.program = LinSpaceIter(
            length=200,
>           body=(LinSpaceHold(
                bases=(-2.,),
                factors=((0.02,),),
                duration_base=TimeType(10 ** 6),
                duration_factors=None
            ),)
        )
E       TypeError: __init__() missing 1 required positional argument: 'channels'

tests/program/linspace_tests.py:268: TypeError

Check warning on line 0 in tests.program.linspace_tests.TransformedRampTest

See this annotation in the file changed.

@github-actions github-actions / Test Results

All 4 runs failed: test_local_trafo_program (tests.program.linspace_tests.TransformedRampTest)

artifacts/Unit Test Results ( 3.10-fractions )/pytest.xml [took 0s]
artifacts/Unit Test Results ( 3.10-gmpy2 )/pytest.xml [took 0s]
artifacts/Unit Test Results ( 3.9-fractions )/pytest.xml [took 0s]
artifacts/Unit Test Results ( 3.9-gmpy2 )/pytest.xml [took 0s]
Raw output
TypeError: __init__() missing 1 required positional argument: 'channels'
self = <tests.program.linspace_tests.TransformedRampTest testMethod=test_local_trafo_program>

    def setUp(self):
        hold = ConstantPT(10 ** 6, {'a': '-1. + idx * 0.01'})
        self.pulse_template = hold.with_iteration('idx', 200)
        self.transformation = ScalingTransformation({'a': 2.0})
    
        self.program = LinSpaceIter(
            length=200,
>           body=(LinSpaceHold(
                bases=(-2.,),
                factors=((0.02,),),
                duration_base=TimeType(10 ** 6),
                duration_factors=None
            ),)
        )
E       TypeError: __init__() missing 1 required positional argument: 'channels'

tests/program/linspace_tests.py:268: TypeError

Check warning on line 0 in tests.program.linspace_tests.TimeSweepTest

See this annotation in the file changed.

@github-actions github-actions / Test Results

2 out of 4 runs failed: test_time_sweep_program (tests.program.linspace_tests.TimeSweepTest)

artifacts/Unit Test Results ( 3.9-fractions )/pytest.xml [took 0s]
artifacts/Unit Test Results ( 3.9-gmpy2 )/pytest.xml [took 0s]
Raw output
TypeError: Subscripted generics cannot be used with class and instance checks
self = <tests.program.linspace_tests.TimeSweepTest testMethod=test_time_sweep_program>

    def test_time_sweep_program(self):
        program_builder = LinSpaceBuilder(('a', 'b'))
        program = self.pulse_template.create_program(program_builder=program_builder)
>       commands = to_increment_commands(program)

tests/program/linspace_tests.py:308: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
qupulse/program/linspace.py:996: in to_increment_commands
    state.add_node(linspace_nodes)
qupulse/program/linspace.py:969: in add_node
    self.add_node(lin_node)
qupulse/program/linspace.py:975: in add_node
    self._add_iteration_node(node)
qupulse/program/linspace.py:873: in _add_iteration_node
    self.add_node(node.body)
qupulse/program/linspace.py:969: in add_node
    self.add_node(lin_node)
qupulse/program/linspace.py:975: in add_node
    self._add_iteration_node(node)
qupulse/program/linspace.py:873: in _add_iteration_node
    self.add_node(node.body)
qupulse/program/linspace.py:969: in add_node
    self.add_node(lin_node)
qupulse/program/linspace.py:975: in add_node
    self._add_iteration_node(node)
qupulse/program/linspace.py:873: in _add_iteration_node
    self.add_node(node.body)
qupulse/program/linspace.py:969: in add_node
    self.add_node(lin_node)
qupulse/program/linspace.py:978: in add_node
    self._add_hold_node(node)
qupulse/program/linspace.py:922: in _add_hold_node
    for ch in node.play_channels:
qupulse/program/linspace.py:185: in play_channels
    return tuple(ch for ch in self.channels if isinstance(ch,ChannelID))
qupulse/program/linspace.py:185: in <genexpr>
    return tuple(ch for ch in self.channels if isinstance(ch,ChannelID))
/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/typing.py:720: in __instancecheck__
    return self.__subclasscheck__(type(obj))
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = typing.Union[str, int], cls = <class 'str'>

    def __subclasscheck__(self, cls):
>       raise TypeError("Subscripted generics cannot be used with"
                        " class and instance checks")
E       TypeError: Subscripted generics cannot be used with class and instance checks

/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/typing.py:723: TypeError

Check warning on line 0 in tests.program.pulse_metadata_tests.PulseMetaDataTest

See this annotation in the file changed.

@github-actions github-actions / Test Results

All 4 runs failed: test_program (tests.program.pulse_metadata_tests.PulseMetaDataTest)

artifacts/Unit Test Results ( 3.10-fractions )/pytest.xml [took 0s]
artifacts/Unit Test Results ( 3.10-gmpy2 )/pytest.xml [took 0s]
artifacts/Unit Test Results ( 3.9-fractions )/pytest.xml [took 0s]
artifacts/Unit Test Results ( 3.9-gmpy2 )/pytest.xml [took 0s]
Raw output
NameError: name 'hold' is not defined
self = <tests.program.pulse_metadata_tests.PulseMetaDataTest testMethod=test_program>

    def setUp(self):
        hold_a = ConstantPT(10 ** 6, {'a': '-1. + idx * 0.01'})
        hold_b = ConstantPT(10 ** 6, {'a': '-0.2 + idx * 0.005'})
        hold_combined = SequencePT(hold_a,hold_b,identifier='hold_pt')
        hold_2 = ConstantPT(10 ** 6, {'a': '-0.5'})
        play_arbitrary = FunctionPT("tanh(a*t**2 + b*t + c) * sin(b*t + c) + cos(a*t)/2",192*1e5,channel="a")
    
>       self.pulse_template = (hold @ play_arbitrary @ hold_2).with_iteration('idx', 200)
E       NameError: name 'hold' is not defined

tests/program/pulse_metadata_tests.py:18: NameError

Check warning on line 0 in tests.utils.sympy_tests.CompiledEvaluationTest

See this annotation in the file changed.

@github-actions github-actions / Test Results

All 4 runs failed: test_eval_sum (tests.utils.sympy_tests.CompiledEvaluationTest)

artifacts/Unit Test Results ( 3.10-fractions )/pytest.xml [took 0s]
artifacts/Unit Test Results ( 3.10-gmpy2 )/pytest.xml [took 0s]
artifacts/Unit Test Results ( 3.9-fractions )/pytest.xml [took 0s]
artifacts/Unit Test Results ( 3.9-gmpy2 )/pytest.xml [took 0s]
Raw output
AssertionError: ('Compiled evaluation of Sum(a[i], (i, 0, len(a) - 1)) with {\'a\': array([1, 2, 3])} failed: PrintMethodNotImplementedError("Unsupported by <class \'sympy.printing.lambdarepr.LambdaPrinter\'>: len\\nSet the printer option \'strict\' to False in order to generate partially printed code.")', Sum(a[i], (i, 0, len(a) - 1)), {'a': array([1, 2, 3])})
self = <tests.utils.sympy_tests.CompiledEvaluationTest testMethod=test_eval_sum>
expression = Sum(a[i], (i, 0, len(a) - 1)), parameters = {'a': array([1, 2, 3])}

    def evaluate(self, expression: Union[sympy.Expr, np.ndarray], parameters):
        if isinstance(expression, np.ndarray):
            return self.evaluate(sympy.Array(expression), parameters)
    
        try:
>           result, _ = evaluate_compiled(expression, parameters, compiled=None)

tests/utils/sympy_tests.py:349: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
qupulse/utils/sympy.py:379: in evaluate_compiled
    compiled = compile(sympy.printing.lambdarepr.lambdarepr(expression),
/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/site-packages/sympy/printing/lambdarepr.py:251: in lambdarepr
    return LambdaPrinter(settings).doprint(expr)
/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/site-packages/sympy/printing/codeprinter.py:172: in doprint
    lines = self._print(expr).splitlines()
/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/site-packages/sympy/printing/printer.py:331: in _print
    return printmethod(expr, **kwargs)
/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/site-packages/sympy/printing/pycode.py:258: in _print_Sum
    loops=' '.join(loops))
/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/site-packages/sympy/printing/pycode.py:254: in <genexpr>
    b=self._print(b))
/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/site-packages/sympy/printing/printer.py:331: in _print
    return printmethod(expr, **kwargs)
/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/site-packages/sympy/printing/str.py:57: in _print_Add
    t = self._print(term)
/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/site-packages/sympy/printing/printer.py:331: in _print
    return printmethod(expr, **kwargs)
/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/site-packages/sympy/printing/codeprinter.py:461: in _print_Function
    return self._print_not_supported(expr)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <sympy.printing.lambdarepr.LambdaPrinter object at 0x7fd49d865c70>
expr = len(a)

    def _print_not_supported(self, expr):
        if self._settings.get('strict', False):
>           raise PrintMethodNotImplementedError("Unsupported by %s: %s" % (str(type(self)), str(type(expr))) + \
                             "\nSet the printer option 'strict' to False in order to generate partially printed code.")
E           sympy.printing.codeprinter.PrintMethodNotImplementedError: Unsupported by <class 'sympy.printing.lambdarepr.LambdaPrinter'>: len
E           Set the printer option 'strict' to False in order to generate partially printed code.

/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/site-packages/sympy/printing/codeprinter.py:582: PrintMethodNotImplementedError

The above exception was the direct cause of the following exception:

self = <tests.utils.sympy_tests.CompiledEvaluationTest testMethod=test_eval_sum>

    def test_eval_sum(self):
        for expr, parameters, expected in eval_sum:
>           result = self.evaluate(expr, parameters)

tests/utils/sympy_tests.py:297: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <tests.utils.sympy_tests.CompiledEvaluationTest testMethod=test_eval_sum>
expression = Sum(a[i], (i, 0, len(a) - 1)), parameters = {'a': array([1, 2, 3])}

    def evaluate(self, expression: Union[sympy.Expr, np.ndarray], parameters):
        if isinstance(expression, np.ndarray):
            return self.evaluate(sympy.Array(expression), parameters)
    
        try:
            result, _ = evaluate_compiled(expression, parameters, compiled=None)
        except Exception as err:
>           raise AssertionError(f"Compiled evaluation of {expression!r} with {parameters!r} failed: {err!r}",
                                 expression, parameters) from err
E           AssertionError: ('Compiled evaluation of Sum(a[i], (i, 0, len(a) - 1)) with {\'a\': array([1, 2, 3])} failed: PrintMethodNotImplementedError("Unsupported by <class \'sympy.printing.lambdarepr.LambdaPrinter\'>: len\\nSet the printer option \'strict\' to False in order to generate partially printed code.")', Sum(a[i], (i, 0, len(a) - 1)), {'a': array([1, 2, 3])})

tests/utils/sympy_tests.py:351: AssertionError

Check warning on line 0 in tests.utils.utils_tests.IsCloseTest

See this annotation in the file changed.

@github-actions github-actions / Test Results

All 4 runs failed: test_isclose_fallback (tests.utils.utils_tests.IsCloseTest)

artifacts/Unit Test Results ( 3.10-fractions )/pytest.xml [took 0s]
artifacts/Unit Test Results ( 3.10-gmpy2 )/pytest.xml [took 0s]
artifacts/Unit Test Results ( 3.9-fractions )/pytest.xml [took 0s]
artifacts/Unit Test Results ( 3.9-gmpy2 )/pytest.xml [took 0s]
Raw output
AssertionError: <function checked_is_close at 0x7fd4ad07f3a0> is not <function _fallback_is_close at 0x7fd49dad93a0>
self = <tests.utils.utils_tests.IsCloseTest testMethod=test_isclose_fallback>

    def test_isclose_fallback(self):
        import math
        import importlib
        import builtins
        import qupulse.utils as qutils
    
        def dummy_is_close():
            pass
    
        if hasattr(math, 'isclose'):
            dummy_is_close = math.isclose
    
        original_import = builtins.__import__
    
        def mock_import_missing_isclose(name, globals=None, locals=None, fromlist=(), level=0):
            if name == 'math' and 'isclose' in fromlist:
                raise ImportError(name)
            else:
                return original_import(name, globals=globals, locals=locals, fromlist=fromlist, level=level)
    
        def mock_import_exsiting_isclose(name, globals=None, locals=None, fromlist=(), level=0):
            if name == 'math' and 'isclose' in fromlist:
                if not hasattr(math, 'isclose'):
                    math.isclose = dummy_is_close
                return math
            else:
                return original_import(name, globals=globals, locals=locals, fromlist=fromlist, level=level)
    
        with mock.patch('builtins.__import__', mock_import_missing_isclose):
            reloaded_qutils = importlib.reload(qutils)
>           self.assertIs(reloaded_qutils.isclose, reloaded_qutils._fallback_is_close)
E           AssertionError: <function checked_is_close at 0x7fd4ad07f3a0> is not <function _fallback_is_close at 0x7fd49dad93a0>

tests/utils/utils_tests.py:76: AssertionError

Check warning on line 0 in tests.utils.utils_tests.ToNextMultipleTests

See this annotation in the file changed.

@github-actions github-actions / Test Results

All 4 runs failed: test_to_next_multiple (tests.utils.utils_tests.ToNextMultipleTests)

artifacts/Unit Test Results ( 3.10-fractions )/pytest.xml [took 0s]
artifacts/Unit Test Results ( 3.10-gmpy2 )/pytest.xml [took 0s]
artifacts/Unit Test Results ( 3.9-fractions )/pytest.xml [took 0s]
artifacts/Unit Test Results ( 3.9-gmpy2 )/pytest.xml [took 0s]
Raw output
AssertionError: ExpressionScalar('16/(1.00000000000000)*M[74 chars]1))') != 6185248
self = <tests.utils.utils_tests.ToNextMultipleTests testMethod=test_to_next_multiple>

    def test_to_next_multiple(self):
        from qupulse.utils.types import TimeType
        from qupulse.expressions import ExpressionScalar
    
        duration = TimeType.from_float(47.1415926535)
        evaluated = to_next_multiple(sample_rate=TimeType.from_float(2.4),quantum=16)(duration)
        expected = ExpressionScalar('160/3')
        self.assertEqual(evaluated, expected)
    
        duration = TimeType.from_float(3.1415926535)
        evaluated = to_next_multiple(sample_rate=TimeType.from_float(2.4),quantum=16,min_quanta=13)(duration)
        expected = ExpressionScalar('260/3')
        self.assertEqual(evaluated, expected)
    
        duration = 6185240.0000001
        evaluated = to_next_multiple(sample_rate=1.0,quantum=16,min_quanta=13)(duration)
        expected = 6185248
>       self.assertEqual(evaluated, expected)
E       AssertionError: ExpressionScalar('16/(1.00000000000000)*M[74 chars]1))') != 6185248

tests/utils/utils_tests.py:125: AssertionError

Check failure on line 0 in /

See this annotation in the file changed.

@github-actions github-actions / Test Results

All 2 runs with error: tests.pulses.abstract_pulse_template_tests

artifacts/Unit Test Results ( 3.8-fractions )/pytest.xml [took 0s]
artifacts/Unit Test Results ( 3.8-gmpy2 )/pytest.xml [took 0s]
Raw output
collection failure
tests/pulses/abstract_pulse_template_tests.py:5: in <module>
    from qupulse.expressions import ExpressionScalar
qupulse/__init__.py:10: in <module>
    from qupulse import pulses
<frozen importlib._bootstrap>:1039: in _handle_fromlist
    ???
/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/lazy_loader/__init__.py:79: in __getattr__
    return importlib.import_module(f"{package_name}.{name}")
/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
qupulse/pulses/__init__.py:6: in <module>
    from qupulse.pulses.abstract_pulse_template import AbstractPulseTemplate as AbstractPT
qupulse/pulses/abstract_pulse_template.py:8: in <module>
    from qupulse.pulses.pulse_template import PulseTemplate
qupulse/pulses/pulse_template.py:23: in <module>
    from qupulse.program.loop import Loop, to_waveform
qupulse/program/__init__.py:26: in <module>
    class ProgramBuilder(Protocol):
qupulse/program/__init__.py:74: in ProgramBuilder
    def evaluate_nested_stepping(self, scope: Scope, parameter_names: set[str]) -> bool:
E   TypeError: 'type' object is not subscriptable

Check failure on line 0 in /

See this annotation in the file changed.

@github-actions github-actions / Test Results

All 2 runs with error: tests.pulses.arithmetic_pulse_template_tests

artifacts/Unit Test Results ( 3.8-fractions )/pytest.xml [took 0s]
artifacts/Unit Test Results ( 3.8-gmpy2 )/pytest.xml [took 0s]
Raw output
collection failure
tests/pulses/arithmetic_pulse_template_tests.py:10: in <module>
    from qupulse.pulses import ConstantPT
qupulse/__init__.py:10: in <module>
    from qupulse import pulses
<frozen importlib._bootstrap>:1039: in _handle_fromlist
    ???
/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/lazy_loader/__init__.py:79: in __getattr__
    return importlib.import_module(f"{package_name}.{name}")
/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
qupulse/pulses/__init__.py:6: in <module>
    from qupulse.pulses.abstract_pulse_template import AbstractPulseTemplate as AbstractPT
qupulse/pulses/abstract_pulse_template.py:8: in <module>
    from qupulse.pulses.pulse_template import PulseTemplate
qupulse/pulses/pulse_template.py:23: in <module>
    from qupulse.program.loop import Loop, to_waveform
qupulse/program/__init__.py:26: in <module>
    class ProgramBuilder(Protocol):
qupulse/program/__init__.py:74: in ProgramBuilder
    def evaluate_nested_stepping(self, scope: Scope, parameter_names: set[str]) -> bool:
E   TypeError: 'type' object is not subscriptable