kpeeters / cadabra2

A field-theory motivated approach to computer algebra.
https://cadabra.science/
GNU General Public License v3.0
216 stars 37 forks source link

Troubles running the `sympy_examples` from the repository #152

Closed Doxdrum closed 5 years ago

Doxdrum commented 5 years ago

Using the latest release Version 2.2.7 (build 2103.85385ff298 dated 2019-05-08) I try to run the sympy_examples.cnb notebook provided in the examples folder, and I rum into troubles: the prompt keeps jumping to lines it should not, and the calculations were freeze, and so on.

Q1: Can someone reproduce this behaviour?

I decided then to start a copy of the cnb from the scratch (because I suspect that the problems are caused by a flaw in the code of the notebook (the introduction of a weird cell or something similar). My notebook runs OK, but it fails to solve algebraic equations with imaginary roots (see the files sympy_examples.pdf and sympy_examples.txt)

Q2: Can you reproduce my results?

Q3: What is the problem with the codes (mine and the one in the repository)?

kpeeters commented 5 years ago

I can reproduce this, and I think I know what causes this. Give me an hour to sort this out.

kpeeters commented 5 years ago

If you want a quick workaround, do

sed -i -e '/cell_id/d' sympy_examples.cnb

The problem is that this is an old notebook in which the cell id's are broken. The line above removes them and forces cadabra to re-label the cells.

kpeeters commented 5 years ago

I have fixed that notebook (as well as the 'plotting' notebook) by fixing the cell_ids. We have switched to a new system in which cell ids are essentially uuids, so that you can compare two versions of a notebook and get sensible results even when cells are moved around or removed.

The other but (with roots not working) had to do with the display function, which did not work correctly when displaying lists of sympy expressions. Now fixed as well.

Doxdrum commented 5 years ago

Thank you Kasper! Excellent job, as usual!