kpeeters / cadabra2

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

components ctest fails #122

Closed StewMH closed 5 years ago

StewMH commented 5 years ago

Hi, While going through the JOSS review I ran the unit tests after installation (Ubuntu 16.04, GCC).

The components ctest fails:

ctest -R components --output-on-failure
    Start 24: components
1/1 Test #24: components .......................***Failed   10.63 sec
Found single term in {\partial}  (4 0x2f1f330)
  1:    _{t}  (4 0x2f0e560)
  2:    {f}  (4 0x2de5080)

Found single term in {\partial}  (4 0x2f1f330)
  1:    _{t}  (4 0x2f0e560)
  2:    {f}  (4 0x2de5080)

Found single term in {\partial}  (4 0x30346a0)
  1:    _{x}  (4 0x2f7af80)
  2:    {f}  (4 0x30346f0)

Found single term in {\partial}  (4 0x30346a0)
  1:    _{x}  (4 0x2f7af80)
  2:    {f}  (4 0x30346f0)

Found single term in {\partial}  (4 0x2dd61b0)
  1:    _{z}  (4 0x2ea0b50)
  2:    {f}  (4 0x2dd6200)

Found single term in {\partial}  (4 0x2dd61b0)
  1:    _{z}  (4 0x2ea0b50)
  2:    {f}  (4 0x2dd6200)

Found single term in {\partial}  (4 0x2fe0980)
  1:    _{x}  (4 0x2f8dae0)
  2:    _{t}  (4 0x2fe0c90)
  3:    {f}  (4 0x2fe0a20)

Found single term in {\partial}  (4 0x2fe0980)
  1:    _{x}  (4 0x2f8dae0)
  2:    _{t}  (4 0x2fe0c90)
  3:    {f}  (4 0x2fe0a20)

Found single term in {\partial}  (4 0x2dd18b0)
  1:    _{y}  (4 0x2f732b0)
  2:    _{x}  (4 0x2f73260)
  3:    {f}  (4 0x2dd1900)

Found single term in {\partial}  (4 0x2dd18b0)
  1:    _{y}  (4 0x2f732b0)
  2:    _{x}  (4 0x2f73260)
  3:    {f}  (4 0x2dd1900)

Found single term in {\partial}  (4 0x2e7b290)
  1:    _{z}  (4 0x2b787e0)
  2:    _{x}  (4 0x2b78790)
  3:    {f}  (4 0x2e7b2e0)

Found single term in {\partial}  (4 0x2e7b290)
  1:    _{z}  (4 0x2b787e0)
  2:    _{x}  (4 0x2b78790)
  3:    {f}  (4 0x2e7b2e0)

scalar_backend_t.sympy
Test 01 passed
Test 02 passed
Test 03a passed
Test 03b passed
Test 03 passed
Test 04 passed
Test 05 passed
Test 06 passed
Test 07 passed
Test 08 passed
Test 09 passed
Test 10 passed
Test 11 passed
Test 12 passed
Test 14 passed
Test 15 passed
Traceback (most recent call last):
  File "/home/smh/cadabra2/core/cadabra2", line 248, in <module>
    exec(cmp)
  File "/home/smh/cadabra2/tests/components.cdb", line 301, in <module>
    ex:= F^{\mu\nu} \partial_{\mu \nu}{ f };
  File "/home/smh/cadabra2/tests/components.cdb", line 296, in test16
    __cdbkernel__=create_scope()
RuntimeError: Free indices in different terms in a sum do not match.

0% tests passed, 1 tests failed out of 1

Total Test time (real) =  10.63 sec

The following tests FAILED:
     24 - components (Failed)
Errors while running CTest

This is with 8a41782567d6a5b6f33af93a389cb329a10d53e8.

Cheers,

Stewart

kpeeters commented 5 years ago

I have pushed a fix (tested on 16.04), can you please try again?

StewMH commented 5 years ago

Hi,

This still fails for me, unfortunately.

Cheers,

Stewart

StewMH commented 5 years ago

Hi,

I can reproduce this in an Ubuntu build under Docker, which seems to rule out issues with my environment:

docker run -it stewartmh/cadabra2-build:latest
cd cadabra2/build
ctest

This Docker container could form a decent basis for future CI - you can certainly run Travis with a Docker container but I don't know the details.

Dockerfile that I built from: https://github.com/StewMH/cadabra2-build/blob/master/Dockerfile

Cheers,

Stewart

kpeeters commented 5 years ago

Ok, have reproduced this now on a clean 16.04 install, will try to fix tomorrow.

kpeeters commented 5 years ago

This turned out to be caused by newer versions of sympy writing multiple derivatives as Derivative(f(x), (x,2)) instead of Derivative(f(x),x,x). I have pushed a fix for this which solves this.