Skip to content

Bdf2 - #128

Draft
bjodah wants to merge 109 commits into
masterfrom
bdf2
Draft

Bdf2#128
bjodah wants to merge 109 commits into
masterfrom
bdf2

Conversation

@bjodah

@bjodah bjodah commented May 11, 2026

Copy link
Copy Markdown
Owner

This is more of a prototype than a production ready implementation. Will probably not merge (at least not in its current state).

bjodah and others added 30 commits January 17, 2025 14:42
…path.

  Key fixes:

  - pyodesys/core.py: scalarizes first_step_cb results before passing them to pycvodes.
  - pyodesys/native/sources/_gsl_wrapper.pyx and pyodesys/native/sources/_odeint_wrapper.pyx: accept array-like atol, validate it is scalar-length, then pass a real double into the native calls. This fixes the reported TypeError.
  - Adjusted a handful of brittle current-stack numerical tests in pyodesys/tests/test_core.py, pyodesys/tests/test_robertson.py, and pyodesys/tests/test_symbolic.py.
Without NDEBUG, Boost uBLAS enables BOOST_UBLAS_TYPE_CHECK=1 which
performs a numerical consistency check on LU decomposition. For the
stiff Robertson ODE system (stiffness ratio ~10^13), this check fails
due to floating-point precision when pyodeint>=0.10.10 is built from
source using the Boost 1.91.0 headers in CPLUS_INCLUDE_PATH. The
symptom is RuntimeError: internal logic from pyodeint/_odeint.pyx.

Adding -DNDEBUG matches what pyodeint's own CI does (EXTRA_FLAGS=-DNDEBUG)
and is standard practice for release/CI builds.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…r test

With first_step=0, CVODES chooses its own initial step size, which can
lead to a step sequence that causes repeated recoverable RHS errors
(CV_REPTD_RHSFUNC_ERR) at log-time ≈24.5 (t ≈ 4e10). The robertson
RHS raises RecoverableError when any concentration goes negative during
CVODES Newton corrector iterations; with an unfortunate BDF history,
CVODES cannot reduce its step size enough to recover.

reduced=3 already used first_step=1e-14 to avoid this. Extend the same
small initial step to all reduced values so CVODES builds a consistent,
conservative integration history regardless of the host machine's
floating-point step-selection behavior.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
# Conflicts:
#	.ci/run_ci.sh
#	.woodpecker.yaml
#	CHANGES.rst
#	pyodesys/native/_base.py
#	pyodesys/native/sources/_gsl_wrapper.pyx
#	pyodesys/native/sources/_odeint_wrapper.pyx
#	pyodesys/native/sources/odesys_anyode.pxd
#	pyodesys/plotting.py
#	pyodesys/tests/test_robertson.py
#	pyodesys/util.py
#	scripts/render_notebooks.sh
#	setup.py
* Make sure anyode headers are distributed (#124)

* run tests for sdist install

* select all for tests

* move flags for compilation

* pass yes-flag to pip-uninstall

* move nogil

* bump commits

* nogil except +

* bjodahimg20dot -> triceratops-3:24

* ci: update paths and env

* exit on first failed test

* -std=c++11 -> -std=c++20

* .so -> EXT_SUFFIX in sysconfig

* avoid package from bdf2 branch

* relax test tolerances

* add appdirs to default requirements

* Bump CI image

* specify branch for AnyODE submodule

* update AnyODE

* relax maxnum steps for CI server

* Add boost to CPLUS_INCLUDE_PATH

* Relax nsteps param for test for CI server

* update CI image

* TST: max_num_test to see if CI failure is resolved

* split test

* run ci tests with 4 GiB RAM?

* handle flaky boost-odeint test

* mark flaky test xfail

* mark actual flaky test flaky

* Python 3 no longer needs to inherit from object

* Set PYTHONPATH during rendering of notebooks?

* matplotlib, kw: linthreshy -> linthresh

* Update matplotlib 3d projection code

* PYTHONPATH shenanigans

* About to release v0.14.5

* bump CI config

* patches

* drop pkg_resources

* fix import

* fix boost path

---------

Co-authored-by: ai-bot-bjodah <ai-bot-bjodah@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants