Skip to content

Releases: jrenaud90/CyRK

CyRK v0.11.2

13 Nov 14:55
ebcd01e
Compare
Choose a tag to compare

Changes

New:

  • Using extra output (via num_extra) with cysolve_ivp and pysolve_ivp now works when dense_output is set to true. CySolverSolution will now make additional calls to the differential equation to determine correct values for extra outputs which are provided alongside the interpolated y values.
    • Added relevant tests.

Other:

  • Refactored some misspellings in the cysolver c++ backend.

Fix:

  • Fixed missing np.import_array in cysolver backend.

GitHub Tracked Changes

Full Changelog: v0.11.1...v0.11.2

CyRK v0.11.1

12 Nov 14:19
Compare
Choose a tag to compare

Changes

Fixes:

  • MacOS was not correctly installing openmp version of the cython object files. Fixed this but...

Issues:

  • Cython prange was failing (for the array interps) only on MacOS on some versions of Python. Couldn't figure it out so removing prange for now.

GitHub Tracked Changes

Full Changelog: v0.11.0...v0.11.1

CyRK v0.11.0

08 Nov 19:02
37dc62f
Compare
Choose a tag to compare

Changes

New:

  • WrapCySolverResult result class now provides user access to attribute num_y.

Removed:

  • Removed previous cyrk_ode and older version of the CySolver class-based solver.
    • The functionality of cyrk_ode is now handled by the new (as of v0.10.0) pysolve_ivp function.
    • The functionality of CySolver is partly handled by the new (as of v0.10.0) cysolve_ivp function.
      • Note that the new cysolve_ivp is a functional approach. A class based approach like the older CySolver class supported is no longer available but could be easy to implement. If there is interest please create a Github issue for it.

Refactors:

  • Refactored the new cysolver and pysolver files to remove "New". This will break imports based on previous versions.
  • Broke up cysolver and pysolver into different files to isolate each other's code.

Other:

  • Changed the default ordering for diffeq function inputs to follow the scheme dydt(dy, t, y); previously it was dydt(t, y, dy). This affects the cy2nb and nb2cy helper functions.
  • Updated performance module to use new methods over old.

Demos:

  • Fixed typo in the type of the mixed-type args container.
  • Updated to work with new refactoring.

Tests:

  • Updated tests to use pysolver where cyrk_ode was used.
  • Changed tolerances and other inputs to try to make some tests faster.

Dependencies:

  • Tested that CyRK works with numpy v2.X; but a lot of other packages don't right now. So setting it as upper limit.
  • Tested that CyRK can not work with Python 3.13 yet due to numba dependence. See issue

GitHub Tracked Changes

Full Changelog: v0.10.2...v0.11.0

CyRK v0.10.2

07 Nov 22:04
ef06b9e
Compare
Choose a tag to compare

Changes

New:

  • Added new interpolate_from_solution_list function to help interpolate between multiple solutions across a domain.

Bugs:

  • Fixed issue where CyRK.test_cysolver() used incorrect kind and order of arguments.
  • Fixed MacOS compile issues when using OpenMP (for both x86-64 and arm64 macos).
  • Fixed issue where MacOS was failing certain tests.
  • Building new wheels to fix Github issue #62.

Tests:

  • Added tests to check all built in testers.

GitHub Tracked Changes

Full Changelog: v0.10.1...v0.10.2

CyRK v0.10.1

25 Jul 16:47
38082ec
Compare
Choose a tag to compare

Changes

C++ Back End:

  • Changed optional args from double pointer to void pointers to allow for arbitrary objects to be passed in.
    • Added description of this feature to "Documentation/Advanced CySolver.md" documentation and "Demos/Advanced CySolver Examples.ipynb" jupyter notebook.
  • Allow users to specify a "Pre-Eval" function that can be passed to the differential equation. This function should take in time, y, and args and update an output pointer which can then be used by the diffeq to solve for dydt.

