Skip to content

Commit

Permalink
Merge pull request #36 from jrenaud90/0.8.0
Browse files Browse the repository at this point in the history
0.8.0
  • Loading branch information
jrenaud90 authored Sep 6, 2023
2 parents f4feddf + 6bf5bc8 commit 148fba1
Show file tree
Hide file tree
Showing 33 changed files with 14,157 additions and 1,632 deletions.
82 changes: 56 additions & 26 deletions Benchmarks/CyRK - SciPy Comparison.ipynb

Large diffs are not rendered by default.

Binary file modified Benchmarks/CyRK_CySolver.pdf
Binary file not shown.
Binary file added Benchmarks/CyRK_SciPy_Compare_predprey_v0-8-0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Benchmarks/CyRK_cyrk_ode.pdf
Binary file not shown.
Binary file modified Benchmarks/CyRK_numba.pdf
Binary file not shown.
Binary file modified Benchmarks/SciPy.pdf
Binary file not shown.
20 changes: 20 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,26 @@

## 2023

### v0.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.

#### v0.7.1

Changes
Expand Down
10 changes: 9 additions & 1 deletion CyRK/array/interp.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

cdef Py_ssize_t binary_search_with_guess(double key, double[:] array, Py_ssize_t length, Py_ssize_t guess) noexcept nogil

cdef Py_ssize_t binary_search_with_guess_ptr(double key, double* array, Py_ssize_t length, Py_ssize_t guess) noexcept nogil

cpdef (double, Py_ssize_t) interpj(double desired_x, double[:] x_domain, double[:] dependent_values,
Py_ssize_t provided_j = *) noexcept nogil

Expand All @@ -17,5 +19,11 @@ cpdef double complex interp_complex(double desired_x, double[:] x_domain, double
cpdef void interp_array(double[:] desired_x_array, double[:] x_domain, double[:] dependent_values,
double[:] desired_dependent_array) noexcept nogil

cdef void interp_array_ptr(double* desired_x_array, double* x_domain, double* dependent_values,
double* desired_dependent_array, Py_ssize_t len_x, Py_ssize_t desired_len) noexcept nogil

cpdef void interp_complex_array(double[:] desired_x_array, double[:] x_domain, double complex[:] dependent_values,
double complex[:] desired_dependent_array) noexcept nogil
double complex[:] desired_dependent_array) noexcept nogil

cdef void interp_complex_array_ptr(double* desired_x_array, double* x_domain, double complex* dependent_values,
double complex* desired_dependent_array, Py_ssize_t len_x, Py_ssize_t desired_len) noexcept nogil
Loading

0 comments on commit 148fba1

Please sign in to comment.