Skip to content

module 'scikits.odes' has no attribute 'test' #164

@Whitechapel-1888

Description

@Whitechapel-1888

I assume there's an issue with pathing but I cannot seem to fix it.

Following the guide on https://scikits-odes.readthedocs.io/en/stable/installation.html, I installed sundials 5.1.0 using the command
cmake -DLAPACK_ENABLE=ON -DSUNDIALS_INDEX_SIZE=64 ..
inside a build directory that I created in the source folder (note that I do not specify an install path such that sundials is properly installed into /usr/local/lib and /usr/local/include).
Then, I install scikits.odes via pip. I also installed nose as is mentioned in the guide.

Running od.test() however outputs

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
Cell In[2], line 1
----> 1 import scikits.odes as od; od.test()

AttributeError: module 'scikits.odes' has no attribute 'test'

Also, trying to use the solver returns an error:

import numpy as np
from scikits.odes import ode

tout = np.linspace(0, 1)
initial_values = np.array([1, 0])

omega = 6.0

def example1(t, y, ydot):
    ydot[0] = x[1]
    ydot[1] = - omega * x[0]
    pass

solver = ode('cvode', example1, old_api=False)
solution = solver.solve([0.,1.,2.], initial_values)

Output:

libsundials_cvode.so.6: cannot open shared object file: No such file or directory
libsundials_cvode.so.6: cannot open shared object file: No such file or directory

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
Cell In[5], line 1
----> 1 solver = ode('cvode', example1, old_api=False)
      2 solution = solver.solve([0.,1.,2.], initial_values)

File ~/source/miniconda3/envs/cyth/lib/python3.11/site-packages/scikits/odes/ode.py:273, in ode.__init__(self, integrator_name, eqsrhs, **options)
    272 def __init__(self, integrator_name, eqsrhs, **options):
--> 273     integrator = find_ode_integrator(integrator_name)
    274     if integrator is None:
    275         raise ValueError('No integrator name match with %s or is not available.'\
    276               %(repr(integrator_name)))

File ~/source/miniconda3/envs/cyth/lib/python3.11/site-packages/scikits/odes/ode.py:494, in find_ode_integrator(name)
    492     elif hasattr(cl, name) and re.match(name, cl.name, re.I):
    493         return cl
--> 494 raise ValueError('Integrator name %s does not exist' % name)

ValueError: Integrator name cvode does not exist

The libraries however do exist. What am I missing here?
Also, apparently the guide is out-of-date seeing that sundials 6 is supported as well. Will there be an update?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions