modelon-community / Assimulo

Assimulo is a simulation package for solving ordinary differential equations.
https://jmodelica.org/assimulo/index.html
GNU Lesser General Public License v3.0
66 stars 16 forks source link

Add CI script #39

Closed jschueller closed 1 year ago

jschueller commented 1 year ago

This allows running tests automatically. Seems many fail atm.

modelonrobinandersson commented 1 year ago

@jschueller can you show what kind of errors you get? When I run the tests they all pass.

jschueller commented 1 year ago

Perhaps its a different sundials version ? Maybe we can merge this so we will see the exact error message.

jschueller commented 1 year ago

actually it is only 1 error:

............................................................../tmp/assimulo/tests/solvers/test_radau5.py:779: RuntimeWarning: invalid value encountered in double_scalars
  yd_1 = my*((1.-y[0]**2)*y[1]-y[0])
..............EXIT OF RADAU5 AT X = 5.621844e-01 
MORE THAN NMAX = 9 STEPS ARE NEEDEDEXIT OF RADAU5 AT X = 0.000000e+00 
REPEATEDLY UNEXPECTED STEP REJECTIONS
EXIT OF RADAU5 AT X = 9.000000e-01 
STEP SIZE TOO SMALL, H= 7.105427e-16 EXIT OF RADAU5 AT X=        0.5622E+00
  MORE THAN NMAX =           9 STEPS ARE NEEDED
. EXIT OF RADAU5 AT X=        0.0000E+00
  REPEATEDLY UNEXPECTED STEP REJECTIONS
...../tmp/assimulo/tests/solvers/test_radau5.py:389: RuntimeWarning: invalid value encountered in double_scalars
  yd_1 = my*((1.-y[0]**2)*y[1]-y[0])
. EXIT OF RADAU5 AT X=        0.9000E+00
  STEP SIZE T0O SMALL, H=   7.1054273576010023E-016
..................................EXIT OF RADAU5 AT X = 1.421872e-01 
MORE THAN NMAX = 9 STEPS ARE NEEDEDEXIT OF RADAU5 AT X = 1.000000e+00 
STEP SIZE TOO SMALL, H= 1.110223e-16 EXIT OF RADAU5 AT X=        0.1422E+00
  MORE THAN NMAX =           9 STEPS ARE NEEDED
..... EXIT OF RADAU5 AT X=        0.1000E+01
  STEP SIZE T0O SMALL, H=   1.1102230246251565E-016
.............................................
[CVODES ERROR]  CVodeGetCurrentOrder
  cvode_mem = NULL illegal.

.
[CVODES ERROR]  CVodeGetErrWeights
  cvode_mem = NULL illegal.

.
[CVODES ERROR]  CVodeGetLastOrder
  cvode_mem = NULL illegal.

.
[CVODES ERROR]  CVodeGetEstLocalErrors
  cvode_mem = NULL illegal.

.....................................................................................E......................................
======================================================================
ERROR: This tests the class Mechanical_system together with ind3 and ida
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/tmp/assimulo/tests/test_examples.py", line 205, in test_mech_system_pendulum3
    mech_system_pendulum.run_example('ind3',with_plots=False,with_test=True)
  File "/root/.local/lib/python3.10/site-packages/Assimulo-trunk-py3.10-linux-x86_64.egg/assimulo/examples/mech_system_pendulum.py", line 60, in run_example
    t,y,yd=dae_pend.simulate(10.,100)
  File "assimulo/ode.pyx", line 180, in assimulo.ode.ODE.simulate
  File "assimulo/ode.pyx", line 300, in assimulo.ode.ODE.simulate
  File "assimulo/implicit_ode.pyx", line 129, in assimulo.implicit_ode.Implicit_ODE._simulate
  File "assimulo/implicit_ode.pyx", line 207, in assimulo.implicit_ode.Implicit_ODE._simulate
  File "assimulo/solvers/sundials.pyx", line 478, in assimulo.solvers.sundials.IDA.integrate
  File "assimulo/solvers/sundials.pyx", line 547, in assimulo.solvers.sundials.IDA.integrate
assimulo.solvers.sundials.IDAError: 'The solver took max internal steps but could not reach tout. At time 0.000087.'

----------------------------------------------------------------------
Ran 294 tests in 20.353s

FAILED (errors=1)
jschueller commented 1 year ago

@modelonrobinandersson which sundials version do you use ?

modelonrobinandersson commented 1 year ago

@modelonrobinandersson which sundials version do you use ? Sundials 2.7.0

jschueller commented 1 year ago

@modelonrobinandersson ok, indeed everything works with sundials 2.7

jschueller commented 1 year ago

@PeterMeisrimelModelon could you merge this one too ?

PeterMeisrimelModelon commented 1 year ago

We are currently looking into making the necessary setup on our side, but are in principle positive on merging this.

jschueller commented 1 year ago

do you have an internal ci server ?

PeterMeisrimelModelon commented 1 year ago

Yes, we do.

jschueller commented 1 year ago

so I guess it shouldnt clash with github actions continuous integration here, right ?

jschueller commented 1 year ago

ping @PeterMeisrimelModelon

PeterMeisrimelModelon commented 1 year ago

Unfortunately still waiting for an OK from our IT on this one, I want to merge this asap once we got it.

PeterMeisrimelModelon commented 1 year ago

Finally got this sorted out, apologies that this took so long.