Cyrk

Latest version: v0.12.2

Safety actively analyzes 723200 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 4 of 7

0.8.2

New Features:
- Added a helper flag to control if `CySolver.reset_state` is called at the end of initialization.

0.8.1

New Features:
- Added more interp functions that take pointers as arguments.

Changes:
- Converted interp functions to use each other where possible, rather than having separate definitions.
- Cleaned up .pxd file formatting.

Performance:
- Moved some backend functionality for CyRK.interp to pure c file for performance gains.

Bug Fixes:
- Fixed issue with "cy/common.pyx" not having the correct cython flags during compilation.

0.8.0

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.

0.7.1

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.

0.7.0

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.

0.6.2

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_<X>" 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.

Page 4 of 7

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.