21. Python
Warning
sundials4py is in beta and is subject to breaking changes. We welcome feedback on this new feature of SUNDIALS. Please report issues via the SUNDIALS GitHub repository.
sundials4py provides official (supported by the SUNDIALS team) Python bindings to much of the SUNDIALS library, allowing you to use SUNDIALS directly from Python.
The bindings are built using nanobind and litgen and are designed to be easy to use from Python in conjunction with ubiquitous libraries in the Python scientific computing and machine learning ecosystems. To that end, sundials4py supports:
Python’s automatic memory management
Python definitions of user-supplied callback functions
Zero-copy exchange of arrays (CPU and Device) through DLPack protocol and numpy’s ndarray
Note
sundials4py requires Python 3.12+
The Python User Guide focuses on specific aspects of using SUNDIALS from Python and assumes the user is familiar with SUNDIALS. New SUNDIALS users should first read the General User Guide to understand the features and usage of SUNDIALS packages.