cysolve_ivp`:

  • Change call signature to accept new pre_eval_func function.
  • Added more differential equations to tests.
  • Added tests to check new void arg feature.
  • Added tests to check new pre-eval function feature.

MacOS:

  • Going back to GCC for C and C++ compile instead of clang (ran into inconsistent test failures with clang).

GitHub Tracked Changes

Full Changelog: v0.10.0...v0.10.1

CyRK v0.10.0

17 Jul 18:44
8a1a398
Compare
Choose a tag to compare

Changes

C++ Backend:

  • This version of CyRK introduces a major rework of the backend integrator which is now written in pure C++.
  • CySolver is now a Cython wrapper to this C++ integrator which can be accessed via Python.
    • Access this function by using from CyRK cimport cysolve_ivp (this must be done within Cython).
    • The plan is to replace CyRK's older CySolver with this function.
  • There is now a new PySolver version of this wrapper that allows a user to pass a python function to the C++ backend.
    • Access this function by using from CyRK import pysolve_ivp.
    • This is designed as a drop-in-place replacement for SciPy's solve_ivp.
    • The plan is to replace CyRK's older cyrk_ode with this function.

Implemented Dense Output and Improved t_eval for new C++ backend:

  • Both pysolve_ivp and cysolve_ivp now utilize a much more accurate interpolator when t_eval is provided.
  • Users can now also request the interpolators be saved with the data, enabling Dense Output functional calls.
  • This closes GitHub Issue #45.
    • Note that these improvement were not ported to the numba-based nbsolve_ivp, or the cython-based cyrk_ode & CySolver methods. See below to learn about these methods' deprecation.
  • Added tests, documentation, and demos describing these features.

Deprecating Older CyRK Methods:

  • The new C++ backend is more flexible, faster, and allows for easy additions of new features. It is common across the cython-only, python, and njit-safe numba solvers. Therefore making a change to it propagates to all three solvers - allowing for easier maintenance and new features. For these reasons, the older cyrk_ode, CySolver, and nbrk_ode are now marked as deprecated. No new features will be implemented for those functions and they will be removed in the next major release of CyRK.
  • Deprecated cyrk_ode
  • Deprecated CySolver
  • Warnings will be issued if these functions are used in this release. To suppress these warnings set raise_warnings to False in the respective function calls.

CySolver:

  • Changed error message to use a stack-allocated char-array and associated pointer.
  • Added new argument to constructor raise_warnings (default: True) to allow users to suppress warnings.

cyrk_ode:

  • Added new argument to constructor raise_warnings (default: True) to allow users to suppress warnings.

WrapCySolverResult:

  • cysolve_ivp and pysolve_ivp now return a class structure that stores the result of the integration along with some meta data. The accessible attributes are:
    • cysolve_ivps CySolverResult:
      • success (bool): Flag if the integration was successful.
      • message (str): Message to give a hint on what happened during integration.
      • error_code (int): Additional error/status code that hints on what happened during integration.
      • size (int): Length of time domain.
      • y (float[:, :]): 2D Float Array of y solutions (and any extra output).
      • t (float[:]): 1D Float Array of time domain at which y is defined.

numba based nbsolve_ivp:

  • The older nbrk_ode has been refactored to nbsolve_ivp to match the signature of the new cython-based functions (and scipy's solve_ivp).
  • The output of nbsolve_ivp is now a named tuple that functions similar to the WrapCySolverResult

Memory Management:

  • Changed exit code when memory can not be allocated.
  • Changed some heap allocated arrays in CySolver to be stack allocated
    • This change limits the total number of y-dependent variables and extra output that is tracked to 50. This size is
      easy to change. If your use case requires a larger size then open an issue and an alternative can be discussed.
  • Converted the underlying storage arrays for CySolver to LinkedLists arrays.

Bug Fixes:

  • Fixed issue where the Cython-based solvers might use the incorrect memory freeing function.

Other Changes:

  • Moved from GCC to Clang on MacOS builds. There was a new problem that appeared with GCC's linker and could not find a working solution. The original move away from clang was done to support openMP multiprocessing. CyRK does not currently use that so the switch back should be okay.

Known Issues:

  • There is an occasional bug with backwards integration on pysolve_ivp and cysolve_ivp. See Github Issue #56.

GitHub Tracked Changes

Full Changelog: v0.9.0...v0.10.0

v0.9.0

23 May 03:23
1960d51
Compare
Choose a tag to compare

Changes

Major Changes:

  • Shifted from using the Python-based PyMem_Alloc, PyMem_Free to c-based malloc, free.
  • CySolver _solve method is now gil-free.
    • This has led to a 35%--230% speed boost at low values of steps (faster start up).

Other Changes:

  • CI will now build x64-86 and arm64 wheels for MacOS (change suggested by @dihm in #49).
    • Did have to use this nomkl workaround which may cause problems. TBD.

GitHub Tracked Changes

Full Changelog: v0.8.8...v0.9.0

CyRK v0.8.8

01 May 04:08
da53ff3
Compare
Choose a tag to compare

Changes

New Features:

  • Added utils.free_mem function to free memory so that future changes to the memory allocation system will call the proper free function that works with the utils.allocs.

Changes:

  • Changed all instances of PyMem_Free to new free_mem from the utils.

GitHub Tracked Changes

Full Changelog: v0.8.7...v0.8.8

CyRK v0.8.7

26 Apr 22:47
7195341
Compare
Choose a tag to compare

Changes

Updated manifest and rebuilt wheels.

GitHub Tracked Changes

Full Changelog: v0.8.6...v0.8.7

v0.8.6

13 Feb 23:08
3107517
Compare
Choose a tag to compare

Changes

Major Changes:

  • Added support for Python 3.12.
  • Converted CySolver's rk_step method into a pure-c implementation to allow for further optimizations.
  • Changed all files to compile with c rather than c++.
    • Had to change cpp_bools to bints to make this change.

Bug Fixes:

  • Fixed issue where CyRK was not installing on MacOS due to issue with LLVM and OpenMP.
    • Have opted to go to gcc for macOS install due to issues with OpenMP and clang.
  • Fixed incorrect type for rk method in CySolver (should eliminate some compile warnings).
  • Fixed issue in benchmark where incorrect results were being displayed for CySolver.

GitHub Tracked Changes

Full Changelog: v0.8.5...v0.8.6