Releases: jrenaud90/CyRK
Releases · jrenaud90/CyRK
CyRK v0.8.0
Changes
New Features
- Added new interp functions that work with c pointers. These can only be cimported.
- Added new "CyRK.cy.common.pyx" file for functions that are used by both
cyrk_ode
andCySolver
.- Moved interpolation functionality into
CyRK.cy.common
. Restructuredcyrk_ode
andCySolver
to use this new function for interpolations.
- Moved interpolation functionality into
Changes:
- Refactored many
CySolver
internal attributes to reflect to change from memoryviews to pointers. The most important ones for the user are:CySolver.y_new_view
->CySolver.y_ptr
CySolver.dy_new_view
->CySolver.dy_ptr
CySolver.t_new
->CySolver.t_now
CySolver.arg_array_view
->CySolver.args_ptr
- Changed RK constants back to c arrays initialized with PyMem_Malloc. The memory for these arrays are setup in the cython-based solvers. Afterwards, there are helper functions in
CyRK.rk
to populate the arrays with correct values. - Moved to a more generalized scheme for compiling cython files. See "cython_extensions.json", "_build_cyrk.py", and "setup.py" for details.
Performance
- Transitioned many arrays from numpy to c arrays allocated with PyMem_Malloc, etc. These changes led to a significant performance boost for cython-based solvers.
- Copied some performance lessons that were learned from the cython-based solvers to the numba-based nbrk_ode.
GitHub Tracked Changes
- 0.8.0 by @jrenaud90 in #36
Full Changelog: v0.7.1...v0.8.0
CyRK v0.7.1
Changes
Other Changes
- Changed cyrk_ode to match the format used by CySolver for its rk_step.
Performance
- Minor calculation taken out of tight inner loops in cython-based solvers.
Bug Fixes
- Added back noexcepts to dabs functions used by cyrk_ode that were mistakenly removed in final dev commit of v0.7.0.
- Fixed issue where cython-based solvers could overshoot t_span[1].
- Fixed issue where interp functions would give wrong result when requested x was between x_array[0] and x_array[1].
- Fixed issue where interp functions would give wrong results if requested x was negative and x_array was positive (or vice versa).
- The use of carrays for RK constants led to floating point rounding differences that could impact results when step sizes are small.
- Converted RK constants to numpy arrays which seem to handle the floats much better.
- Also changed the interaction with these variables to be done solely through constant memoryviews. This may provide a bit of a performance boost.
GitHub Tracked Changes
- 0.7.1 by @jrenaud90 in #35
Full Changelog: v0.7.0...v0.7.1
CyRK v0.7.0
Changes
Major Changes
- Added support for Cython 3.0.0
- Added
noexcept
to pure cython functions to avoid a potential python error check.
- Added
New Features
- Added the ability to pass arrayed versions of rtol and atol to both the numba and cython-based solvers (cyrk_ode and CySolver).
- For both solvers, you can pass the optional argument "rtols" and/or "atols". These must be C-contiguous numpy arrays with float64 dtypes. They must have the same size as y0.
- Added tests to check functionality for all solvers.
- This resolves Issue #1.
- Added new optional argument to all solvers
max_num_steps
which allows the user to control how many steps the solver is allowed to take.- If exceeded the integration with fail (softly).
- Defaults to 95% of
sys.maxsize
(depends on system architecture).
- New
CySolver.update_constants
method allows for significant speed boosts for certain differential equations.- See test diffeqs, which have been updated to use this feature, for examples.
Other Changes
- Improved documentation for most functions and classes.
- To make more logical sense with the wording,
CySolver.size_growths
now gives one less than the solver's growths attribute. - Cleaned up status codes and created new status code description document under "Documentation/Status and Error Codes.md"
- Fixed compile warning related to NPY_NO_DEPRECATED_API.
- Converted RK variable lengths to Py_ssize_t types.
- Changed default tolerances to match scipy: rtol=1.0e-3, atol=1.0e-6.
Performance
- Various minor performance gains for cython-based solvers.
- Moved key loops in
CySolver
into self-contained method so that gil can be released. - New
CySolver.update_constants
method allows for significant speed boosts for certain differential equations.
Bug Fixes:
- Fixed potential seg fault when accessing
CySolver
's arg_array_view. - Fixed potential issue where
CySolver
's first step size may not be reset when variables that affect it are. - Fixed missed declaration in
cyrk_ode
. - Fixed bug where the state reset flag was not being passed from
CySolver.solve
wrapper method.
GitHub Tracked Changes
- v0.7.0 by @jrenaud90 in #34
Full Changelog: v0.6.2...v0.7.0
CyRK v0.6.2
Changes
New Features
- Added
auto_solve
key word toCySolver
class. This flag defaults to True. If True, then the solver will automatically callself.solve()
after initialization. - Added new parameter change functions to
CySolver
so that certain parameters can be changed after the class is initialized for a performance boost.- Look for the "self.change_*" methods in cysolver.pyx/pxd. There is a main change method,
CySolver.change_parameters
which allows you to change multiple parameters at once.
- Look for the "self.change_*" methods in cysolver.pyx/pxd. There is a main change method,
Bug Fixes:
- Fixed issue where
CySolver
could give incorrect results if thesolve()
method was called multiple times on the same instance. - Removed extraneous code from
CySolver.__init__
. - Changed several cython integer variables to all use Py_ssize_t types. Corrected type conversions.
GitHub Tracked Changes
- V0.6.2 by @jrenaud90 in #33
Full Changelog: v0.6.1...v0.6.2
CyRK v0.6.1
Changes
New Features
- Added top level parameters (like
MAX_STEP
) used inCySolver
tocysolver.pxd
so they can be cimported. - Added new argument to
array.interp
andarray.interp_complex
:provided_j
the user can provide aj
index,
allowing the functions to skip the binary search. - Added new function
interpj
to array module that outputs the interpolation result as well as thej
index that was found.
Bug Fixes
- Fixed issue with array tests not actually checking values.
Other Changes
- Reordered tests since numba tests take the longest.
- Added
initializedcheck=False
to the array module compile arguments.
GitHub Tracked Changes
- 0.6.1 by @jrenaud90 in #32
Full Changelog: v0.6.0...v0.6.1
CyRK v0.6.0
Changes
New Features
CyRK
now works with python 3.11.- Created the
CySolver
class which is more efficient than thecyrk_ode
function.- Solves issue 28
- New functions in
CyRK.cy.cysolvertest
to help test and check performance ofCySolver
.
Performance
- Removed python lists from
cyrk_ode
leading to an increase in performance of 15--20%.- Solves issue 27
Bug Fixes:
- Fixed compile error with
cyrk_ode
"complex types are unordered".- This was not a problem before so likely something has changed in newer cython versions.
- Fixed missing declarations for variables in
cyrk_ode
. - Fixed potential problems during installation where paths may be incorrect depending on OS.
GitHub Tracked Changes
- V0.6.0 by @jrenaud90 in #29
Full Changelog: v0.5.3...v0.6.0
CyRK v0.5.3
Changes
Performance
- Removed dynamic optional arguments from
cyrk_ode
. Now it checks if those arguments are set to None.
Other Changes
- Changed
cyrk_ode
arguments to const to avoid memoryview buffer problems. (Change made by David Meyer)
GitHub Tracked Changes
Full Changelog: v0.5.2...v0.5.3
CyRK v0.5.2
CyRK v0.5.1
CyRK v0.5.0
Changes
New Features
cyrk_ode
now supports both float and complex-typed y and dydt functions.- Resolves issue 3. (Fix made by David Meyer)
Performance
- Converted various ints to
short
s,char
s, orPy_ssize_t
.Py_ssize_t
is recommended by Cython for loop integers to better support 64-bit architecture. - Added custom interpolation functions which, depending on the size of the array, can be up to 10x faster than numpys.
- Removed unnecessarily variables from
cyrk_ode
. - Had to turn off
fastmath
fornbrk_ode
. See issue 24. This negatively impacted the numba integrator's performance by around 5%.
Other Changes:
- Refactored, cleaned up, and added comments and docstrings to
cyrk_ode
. - Changed both
nbrk_ode
andcyrk_ode
tests to use pytest parameterization. - Changed the accuracy test for both
nbrk_ode
andcyrk_ode
to check against a known function. - Added openmp dependence during compile time to allow for the use of
prange
. - Moved
cyrk_ode
's Runge-Kutta constants to a separate moduleCyRK.rk
.
Bug Fixes:
- Fixed issue (for
nbrk_ode
andcyrk_ode
) where incorrect step size could be used due to bad minimum step check (see issue 20).
GitHub Generated Change Log
- 0.5.0 by @jrenaud90 and @dihm in #25
Full Changelog: v0.4.0...v0.5.0