Skip to content

Commit 635669f

Browse files
authored
Update the citation info for solve_adaptive_save_at (#814)
* Update the citation info for solve_adaptive_save_at * Fix linter-complaints in the tests
1 parent 0bc9d73 commit 635669f

6 files changed

Lines changed: 42 additions & 28 deletions

File tree

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ default_language_version:
33
python: python3
44
repos:
55
- repo: https://github.com/pre-commit/pre-commit-hooks
6-
rev: v5.0.0
6+
rev: v6.0.0
77
hooks:
88
- id: end-of-file-fixer
99
- id: check-merge-conflict
@@ -13,15 +13,15 @@ repos:
1313
- id: yamlfix
1414
- repo: https://github.com/astral-sh/ruff-pre-commit
1515
# Ruff version.
16-
rev: v0.9.9
16+
rev: v0.12.10
1717
hooks:
1818
# Run the linter.
1919
- id: ruff
2020
args: [--fix]
2121
# Run the formatter.
2222
- id: ruff-format
2323
- repo: https://github.com/pre-commit/mirrors-mypy
24-
rev: v1.15.0
24+
rev: v1.17.1
2525
hooks:
2626
- id: mypy
2727
args: [--ignore-missing-imports, --check-untyped-defs]

README.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,17 @@ A PDF is available [at this link](https://tobias-lib.ub.uni-tuebingen.de/xmlui/h
8585

8686
If you use the solve-and-save-at functionality, please cite
8787
```bibtex
88-
@article{krämer2024adaptive,
89-
title={Adaptive Probabilistic {ODE} Solvers Without Adaptive Memory Requirements},
90-
author={Kr{\"a}mer, Nicholas},
91-
year={2024},
92-
eprint={2410.10530},
93-
archivePrefix={arXiv},
94-
url={https://arxiv.org/abs/2410.10530},
88+
@InProceedings{kramer2024adaptive,
89+
title = {Adaptive Probabilistic ODE Solvers Without Adaptive Memory Requirements},
90+
author = {Kr\"{a}mer, Nicholas},
91+
booktitle = {Proceedings of the First International Conference on Probabilistic Numerics},
92+
pages = {12--24},
93+
year = {2025},
94+
editor = {Kanagawa, Motonobu and Cockayne, Jon and Gessner, Alexandra and Hennig, Philipp},
95+
volume = {271},
96+
series = {Proceedings of Machine Learning Research},
97+
publisher = {PMLR},
98+
url = {https://proceedings.mlr.press/v271/kramer25a.html}
9599
}
96100
```
97101
This article introduced the algorithm we use.

probdiffeq/ivpsolve.py

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -128,26 +128,29 @@ def solve_adaptive_save_at(
128128
) -> IVPSolution:
129129
r"""Solve an initial value problem and return the solution at a pre-determined grid.
130130
131-
This algorithm implements the method by Krämer (2024).
132-
Please consider citing it if you use it for your research.
133-
A PDF is available [here](https://arxiv.org/abs/2410.10530)
134-
and Krämer's (2024) experiments are
135-
[here](https://github.com/pnkraemer/code-adaptive-prob-ode-solvers).
136-
131+
This algorithm implements the method by Krämer (2024). Please consider citing it
132+
if you use it for your research. A PDF is available
133+
[here](https://arxiv.org/abs/2410.10530) and Krämer's (2024) experiments are
134+
available [here](https://github.com/pnkraemer/code-adaptive-prob-ode-solvers).
137135
138136
??? note "BibTex for Krämer (2024)"
139137
```bibtex
140-
@article{krämer2024adaptive,
141-
title={Adaptive Probabilistic {ODE} Solvers Without
142-
Adaptive Memory Requirements},
143-
author={Kr{\"a}mer, Nicholas},
144-
year={2024},
145-
eprint={2410.10530},
146-
archivePrefix={arXiv},
147-
url={https://arxiv.org/abs/2410.10530},
138+
@InProceedings{kramer2024adaptive,
139+
title = {Adaptive Probabilistic ODE Solvers Without Adaptive Memory
140+
Requirements},
141+
author = {Kr\"{a}mer, Nicholas},
142+
booktitle = {Proceedings of the First International Conference on
143+
Probabilistic Numerics},
144+
pages = {12--24},
145+
year = {2025},
146+
editor = {Kanagawa, Motonobu and Cockayne, Jon and Gessner, Alexandra
147+
and Hennig, Philipp},
148+
volume = {271},
149+
series = {Proceedings of Machine Learning Research},
150+
publisher = {PMLR},
151+
url = {https://proceedings.mlr.press/v271/kramer25a.html}
148152
}
149153
```
150-
151154
"""
152155
if not adaptive_solver.solver.is_suitable_for_save_at:
153156
msg = (

tests/test_ivpsolvers/test_controllers.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,13 @@
22

33
from probdiffeq import ivpsolvers
44
from probdiffeq.backend import numpy as np
5+
from probdiffeq.backend import testing
56

67

7-
def test_equivalence_pi_vs_i(dt=0.1428, error_power=3.142, num_applies=4):
8+
@testing.parametrize("dt", [0.1428])
9+
@testing.parametrize("error_power", [3.142])
10+
@testing.parametrize("num_applies", [4])
11+
def test_equivalence_pi_vs_i(dt, error_power, num_applies):
812
ctrl_pi = ivpsolvers.control_proportional_integral(
913
power_integral_unscaled=1.0, power_proportional_unscaled=0.0
1014
)

tests/test_ivpsolvers/test_cubature_equivalence.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
from probdiffeq import ivpsolvers
44
from probdiffeq.backend import numpy as np
5+
from probdiffeq.backend import testing
56

67

78
def test_third_order_spherical_vs_unscented_transform_scalar_input():
@@ -16,7 +17,8 @@ def test_third_order_spherical_vs_unscented_transform_scalar_input():
1617
assert np.allclose(x[2:], y[1:])
1718

1819

19-
def test_third_order_spherical_vs_unscented_transform(n=4):
20+
@testing.parametrize("n", [4])
21+
def test_third_order_spherical_vs_unscented_transform(n):
2022
"""Assert that UT with r=0 equals the third-order spherical rule."""
2123
tos = ivpsolvers.cubature_third_order_spherical(input_shape=(n,))
2224
ut = ivpsolvers.cubature_unscented_transform(input_shape=(n,), r=0.0)

tests/test_taylor/test_affine_recursion.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66

77

88
@testing.parametrize("num", [1, 2, 4])
9-
def test_affine_recursion(num, num_derivatives_max=5):
9+
@testing.parametrize("num_derivatives_max", [5])
10+
def test_affine_recursion(num, num_derivatives_max):
1011
"""The approximation should coincide with the reference."""
1112
f, init, solution = _affine_problem(num_derivatives_max)
1213

0 commit comments

Comments
 (0)