Skip to content

Releases: jrenaud90/CyRK

CyRK v0.8.0

06 Sep 19:54
148fba1
Compare
Choose a tag to compare

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 and CySolver.
    • Moved interpolation functionality into CyRK.cy.common. Restructured cyrk_ode and CySolver to use this new function for interpolations.

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

Full Changelog: v0.7.1...v0.8.0

CyRK v0.7.1

30 Aug 22:38
f4feddf
Compare
Choose a tag to compare

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

Full Changelog: v0.7.0...v0.7.1

CyRK v0.7.0

28 Aug 20:04
3c63364
Compare
Choose a tag to compare

Changes

Major Changes

  • Added support for Cython 3.0.0
    • Added noexcept to pure cython functions to avoid a potential python error check.

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

Full Changelog: v0.6.2...v0.7.0

CyRK v0.6.2

17 Aug 21:12
Compare
Choose a tag to compare

Changes

New Features

  • Added auto_solve key word to CySolver class. This flag defaults to True. If True, then the solver will automatically call self.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.

Bug Fixes:

  • Fixed issue where CySolver could give incorrect results if the solve() 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

Full Changelog: v0.6.1...v0.6.2

CyRK v0.6.1

02 Aug 01:16
b807507
Compare
Choose a tag to compare

Changes

New Features

  • Added top level parameters (like MAX_STEP) used in CySolver to cysolver.pxd so they can be cimported.
  • Added new argument to array.interp and array.interp_complex: provided_j the user can provide a j index,
    allowing the functions to skip the binary search.
  • Added new function interpj to array module that outputs the interpolation result as well as the j 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

Full Changelog: v0.6.0...v0.6.1

CyRK v0.6.0

27 Jul 23:38
918771e
Compare
Choose a tag to compare

Changes

New Features

  • CyRK now works with python 3.11.
  • Created the CySolver class which is more efficient than the cyrk_ode function.
  • New functions in CyRK.cy.cysolvertest to help test and check performance of CySolver.

Performance

  • Removed python lists from cyrk_ode leading to an increase in performance of 15--20%.

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

Full Changelog: v0.5.3...v0.6.0

CyRK v0.5.3

30 Mar 02:26
Compare
Choose a tag to compare

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

  • Allow read-only buffers for initial conditions of cython solver by @dihm in #26

Full Changelog: v0.5.2...v0.5.3

CyRK v0.5.2

29 Mar 11:25
962032f
Compare
Choose a tag to compare

Changes

  • Fixed issue with MacOS wheel on pypi

Full Changelog: v0.5.1...v0.5.2

CyRK v0.5.1

29 Mar 04:47
Compare
Choose a tag to compare

Changes

  • Fixed issue with MacOS Wheel build

Github Change Log

Full Changelog: v0.5.0...v0.5.1

CyRK v0.5.0

29 Mar 01:01
Compare
Choose a tag to compare

Changes

New Features

  • cyrk_ode now supports both float and complex-typed y and dydt functions.

Performance

  • Converted various ints to shorts, chars, or Py_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 for nbrk_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 and cyrk_ode tests to use pytest parameterization.
  • Changed the accuracy test for both nbrk_ode and cyrk_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 module CyRK.rk.

Bug Fixes:

  • Fixed issue (for nbrk_ode and cyrk_ode) where incorrect step size could be used due to bad minimum step check (see issue 20).

GitHub Generated Change Log

Full Changelog: v0.4.0...v0.5.0