-
Notifications
You must be signed in to change notification settings - Fork 159
Add Python interfaces based on nanobind #796
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
balos1
wants to merge
506
commits into
develop
Choose a base branch
from
feature/python-nanobind
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+24,291
−54
Open
Changes from all commits
Commits
Show all changes
506 commits
Select commit
Hold shift + click to select a range
9c524ea
skip sunadaptcontroller tests
balos1 8314827
generate arkode functions not previously generated
balos1 1314408
fix include guards
balos1 b396d75
turn off deprecated declaration warnings when building the python module
balos1 6503f62
use sundials4py::Array1d using
balos1 cb9a177
expose sunrealtype and sunindextype
balos1 932e448
skip tests which cant run with single
balos1 bb420ae
add brusselator example for arkode
balos1 c677048
format
balos1 ad0c4b4
spelling
balos1 7ef3763
format
balos1 3e6d703
Git Status
balos1 ddab83b
try cleaning
balos1 07969b0
add heat1D example for arkode
balos1 a11a42b
format
balos1 cc8dcd8
git clean
balos1 1866919
use ARK_SUCCESS
balos1 b4fac16
use ARK_SUCCESS
balos1 097bd18
add cvs_lotkavolterra_ASA example
balos1 f54620d
rename
balos1 3c22f0d
remove Wno
balos1 a8dca1d
add kinsol example
balos1 72288ff
Merge branch 'develop' into docs/breakout-fortran-ug
gardner48 4c1e780
use sunrealtype
balos1 3304704
add IDAS example
balos1 51576da
interface manyvector
balos1 b43583b
add arkode ASA example
balos1 afb793d
add note in tests which fail with error checking on
balos1 1077209
fix arkode lv asa example
balos1 8f03296
format
balos1 3290f0d
add _1d suffix in manyvector header
balos1 35fa081
use shared_ptr
balos1 d518dd9
make_our_shared to our_make_shared
balos1 12d2b41
fix generation of create routines
balos1 1b613e4
regenerate and format
balos1 8c2b96d
regen with fixed litgen
balos1 c69127e
use main
balos1 8af39e1
generate sunadaptcontroller
balos1 befe074
format
balos1 6b96eb5
setup keep_alive_tuple
balos1 d036358
[wip] make tuple keep_alive generation work
balos1 5afc8af
cleanup includes, some work on the adataptation to shared_ptr
balos1 cf951ae
optimization
balos1 afcaca7
generate more
balos1 6369531
update some of the unit tests
balos1 99f55d6
format
balos1 7dd2e91
all tests passing with shared_ptr approach
balos1 b7ad2fb
missed one
balos1 1f1ef75
remove print
balos1 a71abab
remove unused view classes
balos1 c1d8822
remove generate_all script
balos1 c0a8400
update examples
balos1 b18ab0b
fix typo
balos1 3ea0862
fix more nurse,patient edge cases
balos1 3a8a57e
format
balos1 4ab6a9c
add custom exception
balos1 f2fca2f
Merge remote-tracking branch 'origin/develop' into feature/python-nan…
balos1 ddc1840
Merge branch 'develop' into docs/breakout-fortran-ug
balos1 14e080d
Merge remote-tracking branch 'origin/docs/breakout-fortran-ug' into f…
balos1 5cb329a
remove extra using
balos1 79cd452
remove fortran (lowercase f) directory
balos1 26f21c2
remove git status debugging steps in wheels workflow
balos1 62b62f6
dont generate MRIStepSetPreInnerFn/MRIStepSetPostInnerFn
balos1 9f2c368
dont generate some
balos1 e8fa248
more function pointer set functions
balos1 8469810
one more missing function pointer setter
balos1 d4f5998
another arkode setter
balos1 753ab0b
memory helper test
balos1 feda9ee
typo
balos1 930b5b8
formatt
balos1 45477d1
see what happens with linearcombination off
balos1 fe1a97d
fix runner tags
balos1 6091707
comment out setarraypointer test
balos1 3f142db
fix tags
balos1 9145e55
regen and format
balos1 3c64ced
ensure MACOSX_DEPLOYMENT_TARGET set
balos1 3e8a5ea
fix doc
balos1 45bdfb4
missing comma
balos1 1e78630
add cvodes fsa and asa tests
balos1 60c03e7
fix idas BS functions
balos1 921e773
format
balos1 68b9cb3
fix cvodes BS functions
balos1 d13386b
fix kinsol depth function callback
balos1 ef5c4c1
add test_ functions to examples so they can run under pytest
balos1 bc00347
test that out param in callback in sunstepper works (it doesnt)
balos1 ede6c21
fix SUNStepper_GetNumSteps
balos1 c48b6af
fix sunstepper set forcing
balos1 4911872
add view classes that previously existed back
balos1 4b58c2b
fix sunstepper fixture
balos1 98f884d
fix arkode callbacks
balos1 b3e695b
fix cvode callbacks
balos1 f2142e6
disable root finding for now
balos1 c313c1e
fix kinsol callbacks
balos1 8444c11
fix sunnonlinearsolver lsetup
balos1 515f01a
usage note
balos1 25f23f3
Merge remote-tracking branch 'origin/develop' into feature/python-nan…
balos1 88a77f6
fix cvodes cvode_fQS_wrapper
balos1 c61b090
move generator code into a submodule
balos1 debcf5c
couple small fixes
balos1 ae2afab
Potential fix for code scanning alert no. 92: Workflow does not conta…
balos1 c132a0b
regen swig
balos1 eb62e95
format
balos1 644c305
spelling
balos1 86391cc
update wheels workflow
balos1 8285b01
spelling
balos1 3f6d0ce
move static functions in profiler impl to profiler.c
balos1 25476ed
add generator check
balos1 cceff21
fix name
balos1 43de5c5
fix permissions
balos1 298cc34
update kinsol and cvodes to stuff solver memory into user data
balos1 02e2651
remove cvSetOwnUserData
balos1 ab98076
ensure that all of the cvodes BS callbacks are bound
balos1 342d086
cleanup in cvodes.cpp
balos1 a9ff044
add python pointer in ida mem
balos1 e16b87b
[wip] fixing idas callbacks/userdata
balos1 609ed91
fix cvodes callbacks
balos1 063bb33
fix idas
balos1 7e23ac6
remove python pointer from cvode bmem
balos1 a1e0368
test quadratures too
balos1 5be89c2
fix two idas BS functions
balos1 30008d1
bind the rest of the IDAS BS callbacks
balos1 7d986c1
format
balos1 b245e52
generate some functions in cvodes that we can now handle
balos1 6c5294e
add some more arkode functions
balos1 31e35d5
update all of the arkode callbacks with ark_mem in user_data
balos1 aebb945
format
balos1 e9a97ff
try to interface MRIStepInnerStepper_GetForcingData
balos1 1a9b328
disable leak warnings in Release builds
balos1 29bd64b
interface more functions
balos1 e3c6e54
more interfacing of previously unsupported functions
balos1 3bf9478
setarraypointer enable test
balos1 58822e8
format
balos1 27d307a
remove old comment
balos1 5a8b779
comments
balos1 1e48480
interface SUNLinSolSetATimes and SUNLinSolSetPreconditioner
balos1 b5b5571
handle SUNContext_PushErrHandler
balos1 c09f753
fix SUNContext_PushErrHandler
balos1 404301f
fix sundomeigest test_estimate
balos1 e9bf1bf
format
balos1 a867259
fix another todo
balos1 5b17c1f
fix adjoint routines
balos1 cb54118
naming
balos1 0eec49c
support SetOptions
balos1 e3fe597
add back SUNLinearSolverView
balos1 d607095
typo
balos1 3109fae
allow C++17
balos1 b07a842
format
balos1 1d46711
add sundials4py to requirements.txt for docs
balos1 1ec2029
typpo
balos1 e8c4a9a
fix c++ requirements
balos1 dcfe5d5
fix branch name
balos1 7b6c77d
fix submodule url
balos1 530ac68
use newer python in rtd build
balos1 755b498
fix SUNContextView deletion
balos1 3acd16a
format
balos1 1ede1cb
doc reference fix
balos1 1e3fa48
fix includes for windows in ark_kpr_nestedmri
balos1 48e51f7
ensure gout set in smoke tests to avoid random roots being found
balos1 ee2ea57
enable workflows on push for now
balos1 bdbd5e9
remove unused include
balos1 c77f2a4
merge fixes
balos1 fffd484
checkout include from feature/python-nanobind
balos1 db0f1ea
checkout src from feature/python-nanobind
balos1 f3eb4f9
checkout examples from feature/python-nanobind
balos1 304f42c
checkout swig from feature/python-nanobind
balos1 fe80e70
checkout test from feature/python-nanobind
balos1 958ce38
checkout CHANGELOG from feature/python-nanobind
balos1 73a77a6
checkout some of doc from feature/python-nanobind
balos1 980fdd2
Merge branch 'feature/enable-python' into feature/python-nanobind
balos1 1333e09
add change note about interfaces
balos1 941f87a
reorg Python section
balos1 fd1a825
fix duplicate doc of KINSetDepthFn
balos1 90ee8a2
fix duplicate doc of KINSetDepthFn
balos1 084e8e1
fix workflows
balos1 b26ec89
add formatting to litgen check
balos1 da39204
remove push
balos1 c51c79a
typo
balos1 6028f83
trigger ci
balos1 0b775af
remove push
balos1 dccae47
install python
balos1 c130b67
only build extra wheels on ubuntu
balos1 d2a6012
set gout to 1 to avoid root detection
balos1 e9c201d
call python3
balos1 d977d85
name
balos1 5ad8da0
ensure ndarray has owner so that data is not copied and only referenced
balos1 8b0ea10
fix wheel path
balos1 0d7d41a
Merge remote-tracking branch 'origin/develop' into feature/enable-python
balos1 0b0133e
address pr comments on doc/
balos1 ae9962a
address comments on src/
balos1 e946159
address most of David's comments on include/
balos1 a976978
add typedef for enums missing it
balos1 06423ef
Merge remote-tracking branch 'origin/feature/enable-python' into feat…
balos1 2733fa6
Merge branch 'feature/enable-python' into feature/python-nanobind
balos1 f2cea64
regen
balos1 2797313
remove incorrect rv_policy annotations
balos1 0a9fa5e
a couple minor fixes
balos1 91e20bc
Merge branch 'feature/enable-python' into feature/python-nanobind
balos1 0cd07c2
fix includes
balos1 0a4d3ae
regen
balos1 e7fdf83
address Steven's comments
balos1 f5c73c3
update docs
balos1 bdc220c
Merge branch 'feature/enable-python' into feature/python-nanobind
balos1 49e6b50
use is_pointer<T>::value since we dont require c++17 in some c++ builds
balos1 c6fed8a
remove class specialization
balos1 eb3bb33
fix noexcepts on convertibleto overrides
balos1 a968995
regen swig
balos1 c287caf
fix doc duplicate text
balos1 8b143ed
Merge branch 'feature/enable-python' into feature/python-nanobind
balos1 9165791
fix docs, constructor, view name
balos1 f960e23
fix docs, constructor, view name
balos1 4fc7e0f
doc update
balos1 e712323
update docs
balos1 9a68200
Merge branch 'feature/enable-python' into feature/python-nanobind
balos1 68dd14c
use move assignment
balos1 98aea33
remove const
balos1 fc2c06b
Apply suggestions from code review
balos1 9cd8556
move note
balos1 9a3df22
Merge branch 'develop' into feature/enable-python
balos1 237d2cf
Merge branch 'feature/enable-python' into feature/python-nanobind
balos1 310e1b4
ensure correct python min version
balos1 20b2460
Merge branch 'develop' into feature/python-nanobind
balos1 b5d50bb
fix doc structure
balos1 4fd7173
fix layout
balos1 bae2a7e
Apply suggestions from code review
balos1 96fdb1d
Merge remote-tracking branch 'origin/develop' into feature/python-nan…
balos1 c2a3951
Merge remote-tracking branch 'origin/develop' into feature/python-nan…
balos1 a00fc33
add macos-latest to extra wheels
balos1 1fd5473
add CMake build check
balos1 d928173
address some comments on the arkode module
balos1 08077dc
address some comments on the arkode module
balos1 9edc199
remove std::forward
balos1 d991338
fixes in arkode.cpp
balos1 4ace5ef
add lines between comment and code to cleanup generated doc strings
balos1 81b1c21
address comments on docs
balos1 fe80e1d
fix doc layout
balos1 5db60b9
regen
balos1 ff631d7
address all comments on cvodes.cpp
balos1 564e90b
address comments on cvodes
balos1 79daf38
regen
balos1 156f7c0
bump sundials4py-generate
balos1 322df8c
address comments in some arkode examples
balos1 a0f783c
address comments on examples
balos1 a23c455
address comments on idas
balos1 b6250e0
remove std::forward in cvodes usersupplied
balos1 5c1d627
address comments on sundials4py_helpers.hpp
balos1 912b289
address comments on kinsol
balos1 89bc4dd
remove unnecessary casts
balos1 d42043e
update copyrights
balos1 7339784
add version
balos1 aee26c0
address comments on generate.yaml for sundials core dir
balos1 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,79 @@ | ||
| name: Checks - litgen | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| on: | ||
| pull_request: | ||
| workflow_dispatch: | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| litgen_check: | ||
| runs-on: ubuntu-latest | ||
| container: | ||
| image: ghcr.io/llnl/sundials_spack_cache:llvm-17.0.4-h4lflucc3v2vage45opbo2didtcuigsn.spack | ||
| steps: | ||
| - name: Install dependencies with apt | ||
| run: | | ||
| apt update | ||
| apt install -y git python3 python3-pip | ||
|
|
||
| - name: Install black | ||
| run: pip install black | ||
|
|
||
| - name: Print black version | ||
| run: black --version | ||
|
|
||
| - name: Install cmake-format | ||
| run: pip install cmakelang | ||
|
|
||
| - name: Print cmake-format version | ||
| run: cmake-format --version | ||
|
|
||
| - name: Install fprettify | ||
| run: pip install fprettify | ||
|
|
||
| - name: Print fprettify version | ||
| run: fprettify --version | ||
|
|
||
| - name: Print clang-format version | ||
| run: clang-format --version | ||
|
|
||
| - name: Install sundials generator+litgen | ||
| run: | | ||
| pip install black isort pyyaml litgen@git+https://github.com/sundials-codes/litgen.git | ||
|
|
||
| - name: Check out repository code | ||
| uses: actions/checkout@v5 | ||
| with: | ||
| submodules: true | ||
|
|
||
| - name: Add safe directory | ||
| run: git config --global --add safe.directory "$GITHUB_WORKSPACE" | ||
|
|
||
| - name: Run generator on code | ||
| run: | | ||
| cd bindings/sundials4py | ||
| python3 sundials4py-generate/generate.py . | ||
|
|
||
| - name: Run formatter on code | ||
| run: ./scripts/format.sh bindings/sundials4py | ||
|
|
||
| - name: Run git diff to see if anything changed | ||
| run: /usr/bin/git diff --exit-code | ||
|
|
||
| - name: Run git diff if we failed | ||
| if: failure() | ||
| run: /usr/bin/git diff > litgen.patch | ||
|
|
||
| - name: Archive diff as a patch if we failed | ||
| uses: actions/upload-artifact@v5 | ||
| if: failure() | ||
| with: | ||
| name: litgen.patch | ||
| path: | | ||
| ${{ github.workspace }}/litgen.patch |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,120 @@ | ||
| name: sundials4py wheels | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| - develop | ||
| pull_request: | ||
| merge_group: | ||
| workflow_dispatch: | ||
| release: | ||
| types: | ||
| - published | ||
|
|
||
| jobs: | ||
| build_sdist: | ||
| name: Build SDist | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v5 | ||
| with: | ||
| submodules: true | ||
|
|
||
| - name: Build SDist | ||
| run: pipx run build --sdist | ||
|
|
||
| - name: Check metadata | ||
| run: pipx run twine check dist/* | ||
|
|
||
| - uses: actions/upload-artifact@v5 | ||
| with: | ||
| name: dist-sdist | ||
| path: dist/*.tar.gz | ||
|
|
||
|
|
||
| build_wheels: | ||
| name: Wheels on ${{ matrix.os }} | ||
| runs-on: ${{ matrix.os }} | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| os: [ubuntu-latest, macos-latest, macos-15-intel, windows-latest] | ||
|
|
||
| steps: | ||
| - name: Set macOS deployment target | ||
| if: contains(matrix.os, 'macos') | ||
| run: echo "MACOSX_DEPLOYMENT_TARGET=$(sw_vers -productVersion | cut -d '.' -f 1-2)" >> $GITHUB_ENV | ||
|
|
||
| - uses: actions/checkout@v5 | ||
| with: | ||
| submodules: true | ||
|
|
||
| - uses: pypa/[email protected] | ||
| env: | ||
| CIBW_TEST_COMMAND: "pytest {project}/bindings/sundials4py/test" | ||
|
|
||
| - name: Upload wheels | ||
| uses: actions/upload-artifact@v5 | ||
| with: | ||
| path: wheelhouse/*.whl | ||
| name: dist-${{ matrix.os }} | ||
|
|
||
| build_wheels_extra: | ||
| name: Build extra wheels on ${{ matrix.os }} (${{ matrix.precision }}/${{ matrix.index }}) | ||
| runs-on: ${{ matrix.os }} | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| os: [ubuntu-latest, macos-latest] | ||
| precision: [single, double] | ||
| index: [32, 64] | ||
|
|
||
| steps: | ||
| - name: Set macOS deployment target | ||
| if: contains(matrix.os, 'macos') | ||
| run: echo "MACOSX_DEPLOYMENT_TARGET=$(sw_vers -productVersion | cut -d '.' -f 1-2)" >> $GITHUB_ENV | ||
|
|
||
| - uses: actions/checkout@v5 | ||
| with: | ||
| submodules: true | ||
|
|
||
| - uses: pypa/[email protected] | ||
| env: | ||
| CMAKE_ARGS: "-DSUNDIALS_PRECISION=${{ matrix.precision }} -DSUNDIALS_INDEX_SIZE=${{ matrix.index }}" | ||
| CIBW_TEST_COMMAND: "pytest {project}/bindings/sundials4py/test" | ||
|
|
||
| - name: Rename wheels to include config | ||
| run: | | ||
| for whl in wheelhouse/*.whl; do | ||
| mv "$whl" "$(echo $whl | sed 's/\.whl$/-${{ matrix.precision }}-${{ matrix.index }}.whl/')" | ||
| done | ||
| shell: bash | ||
|
|
||
| - name: Upload wheels | ||
| uses: actions/upload-artifact@v5 | ||
| with: | ||
| path: wheelhouse/*.whl | ||
| name: dist-${{ matrix.os }} | ||
|
|
||
| upload: | ||
| name: Upload if release | ||
| needs: [build_wheels, build_sdist] | ||
| runs-on: ubuntu-latest | ||
| if: github.event_name == 'release' && github.event.action == 'published' | ||
|
|
||
| steps: | ||
| - uses: actions/setup-python@v5 | ||
| - uses: actions/download-artifact@v4 | ||
| with: | ||
| path: dist | ||
| pattern: dist-* | ||
| merge-multiple: true | ||
|
|
||
| - uses: pypa/gh-action-pypi-publish@release/v1 | ||
| with: | ||
| user: __token__ | ||
| password: ${{ secrets.pypi_password }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.