[Debian-med-packaging] Bug#1078394: Bug#1078394: brian: FTBFS: test failed
Étienne Mollier
emollier at debian.org
Sun Aug 11 08:25:56 BST 2024
Control: forwarded -1 https://github.com/brian-team/brian2/pull/1553
Control: tags -1 + patch
The relevant error is:
> _____________________ test_automatic_augmented_assignments _____________________
>
> @pytest.mark.codegen_independent
> def test_automatic_augmented_assignments():
> # We test that statements that could be rewritten as augmented assignments
> # are correctly rewritten (using sympy to test for symbolic equality)
> variables = {
> "x": ArrayVariable("x", owner=None, size=10, device=device),
> "y": ArrayVariable("y", owner=None, size=10, device=device),
> "z": ArrayVariable("y", owner=None, size=10, device=device),
> "b": ArrayVariable("b", owner=None, size=10, dtype=bool, device=device),
> "clip": DEFAULT_FUNCTIONS["clip"],
> "inf": DEFAULT_CONSTANTS["inf"],
> }
> statements = [
> # examples that should be rewritten
> # Note that using our approach, we will never get -= or /= but always
> # the equivalent += or *= statements
> ("x = x + 1.0", "x += 1.0"),
> ("x = 2.0 * x", "x *= 2.0"),
> ("x = x - 3.0", "x += -3.0"),
> ("x = x/2.0", "x *= 0.5"),
> ("x = y + (x + 1.0)", "x += y + 1.0"),
> ("x = x + x", "x *= 2.0"),
> ("x = x + y + z", "x += y + z"),
> ("x = x + y + z", "x += y + z"),
> # examples that should not be rewritten
> ("x = 1.0/x", "x = 1.0/x"),
> ("x = 1.0", "x = 1.0"),
> ("x = 2.0*(x + 1.0)", "x = 2.0*(x + 1.0)"),
> ("x = clip(x + y, 0.0, inf)", "x = clip(x + y, 0.0, inf)"),
> ("b = b or False", "b = b or False"),
> ]
> for orig, rewritten in statements:
> scalar, vector = make_statements(orig, variables, np.float32)
> try: # we augment the assertion error with the original statement
> assert (
> len(scalar) == 0
> ), f"Did not expect any scalar statements but got {str(scalar)}"
> assert (
> len(vector) == 1
> ), f"Did expect a single statement but got {str(vector)}"
> statement = vector[0]
> expected_var, expected_op, expected_expr, _ = parse_statement(rewritten)
> assert (
> expected_var == statement.var
> ), f"expected write to variable {expected_var}, not to {statement.var}"
> assert (
> expected_op == statement.op
> ), f"expected operation {expected_op}, not {statement.op}"
> # Compare the two expressions using sympy to allow for different order etc.
> sympy_expected = str_to_sympy(expected_expr)
> sympy_actual = str_to_sympy(statement.expr)
> > assert sympy_expected == sympy_actual, (
> f"RHS expressions '{sympy_to_str(sympy_expected)}' and"
> f" '{sympy_to_str(sympy_actual)}' are not identical"
> )
> E AssertionError: RHS expressions '2.00000000000000' and '2' are not identical
> E assert 2.00000000000000 == 2
This is apparently related to the newer sympy version 1.13.0.
I'm packaging the latest upstream release and will also include
the patch to fix the test failure.
Have a nice day, :)
--
.''`. Étienne Mollier <emollier at debian.org>
: :' : pgp: 8f91 b227 c7d6 f2b1 948c 8236 793c f67e 8f0d 11da
`. `' sent from /dev/pts/0, please excuse my verbosity
`- on air: Various Artists - Space Truckin'
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/debian-med-packaging/attachments/20240811/b9f34a14/attachment.sig>
More information about the Debian-med-packaging
mailing list