Skip to content

Commit

Permalink
More Cython related cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterMeisrimelModelon committed Jan 24, 2024
1 parent f9fa119 commit 7b5154e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 15 deletions.
8 changes: 1 addition & 7 deletions src/problem.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,6 @@ cimport numpy as np
cdef class cProblem:
cdef public int _sensitivity_result

cpdef initialize(self, solver)
cpdef reset(self)
cpdef handle_event(self, object solver, event_info)
cpdef finalize(self,object solver)

cdef class cImplicit_Problem(cProblem):
cpdef res_internal(self, np.ndarray[double, ndim=1] res, double t, np.ndarray[double, ndim=1] y, np.ndarray[double, ndim=1] yd)

Expand All @@ -43,5 +38,4 @@ cdef class cSingPerturbed_Problem(cExplicit_Problem):
pass

cdef class cAlgebraic_Problem:
cpdef initialize(self, solver)
cpdef finalize(self,object solver)
pass
14 changes: 6 additions & 8 deletions src/problem.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ import numpy as np
cimport numpy as np

from assimulo.support import set_type_shape_array

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


cdef class cProblem:

Expand All @@ -41,19 +39,19 @@ cdef class cProblem:
self.name = name
self.t0 = t0

cpdef initialize(self, solver):
def initialize(self, solver):
"""
Method for specializing initiation.
"""
solver.log_message("No initialization defined for the problem.", LOUD)

cpdef reset(self):
def reset(self):
"""
Resets a problem to its default values.
"""
pass

cpdef handle_event(self, object solver, event_info):
def handle_event(self, object solver, event_info):
"""
Defines how to handle a discontinuity. This functions gets called when
a discontinuity has been found in the supplied event functions. The solver
Expand All @@ -68,7 +66,7 @@ cdef class cProblem:
solver.log_message("No event handling defined.", NORMAL)


cpdef finalize(self,object solver):
def finalize(self, object solver):
"""
Method for specifying the finalization options when the simulation have
finished.
Expand Down Expand Up @@ -568,13 +566,13 @@ cdef class cAlgebraic_Problem:
if name:
self.name = name

cpdef initialize(self, solver):
def initialize(self, solver):
"""
Method for specializing initiation.
"""
solver.log_message("No initialization defined for the problem.", LOUD)

cpdef finalize(self,object solver):
def finalize(self,object solver):
"""
Method for specifying the finalization options when the simulation have
finished.
Expand Down

0 comments on commit 7b5154e

Please sign in to comment.