Skip to content

Commit

Permalink
fixing the imports; work in progress
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterMeisrimelModelon committed Jan 11, 2024
1 parent 0ae189d commit 5b8324b
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 21 deletions.
2 changes: 0 additions & 2 deletions src/constants.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ NORMAL = WARNING
LOUD = INFO
SCREAM = DEBUG


DEF ID_OK = 0
DEF ID_DISCARD = 1
DEF ID_EVENT = 2
Expand All @@ -57,4 +56,3 @@ ID_PY_DISCARD = 1
ID_PY_EVENT = 2
ID_PY_COMPLETE = 3
ID_PY_FAIL = -1

3 changes: 1 addition & 2 deletions src/explicit_ode.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,10 @@
# You should have received a copy of the GNU Lesser General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.


from ode cimport ODE
import numpy as N
cimport numpy as N

from assimulo.ode cimport ODE

cdef class Explicit_ODE(ODE):

Expand Down
22 changes: 11 additions & 11 deletions src/explicit_ode.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,19 @@

# distutils: define_macros=NPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION

from ode cimport ODE
from problem import Explicit_Problem, Delay_Explicit_Problem, SingPerturbed_Problem, cExplicit_Problem
cimport cython

import itertools
import sys
import numpy as N
cimport numpy as N
from timeit import default_timer as timer

cimport explicit_ode # .pxd
cimport cython
from assimulo.ode cimport ODE
from assimulo.explicit_ode cimport Explicit_ODE, f_event_locator

from exception import Explicit_ODE_Exception, TimeLimitExceeded, TerminateSimulation
from timeit import default_timer as timer
from assimulo.problem import Explicit_Problem, Delay_Explicit_Problem, SingPerturbed_Problem, cExplicit_Problem
from assimulo.exception import Explicit_ODE_Exception, TimeLimitExceeded, TerminateSimulation

include "constants.pxi" #Includes the constants (textual include)

Expand Down Expand Up @@ -342,11 +342,11 @@ cdef class Explicit_ODE(ODE):
cdef N.ndarray[double, mode="c", ndim=1] g_high_c = N.empty(n_g, dtype = N.double)
cdef N.ndarray[double, mode="c", ndim=1] y_high_c = N.array(y_high)
cdef int nstatefcns = 0
cdef int ret = explicit_ode.f_event_locator(len(y_high), n_g, 1.e-13, t_low, &t_high,
&y_high_c[0], &g_low_c[0], &g_mid_c[0], &g_high_c[0],
callback_event, <void*>self.event_func,
callback_interp, <void*>self.interpolate,
&nstatefcns)
cdef int ret = f_event_locator(len(y_high), n_g, 1.e-13, t_low, &t_high,
&y_high_c[0], &g_low_c[0], &g_mid_c[0], &g_high_c[0],
callback_event, <void*>self.event_func,
callback_interp, <void*>self.interpolate,
&nstatefcns)
self.statistics["nstatefcns"] += nstatefcns

if ret == ID_PY_EVENT:
Expand Down
2 changes: 1 addition & 1 deletion src/ode.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

import numpy as N
cimport numpy as N
from support cimport Statistics
from assimulo.support cimport Statistics

cdef class ODE:
cdef public dict options, solver_options, problem_info
Expand Down
9 changes: 4 additions & 5 deletions src/ode.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,13 @@

import numpy as N
cimport numpy as N
from timeit import default_timer as timer

import itertools
import multiprocessing
from timeit import default_timer as timer

from exception import ODE_Exception, AssimuloException
from problem import Explicit_Problem, Delay_Explicit_Problem, Implicit_Problem, SingPerturbed_Problem
from support import Statistics
from assimulo.exception import ODE_Exception, AssimuloException
from assimulo.problem import Explicit_Problem, Delay_Explicit_Problem, Implicit_Problem, SingPerturbed_Problem
from assimulo.support import Statistics

include "constants.pxi" #Includes the constants (textual include)

Expand Down

0 comments on commit 5b8324b

Please sign in to comment.