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

NESTML CI fails with sympy 1.11 #806

Open
pnbabu opened this issue Aug 25, 2022 · 3 comments
Open

NESTML CI fails with sympy 1.11 #806

pnbabu opened this issue Aug 25, 2022 · 3 comments
Labels

Comments

@pnbabu
Copy link
Contributor

pnbabu commented Aug 25, 2022

The CI build fails with the following error with the new sympy version 1.11

tests/nest_tests/non_linear_dendrite_test.py:63: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
pynestml/frontend/pynestml_frontend.py:215: in generate_nest_target
    generate_target(input_path, target_platform="NEST", target_path=target_path, logging_level=logging_level,
pynestml/frontend/pynestml_frontend.py:184: in generate_target
    if not process() == 0:
pynestml/frontend/pynestml_frontend.py:308: in process
    _codeGenerator.generate_code(models)
pynestml/codegeneration/nest_code_generator.py:178: in generate_code
    self.analyse_transform_neurons(neurons)
pynestml/codegeneration/nest_code_generator.py:208: in analyse_transform_neurons
    spike_updates, post_spike_updates, equations_with_delay_vars = self.analyse_neuron(neuron)
pynestml/codegeneration/nest_code_generator.py:257: in analyse_neuron
    analytic_solver, numeric_solver = self.ode_toolbox_analysis(neuron, kernel_buffers)
pynestml/codegeneration/nest_code_generator.py:677: in ode_toolbox_analysis
    solver_result = odetoolbox.analysis(odetoolbox_indict,
/opt/hostedtoolcache/Python/3.9.13/x64/lib/python3.9/site-packages/odetoolbox/__init__.py:386: in analysis
    d, _, _ = _analysis(indict,
/opt/hostedtoolcache/Python/3.9.13/x64/lib/python3.9/site-packages/odetoolbox/__init__.py:239: in _analysis
    analytic_solver_json = sub_sys.generate_propagator_solver(output_timestep_symbol=options_dict["output_timestep_symbol"])
/opt/hostedtoolcache/Python/3.9.13/x64/lib/python3.9/site-packages/odetoolbox/system_of_shapes.py:194: in generate_propagator_solver
    P = sympy.simplify(sympy.exp(self.A_ * sympy.Symbol(output_timestep_symbol)))
/opt/hostedtoolcache/Python/3.9.13/x64/lib/python3.9/site-packages/sympy/simplify/simplify.py:601: in simplify
    return _eval_simplify(**kwargs)
/opt/hostedtoolcache/Python/3.9.13/x64/lib/python3.9/site-packages/sympy/matrices/common.py:2515: in _eval_simplify
    return MatrixOperations.simplify(self, **kwargs)
/opt/hostedtoolcache/Python/3.9.13/x64/lib/python3.9/site-packages/sympy/matrices/common.py:2405: in simplify
    return self.applyfunc(lambda x: x.simplify(**kwargs))
/opt/hostedtoolcache/Python/3.9.13/x64/lib/python3.9/site-packages/sympy/matrices/common.py:2058: in applyfunc
    return self._eval_applyfunc(f)
/opt/hostedtoolcache/Python/3.9.13/x64/lib/python3.9/site-packages/sympy/matrices/common.py:2000: in _eval_applyfunc
    out = self._new(self.rows, self.cols, [f(x) for x in self])
/opt/hostedtoolcache/Python/3.9.13/x64/lib/python3.9/site-packages/sympy/matrices/common.py:2000: in <listcomp>
    out = self._new(self.rows, self.cols, [f(x) for x in self])
/opt/hostedtoolcache/Python/3.9.13/x64/lib/python3.9/site-packages/sympy/matrices/common.py:2405: in <lambda>
    return self.applyfunc(lambda x: x.simplify(**kwargs))
/opt/hostedtoolcache/Python/3.9.13/x64/lib/python3.9/site-packages/sympy/core/basic.py:1767: in simplify
    return simplify(self, **kwargs)
/opt/hostedtoolcache/Python/3.9.13/x64/lib/python3.9/site-packages/sympy/simplify/simplify.py:643: in simplify
    expr = Mul(*powsimp(expr).as_content_primitive())
/opt/hostedtoolcache/Python/3.9.13/x64/lib/python3.9/site-packages/sympy/simplify/powsimp.py:161: in powsimp
    for b, e in ordered(iter(c_powers.items())):
/opt/hostedtoolcache/Python/3.9.13/x64/lib/python3.9/site-packages/sympy/core/sorting.py:310: in ordered
    yield from value
/opt/hostedtoolcache/Python/3.9.13/x64/lib/python3.9/site-packages/sympy/core/sorting.py:310: in ordered
    yield from value
/opt/hostedtoolcache/Python/3.9.13/x64/lib/python3.9/site-packages/sympy/core/sorting.py:298: in ordered
    for k, value in sorted(d.items()):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = 1.0*C_m*tau_m - 1.0*C_m*tau_syn1 < C_m*tau_m - C_m*tau_syn1

    def __bool__(self):
>       raise TypeError("cannot determine truth value of Relational")
E       TypeError: cannot determine truth value of Relational
@pnbabu pnbabu added the CI label Aug 25, 2022
@pnbabu
Copy link
Contributor Author

pnbabu commented Aug 25, 2022

After some analysis with git bisect, the commit in sympy that is causing the error is 0ca399d.

@clinssen should we just ignore this version of the sympy and move ahead or report this to the team? I am still debugging to see which line is exactly causing the error. What do you suggest?

@pnbabu
Copy link
Contributor Author

pnbabu commented Aug 25, 2022

The error seems to be occurring in the below line where it was sorted(d.keys()) instead of sorted(d.items())
https://github.com/sympy/sympy/blob/0ca399dcb70b10169bba045dc5f1bc8b7b469000/sympy/core/sorting.py#L298

@clinssen
Copy link
Contributor

I filed an issue on the sympy repository: sympy/sympy#24045

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

No branches or pull requests

2 participants