Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Travis tests failing #302

Closed
lumip opened this issue Jul 12, 2018 · 2 comments
Closed

Travis tests failing #302

lumip opened this issue Jul 12, 2018 · 2 comments

Comments

@lumip
Copy link
Contributor

lumip commented Jul 12, 2018

The following tests are suddenly failing on travis across all branches without an apparent change to the tested functionality in question. Problems with sympy dependency?

======================================================================
ERROR: test_indexing (tests.expression_tests.ExpressionScalarTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/travis/build/qutech/qc-toolkit/qctoolkit/expressions.py", line 40, in _parse_evaluate_numeric_arguments
    return {v: eval_args[v] for v in self.variables}
  File "/home/travis/build/qutech/qc-toolkit/qctoolkit/expressions.py", line 40, in <dictcomp>
    return {v: eval_args[v] for v in self.variables}
KeyError: 'a[i]'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
  File "/home/travis/build/qutech/qc-toolkit/tests/expression_tests.py", line 137, in test_indexing
    self.assertEqual(e.evaluate_numeric(**params), 2 * 2)
  File "/home/travis/build/qutech/qc-toolkit/qctoolkit/expressions.py", line 62, in evaluate_numeric
    parsed_kwargs = self._parse_evaluate_numeric_arguments(kwargs)
  File "/home/travis/build/qutech/qc-toolkit/qctoolkit/expressions.py", line 42, in _parse_evaluate_numeric_arguments
    raise ExpressionVariableMissingException(key_error.args[0], self) from key_error
qctoolkit.expressions.ExpressionVariableMissingException: Could not evaluate <c*a[i]>: A value for variable <a[i]> is missing!
======================================================================
ERROR: test_eval_sum (tests.utils.sympy_tests.EvaluationTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/travis/build/qutech/qc-toolkit/tests/utils/sympy_tests.py", line 251, in test_eval_sum
    result = self.evaluate(expr, parameters)
  File "/home/travis/build/qutech/qc-toolkit/tests/utils/sympy_tests.py", line 226, in evaluate
    return evaluate_lambdified(expression, variables=list(variables), parameters=parameters, lambdified=None)[0]
  File "/home/travis/build/qutech/qc-toolkit/qctoolkit/utils/sympy.py", line 189, in evaluate_lambdified
    [{'ceiling': numpy_compatible_ceiling}, 'numpy'])
  File "/home/travis/miniconda3/envs/test-environment/lib/python3.5/site-packages/sympy/utilities/lambdify.py", line 462, in lambdify
    c = compile(funcstr, filename, 'exec')
  File "<lambdifygenerated-466>", line 1
    def _lambdifygenerated(a[i], a):
                            ^
SyntaxError: invalid syntax
@lumip
Copy link
Contributor Author

lumip commented Jul 12, 2018

This seems to be related with a new version of sympy (1.2) becoming available and being automatically pulled by travis during tests. The issues do not occur with sympy 1.1.1. Current solution is to fix the required sympy version to 1.1.1 in setup.py. However, for the future, these issues should probably be resolved for newer sympy versions (from 1.2 and up).

@terrorfisch
Copy link
Member

sympy changed free_symbols bahaviour for sympy.Indexed

sympy/sympy#14899

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants