From 51c434afe082e8b6fd3580d362d02b8271626150 Mon Sep 17 00:00:00 2001 From: James Logan Date: Wed, 12 Nov 2025 21:24:01 -0500 Subject: [PATCH 1/5] update pip --- .readthedocs.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.readthedocs.yml b/.readthedocs.yml index b8a3f75..34f6677 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -14,6 +14,7 @@ build: pre_build: # Rust 1.90 required but not available yet - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal --default-toolchain 1.90.0 + - pip install -U pip mkdocs: configuration: mkdocs.yml From 1a22b942729885250f1009055edb8e5f8b27f08f Mon Sep 17 00:00:00 2001 From: James Logan Date: Thu, 13 Nov 2025 21:06:20 -0500 Subject: [PATCH 2/5] split throughput plots into separate linear and cubic --- benches/bench_cpu.py | 152 ++++++++---------- docs/1d_quality_of_fit_Rectilinear.html | 2 +- docs/1d_quality_of_fit_Rectilinear.svg | 2 +- docs/1d_quality_of_fit_Regular.html | 2 +- docs/1d_quality_of_fit_Regular.svg | 2 +- docs/2d_quality_of_fit_Rectilinear.html | 2 +- docs/2d_quality_of_fit_Rectilinear.svg | 2 +- docs/2d_quality_of_fit_Regular.html | 2 +- docs/2d_quality_of_fit_Regular.svg | 2 +- docs/3d_throughput_vs_nobs.html | 2 - docs/3d_throughput_vs_nobs.svg | 1 - docs/3d_throughput_vs_nobs_cubic.html | 2 + docs/3d_throughput_vs_nobs_cubic.svg | 1 + docs/3d_throughput_vs_nobs_linear.html | 2 + docs/3d_throughput_vs_nobs_linear.svg | 1 + docs/3d_throughput_vs_nobs_prealloc.html | 2 - docs/3d_throughput_vs_nobs_prealloc.svg | 1 - .../3d_throughput_vs_nobs_prealloc_cubic.html | 2 + docs/3d_throughput_vs_nobs_prealloc_cubic.svg | 1 + ...3d_throughput_vs_nobs_prealloc_linear.html | 2 + .../3d_throughput_vs_nobs_prealloc_linear.svg | 1 + docs/4d_throughput_vs_nobs.html | 2 - docs/4d_throughput_vs_nobs.svg | 1 - docs/4d_throughput_vs_nobs_cubic.html | 2 + docs/4d_throughput_vs_nobs_cubic.svg | 1 + docs/4d_throughput_vs_nobs_linear.html | 2 + docs/4d_throughput_vs_nobs_linear.svg | 1 + docs/4d_throughput_vs_nobs_prealloc.html | 2 - docs/4d_throughput_vs_nobs_prealloc.svg | 1 - .../4d_throughput_vs_nobs_prealloc_cubic.html | 2 + docs/4d_throughput_vs_nobs_prealloc_cubic.svg | 1 + ...4d_throughput_vs_nobs_prealloc_linear.html | 2 + .../4d_throughput_vs_nobs_prealloc_linear.svg | 1 + docs/nearest_quality_of_fit.html | 2 +- docs/nearest_quality_of_fit.svg | 2 +- docs/speedup_vs_dims_1000_obs_cubic.html | 2 +- docs/speedup_vs_dims_1000_obs_cubic.svg | 2 +- docs/speedup_vs_dims_1000_obs_linear.html | 2 +- docs/speedup_vs_dims_1000_obs_linear.svg | 2 +- docs/speedup_vs_dims_1_obs_cubic.html | 2 +- docs/speedup_vs_dims_1_obs_cubic.svg | 2 +- docs/speedup_vs_dims_1_obs_linear.html | 2 +- docs/speedup_vs_dims_1_obs_linear.svg | 2 +- docs/throughput_vs_dims_1000_obs.html | 2 +- docs/throughput_vs_dims_1000_obs.svg | 2 +- docs/throughput_vs_dims_1_obs.html | 2 +- docs/throughput_vs_dims_1_obs.svg | 2 +- 47 files changed, 110 insertions(+), 122 deletions(-) delete mode 100644 docs/3d_throughput_vs_nobs.html delete mode 100644 docs/3d_throughput_vs_nobs.svg create mode 100644 docs/3d_throughput_vs_nobs_cubic.html create mode 100644 docs/3d_throughput_vs_nobs_cubic.svg create mode 100644 docs/3d_throughput_vs_nobs_linear.html create mode 100644 docs/3d_throughput_vs_nobs_linear.svg delete mode 100644 docs/3d_throughput_vs_nobs_prealloc.html delete mode 100644 docs/3d_throughput_vs_nobs_prealloc.svg create mode 100644 docs/3d_throughput_vs_nobs_prealloc_cubic.html create mode 100644 docs/3d_throughput_vs_nobs_prealloc_cubic.svg create mode 100644 docs/3d_throughput_vs_nobs_prealloc_linear.html create mode 100644 docs/3d_throughput_vs_nobs_prealloc_linear.svg delete mode 100644 docs/4d_throughput_vs_nobs.html delete mode 100644 docs/4d_throughput_vs_nobs.svg create mode 100644 docs/4d_throughput_vs_nobs_cubic.html create mode 100644 docs/4d_throughput_vs_nobs_cubic.svg create mode 100644 docs/4d_throughput_vs_nobs_linear.html create mode 100644 docs/4d_throughput_vs_nobs_linear.svg delete mode 100644 docs/4d_throughput_vs_nobs_prealloc.html delete mode 100644 docs/4d_throughput_vs_nobs_prealloc.svg create mode 100644 docs/4d_throughput_vs_nobs_prealloc_cubic.html create mode 100644 docs/4d_throughput_vs_nobs_prealloc_cubic.svg create mode 100644 docs/4d_throughput_vs_nobs_prealloc_linear.html create mode 100644 docs/4d_throughput_vs_nobs_prealloc_linear.svg diff --git a/benches/bench_cpu.py b/benches/bench_cpu.py index c1871d0..4980286 100644 --- a/benches/bench_cpu.py +++ b/benches/bench_cpu.py @@ -92,13 +92,7 @@ def _plot_normalized_vs_nobs( title: str, output_path: Path, ) -> None: - fig = make_subplots( - rows=2, - cols=1, - subplot_titles=["Linear", "Cubic"], - horizontal_spacing=0.08, - ) - for row, kind in enumerate(["Linear", "Cubic"], start=1): + for kind in ["Linear", "Cubic"]: baseline_vals = throughputs.get(f"Scipy RegularGridInterpolator {kind}") if not baseline_vals: continue @@ -108,7 +102,7 @@ def _plot_normalized_vs_nobs( for name, values in throughputs.items() if kinds.get(name) == kind and values ] - + fig = make_subplots(rows=1, cols=1) for idx, (label, values) in enumerate(series): min_len = min(len(values), len(baseline_arr)) if min_len == 0: @@ -116,6 +110,12 @@ def _plot_normalized_vs_nobs( x_vals = np.array(ns[:min_len]) ratios = values[:min_len] / baseline_arr[:min_len] is_baseline = label.startswith("Scipy RegularGridInterpolator") + legend_name = "Scipy" if is_baseline else "InterpN" + showlegend = True + for trace in fig.data: + if trace.name == legend_name: + showlegend = False + break fig.add_trace( go.Scatter( x=x_vals, @@ -129,13 +129,9 @@ def _plot_normalized_vs_nobs( size=8, ), opacity=1.0, - name=label if not is_baseline else f"{label}
(baseline)", - showlegend=True, - legendgroup=kind, - legendgrouptitle_text=kind, - ), - row=row, - col=1, + name=legend_name, + showlegend=showlegend, + ) ) if not is_baseline and label.startswith("InterpN"): ones = np.ones_like(ratios) @@ -146,81 +142,61 @@ def _plot_normalized_vs_nobs( x=x_vals, upper=upper, lower=lower, - row=row, + row=1, col=1, ) - - fig.update_xaxes( - type="log", - row=1, - col=1, - showline=True, - linecolor="black", - linewidth=1, - mirror=True, - ticks="outside", - tickcolor="black", - showgrid=False, - zeroline=False, - ) - fig.update_xaxes( - type="log", - title_text="Number of Observation Points", - row=2, - col=1, - showline=True, - linecolor="black", - linewidth=1, - mirror=True, - ticks="outside", - tickcolor="black", - showgrid=False, - zeroline=False, - ) - fig.update_yaxes( - title_text="Speedup vs. Scipy", - row=1, - col=1, - showline=True, - linecolor="black", - linewidth=1, - mirror=True, - ticks="outside", - tickcolor="black", - showgrid=False, - zeroline=False, - ) - fig.update_yaxes( - row=2, - col=1, - showline=True, - linecolor="black", - linewidth=1, - mirror=True, - ticks="outside", - tickcolor="black", - showgrid=False, - zeroline=False, - ) - fig.update_layout( - title=dict(text=title, y=0.97, yanchor="top"), - height=450, - margin=dict(t=80, l=60, r=200, b=90), - legend=dict( - orientation="v", - yanchor="top", - y=1.0, - x=1.02, - xanchor="left", - ), - plot_bgcolor="rgba(0,0,0,0)", - paper_bgcolor="rgba(0,0,0,0)", - ) - fig.write_image(str(output_path)) - fig.write_html( - str(output_path.with_suffix(".html")), include_plotlyjs="cdn", full_html=False - ) - fig.show() + fig.update_xaxes( + type="log", + title_text="Number of Observation Points", + row=1, + col=1, + showline=True, + linecolor="black", + linewidth=1, + mirror=True, + ticks="outside", + tickcolor="black", + showgrid=False, + zeroline=False, + ) + fig.update_yaxes( + title_text="Normalized Throughput", + row=1, + col=1, + showline=True, + linecolor="black", + linewidth=1, + mirror=True, + ticks="outside", + tickcolor="black", + showgrid=False, + zeroline=False, + ) + fig.update_layout( + title=dict(text=f"{title}, {kind}", y=0.97, yanchor="top"), + height=400, + margin=dict(t=60, l=60, r=60, b=110), + legend=dict( + orientation="h", + yanchor="top", + y=1.0, + x=1.0, + xanchor="right", + ), + plot_bgcolor="rgba(0,0,0,0)", + paper_bgcolor="rgba(0,0,0,0)", + font=dict(color="black"), + ) + per_kind_output = output_path.with_stem( + output_path.stem + f"_{kind.lower()}" + ) + fig.write_image(str(per_kind_output)) + fig.write_html( + str(per_kind_output.with_suffix(".html")), + include_plotlyjs="cdn", + full_html=False, + ) + fig.show() def _plot_throughput_vs_dims( diff --git a/docs/1d_quality_of_fit_Rectilinear.html b/docs/1d_quality_of_fit_Rectilinear.html index 980ef49..1d24eaf 100644 --- a/docs/1d_quality_of_fit_Rectilinear.html +++ b/docs/1d_quality_of_fit_Rectilinear.html @@ -1,2 +1,2 @@
-
\ No newline at end of file +
\ No newline at end of file diff --git a/docs/1d_quality_of_fit_Rectilinear.svg b/docs/1d_quality_of_fit_Rectilinear.svg index 6e33a20..ebbda33 100644 --- a/docs/1d_quality_of_fit_Rectilinear.svg +++ b/docs/1d_quality_of_fit_Rectilinear.svg @@ -1 +1 @@ -05−1−0.500.51−1−0.500.51−202−200μ−100μ0−202−0.200.2−202−2−1.5−1−0.50DataInterpNSciPyInterpN ErrorSciPy ErrorComparison — InterpN vs. Scipy w/ Cubic InterpolantRectilinear Gridxxxf(x)ErrorQuadraticSineStepError, QuadraticError, SineError, Step \ No newline at end of file +05−1−0.500.51−1−0.500.51−202−200μ−100μ0−202−0.200.2−202−2−1.5−1−0.50DataInterpNSciPyInterpN ErrorSciPy ErrorComparison — InterpN vs. Scipy w/ Cubic InterpolantRectilinear Gridxxxf(x)ErrorQuadraticSineStepError, QuadraticError, SineError, Step \ No newline at end of file diff --git a/docs/1d_quality_of_fit_Regular.html b/docs/1d_quality_of_fit_Regular.html index 348df9d..981f84f 100644 --- a/docs/1d_quality_of_fit_Regular.html +++ b/docs/1d_quality_of_fit_Regular.html @@ -1,2 +1,2 @@
-
\ No newline at end of file +
\ No newline at end of file diff --git a/docs/1d_quality_of_fit_Regular.svg b/docs/1d_quality_of_fit_Regular.svg index cdfb92e..aac34c4 100644 --- a/docs/1d_quality_of_fit_Regular.svg +++ b/docs/1d_quality_of_fit_Regular.svg @@ -1 +1 @@ -05−1−0.500.51012−202−10f−5f0−202−0.200.2−202012DataInterpNSciPyInterpN ErrorSciPy ErrorComparison — InterpN vs. Scipy w/ Cubic InterpolantRegular Gridxxxf(x)ErrorQuadraticSineStepError, QuadraticError, SineError, Step \ No newline at end of file +05−1−0.500.51012−202−10f−5f0−202−0.200.2−202012DataInterpNSciPyInterpN ErrorSciPy ErrorComparison — InterpN vs. Scipy w/ Cubic InterpolantRegular Gridxxxf(x)ErrorQuadraticSineStepError, QuadraticError, SineError, Step \ No newline at end of file diff --git a/docs/2d_quality_of_fit_Rectilinear.html b/docs/2d_quality_of_fit_Rectilinear.html index de9434c..8771d5e 100644 --- a/docs/2d_quality_of_fit_Rectilinear.html +++ b/docs/2d_quality_of_fit_Rectilinear.html @@ -1,2 +1,2 @@
-
\ No newline at end of file +
\ No newline at end of file diff --git a/docs/2d_quality_of_fit_Rectilinear.svg b/docs/2d_quality_of_fit_Rectilinear.svg index ff77900..01f9a7a 100644 --- a/docs/2d_quality_of_fit_Rectilinear.svg +++ b/docs/2d_quality_of_fit_Rectilinear.svg @@ -1 +1 @@ -Sampled data1020304050−0.00200.002Quadratic Test Function w/ Cubic InterpolantRectilinear GridTruthInterpNSciPyError, InterpNError, SciPy \ No newline at end of file +Sampled data1020304050−0.00200.002Quadratic Test Function w/ Cubic InterpolantRectilinear GridTruthInterpNSciPyError, InterpNError, SciPy \ No newline at end of file diff --git a/docs/2d_quality_of_fit_Regular.html b/docs/2d_quality_of_fit_Regular.html index dc4a336..b15f0a6 100644 --- a/docs/2d_quality_of_fit_Regular.html +++ b/docs/2d_quality_of_fit_Regular.html @@ -1,2 +1,2 @@
-
\ No newline at end of file +
\ No newline at end of file diff --git a/docs/2d_quality_of_fit_Regular.svg b/docs/2d_quality_of_fit_Regular.svg index e7daff4..e846635 100644 --- a/docs/2d_quality_of_fit_Regular.svg +++ b/docs/2d_quality_of_fit_Regular.svg @@ -1 +1 @@ -Sampled data1020304050−500f0500fQuadratic Test Function w/ Cubic InterpolantRegular GridTruthInterpNSciPyError, InterpNError, SciPy \ No newline at end of file +Sampled data1020304050−500f0500fQuadratic Test Function w/ Cubic InterpolantRegular GridTruthInterpNSciPyError, InterpNError, SciPy \ No newline at end of file diff --git a/docs/3d_throughput_vs_nobs.html b/docs/3d_throughput_vs_nobs.html deleted file mode 100644 index 4591fc8..0000000 --- a/docs/3d_throughput_vs_nobs.html +++ /dev/null @@ -1,2 +0,0 @@ -
-
\ No newline at end of file diff --git a/docs/3d_throughput_vs_nobs.svg b/docs/3d_throughput_vs_nobs.svg deleted file mode 100644 index 635b133..0000000 --- a/docs/3d_throughput_vs_nobs.svg +++ /dev/null @@ -1 +0,0 @@ -12510251002510002510k010203012510251002510002510k2468LinearScipy RegularGridInterpolator Linear(baseline)InterpN MultilinearRegularInterpN MultilinearRectilinearInterpN NearestRegularInterpN NearestRectilinearCubicScipy RegularGridInterpolator Cubic(baseline)InterpN MulticubicRegularInterpN MulticubicRectilinearInterpolation on 20x20x20 GridWithout Preallocated OutputNumber of Observation PointsSpeedup vs. ScipyLinearCubic \ No newline at end of file diff --git a/docs/3d_throughput_vs_nobs_cubic.html b/docs/3d_throughput_vs_nobs_cubic.html new file mode 100644 index 0000000..cbb7076 --- /dev/null +++ b/docs/3d_throughput_vs_nobs_cubic.html @@ -0,0 +1,2 @@ +
+
\ No newline at end of file diff --git a/docs/3d_throughput_vs_nobs_cubic.svg b/docs/3d_throughput_vs_nobs_cubic.svg new file mode 100644 index 0000000..b169d33 --- /dev/null +++ b/docs/3d_throughput_vs_nobs_cubic.svg @@ -0,0 +1 @@ +12510251002510002510k2468ScipyInterpNInterpolation on 20x20x20 GridWithout Preallocated Output, CubicNumber of Observation PointsNormalized Throughput \ No newline at end of file diff --git a/docs/3d_throughput_vs_nobs_linear.html b/docs/3d_throughput_vs_nobs_linear.html new file mode 100644 index 0000000..0f6ef9d --- /dev/null +++ b/docs/3d_throughput_vs_nobs_linear.html @@ -0,0 +1,2 @@ +
+
\ No newline at end of file diff --git a/docs/3d_throughput_vs_nobs_linear.svg b/docs/3d_throughput_vs_nobs_linear.svg new file mode 100644 index 0000000..f8d0941 --- /dev/null +++ b/docs/3d_throughput_vs_nobs_linear.svg @@ -0,0 +1 @@ +12510251002510002510k0510152025ScipyInterpNInterpolation on 20x20x20 GridWithout Preallocated Output, LinearNumber of Observation PointsNormalized Throughput \ No newline at end of file diff --git a/docs/3d_throughput_vs_nobs_prealloc.html b/docs/3d_throughput_vs_nobs_prealloc.html deleted file mode 100644 index bdc40c5..0000000 --- a/docs/3d_throughput_vs_nobs_prealloc.html +++ /dev/null @@ -1,2 +0,0 @@ -
-
\ No newline at end of file diff --git a/docs/3d_throughput_vs_nobs_prealloc.svg b/docs/3d_throughput_vs_nobs_prealloc.svg deleted file mode 100644 index 44ccec9..0000000 --- a/docs/3d_throughput_vs_nobs_prealloc.svg +++ /dev/null @@ -1 +0,0 @@ -12510251002510002510k020406012510251002510002510k51015LinearScipy RegularGridInterpolator Linear(baseline)InterpN MultilinearRegularInterpN MultilinearRectilinearInterpN NearestRegularInterpN NearestRectilinearCubicScipy RegularGridInterpolator Cubic(baseline)InterpN MulticubicRegularInterpN MulticubicRectilinearInterpolation on 20x20x20 GridWith Preallocated OutputNumber of Observation PointsSpeedup vs. ScipyLinearCubic \ No newline at end of file diff --git a/docs/3d_throughput_vs_nobs_prealloc_cubic.html b/docs/3d_throughput_vs_nobs_prealloc_cubic.html new file mode 100644 index 0000000..e4e23c4 --- /dev/null +++ b/docs/3d_throughput_vs_nobs_prealloc_cubic.html @@ -0,0 +1,2 @@ +
+
\ No newline at end of file diff --git a/docs/3d_throughput_vs_nobs_prealloc_cubic.svg b/docs/3d_throughput_vs_nobs_prealloc_cubic.svg new file mode 100644 index 0000000..54dc2db --- /dev/null +++ b/docs/3d_throughput_vs_nobs_prealloc_cubic.svg @@ -0,0 +1 @@ +12510251002510002510k51015ScipyInterpNInterpolation on 20x20x20 GridWith Preallocated Output, CubicNumber of Observation PointsNormalized Throughput \ No newline at end of file diff --git a/docs/3d_throughput_vs_nobs_prealloc_linear.html b/docs/3d_throughput_vs_nobs_prealloc_linear.html new file mode 100644 index 0000000..b9787b9 --- /dev/null +++ b/docs/3d_throughput_vs_nobs_prealloc_linear.html @@ -0,0 +1,2 @@ +
+
\ No newline at end of file diff --git a/docs/3d_throughput_vs_nobs_prealloc_linear.svg b/docs/3d_throughput_vs_nobs_prealloc_linear.svg new file mode 100644 index 0000000..96250b6 --- /dev/null +++ b/docs/3d_throughput_vs_nobs_prealloc_linear.svg @@ -0,0 +1 @@ +12510251002510002510k0102030405060ScipyInterpNInterpolation on 20x20x20 GridWith Preallocated Output, LinearNumber of Observation PointsNormalized Throughput \ No newline at end of file diff --git a/docs/4d_throughput_vs_nobs.html b/docs/4d_throughput_vs_nobs.html deleted file mode 100644 index d0b9abb..0000000 --- a/docs/4d_throughput_vs_nobs.html +++ /dev/null @@ -1,2 +0,0 @@ -
-
\ No newline at end of file diff --git a/docs/4d_throughput_vs_nobs.svg b/docs/4d_throughput_vs_nobs.svg deleted file mode 100644 index 4dc5ae1..0000000 --- a/docs/4d_throughput_vs_nobs.svg +++ /dev/null @@ -1 +0,0 @@ -12510251002510002510k01020304012510251002510002510k2468LinearScipy RegularGridInterpolator Linear(baseline)InterpN MultilinearRegularInterpN MultilinearRectilinearInterpN NearestRegularInterpN NearestRectilinearCubicScipy RegularGridInterpolator Cubic(baseline)InterpN MulticubicRegularInterpN MulticubicRectilinearInterpolation on 20x...x20 4D GridWithout Preallocated OutputNumber of Observation PointsSpeedup vs. ScipyLinearCubic \ No newline at end of file diff --git a/docs/4d_throughput_vs_nobs_cubic.html b/docs/4d_throughput_vs_nobs_cubic.html new file mode 100644 index 0000000..d411f98 --- /dev/null +++ b/docs/4d_throughput_vs_nobs_cubic.html @@ -0,0 +1,2 @@ +
+
\ No newline at end of file diff --git a/docs/4d_throughput_vs_nobs_cubic.svg b/docs/4d_throughput_vs_nobs_cubic.svg new file mode 100644 index 0000000..4d9336e --- /dev/null +++ b/docs/4d_throughput_vs_nobs_cubic.svg @@ -0,0 +1 @@ +12510251002510002510k2468ScipyInterpNInterpolation on 20x...x20 4D GridWithout Preallocated Output, CubicNumber of Observation PointsNormalized Throughput \ No newline at end of file diff --git a/docs/4d_throughput_vs_nobs_linear.html b/docs/4d_throughput_vs_nobs_linear.html new file mode 100644 index 0000000..d374c9a --- /dev/null +++ b/docs/4d_throughput_vs_nobs_linear.html @@ -0,0 +1,2 @@ +
+
\ No newline at end of file diff --git a/docs/4d_throughput_vs_nobs_linear.svg b/docs/4d_throughput_vs_nobs_linear.svg new file mode 100644 index 0000000..2c71632 --- /dev/null +++ b/docs/4d_throughput_vs_nobs_linear.svg @@ -0,0 +1 @@ +12510251002510002510k010203040ScipyInterpNInterpolation on 20x...x20 4D GridWithout Preallocated Output, LinearNumber of Observation PointsNormalized Throughput \ No newline at end of file diff --git a/docs/4d_throughput_vs_nobs_prealloc.html b/docs/4d_throughput_vs_nobs_prealloc.html deleted file mode 100644 index c2b9bd4..0000000 --- a/docs/4d_throughput_vs_nobs_prealloc.html +++ /dev/null @@ -1,2 +0,0 @@ -
-
\ No newline at end of file diff --git a/docs/4d_throughput_vs_nobs_prealloc.svg b/docs/4d_throughput_vs_nobs_prealloc.svg deleted file mode 100644 index 289c6f8..0000000 --- a/docs/4d_throughput_vs_nobs_prealloc.svg +++ /dev/null @@ -1 +0,0 @@ -12510251002510002510k02040608012510251002510002510k510LinearScipy RegularGridInterpolator Linear(baseline)InterpN MultilinearRegularInterpN MultilinearRectilinearInterpN NearestRegularInterpN NearestRectilinearCubicScipy RegularGridInterpolator Cubic(baseline)InterpN MulticubicRegularInterpN MulticubicRectilinearInterpolation on 20x...x20 4D GridWith Preallocated OutputNumber of Observation PointsSpeedup vs. ScipyLinearCubic \ No newline at end of file diff --git a/docs/4d_throughput_vs_nobs_prealloc_cubic.html b/docs/4d_throughput_vs_nobs_prealloc_cubic.html new file mode 100644 index 0000000..4bc15b9 --- /dev/null +++ b/docs/4d_throughput_vs_nobs_prealloc_cubic.html @@ -0,0 +1,2 @@ +
+
\ No newline at end of file diff --git a/docs/4d_throughput_vs_nobs_prealloc_cubic.svg b/docs/4d_throughput_vs_nobs_prealloc_cubic.svg new file mode 100644 index 0000000..abc8a41 --- /dev/null +++ b/docs/4d_throughput_vs_nobs_prealloc_cubic.svg @@ -0,0 +1 @@ +12510251002510002510k510ScipyInterpNInterpolation on 20x...x20 4D GridWith Preallocated Output, CubicNumber of Observation PointsNormalized Throughput \ No newline at end of file diff --git a/docs/4d_throughput_vs_nobs_prealloc_linear.html b/docs/4d_throughput_vs_nobs_prealloc_linear.html new file mode 100644 index 0000000..fc5767d --- /dev/null +++ b/docs/4d_throughput_vs_nobs_prealloc_linear.html @@ -0,0 +1,2 @@ +
+
\ No newline at end of file diff --git a/docs/4d_throughput_vs_nobs_prealloc_linear.svg b/docs/4d_throughput_vs_nobs_prealloc_linear.svg new file mode 100644 index 0000000..2593256 --- /dev/null +++ b/docs/4d_throughput_vs_nobs_prealloc_linear.svg @@ -0,0 +1 @@ +12510251002510002510k020406080ScipyInterpNInterpolation on 20x...x20 4D GridWith Preallocated Output, LinearNumber of Observation PointsNormalized Throughput \ No newline at end of file diff --git a/docs/nearest_quality_of_fit.html b/docs/nearest_quality_of_fit.html index 66f8460..dfdf6e7 100644 --- a/docs/nearest_quality_of_fit.html +++ b/docs/nearest_quality_of_fit.html @@ -1,2 +1,2 @@
-
\ No newline at end of file +
\ No newline at end of file diff --git a/docs/nearest_quality_of_fit.svg b/docs/nearest_quality_of_fit.svg index 78d2c53..ff2f0ab 100644 --- a/docs/nearest_quality_of_fit.svg +++ b/docs/nearest_quality_of_fit.svg @@ -1 +1 @@ -Grid samples−1012−101Nearest-Neighbor Quality of Fit — InterpN vs. SciPy griddata (nearest)TruthInterpNSciPyError: InterpNError: SciPySciPy - InterpN \ No newline at end of file +Grid samples−1012−101Nearest-Neighbor Quality of Fit — InterpN vs. SciPy griddata (nearest)TruthInterpNSciPyError: InterpNError: SciPySciPy - InterpN \ No newline at end of file diff --git a/docs/speedup_vs_dims_1000_obs_cubic.html b/docs/speedup_vs_dims_1000_obs_cubic.html index 4a15780..36bb38e 100644 --- a/docs/speedup_vs_dims_1000_obs_cubic.html +++ b/docs/speedup_vs_dims_1000_obs_cubic.html @@ -1,2 +1,2 @@
-
\ No newline at end of file +
\ No newline at end of file diff --git a/docs/speedup_vs_dims_1000_obs_cubic.svg b/docs/speedup_vs_dims_1000_obs_cubic.svg index ab32f9e..de902c9 100644 --- a/docs/speedup_vs_dims_1000_obs_cubic.svg +++ b/docs/speedup_vs_dims_1000_obs_cubic.svg @@ -1 +1 @@ -12345624681012InterpN Speedup vs. ScipyCubic, 1000 Observation PointsNumber of DimensionsSpeedup vs. Scipy \ No newline at end of file +12345624681012InterpN Speedup vs. ScipyCubic, 1000 Observation PointsNumber of DimensionsSpeedup vs. Scipy \ No newline at end of file diff --git a/docs/speedup_vs_dims_1000_obs_linear.html b/docs/speedup_vs_dims_1000_obs_linear.html index f75ea5a..1637b0a 100644 --- a/docs/speedup_vs_dims_1000_obs_linear.html +++ b/docs/speedup_vs_dims_1000_obs_linear.html @@ -1,2 +1,2 @@
-
\ No newline at end of file +
\ No newline at end of file diff --git a/docs/speedup_vs_dims_1000_obs_linear.svg b/docs/speedup_vs_dims_1000_obs_linear.svg index 131ca0b..2661220 100644 --- a/docs/speedup_vs_dims_1000_obs_linear.svg +++ b/docs/speedup_vs_dims_1000_obs_linear.svg @@ -1 +1 @@ -123456246810InterpN Speedup vs. ScipyLinear, 1000 Observation PointsNumber of DimensionsSpeedup vs. Scipy \ No newline at end of file +123456246810InterpN Speedup vs. ScipyLinear, 1000 Observation PointsNumber of DimensionsSpeedup vs. Scipy \ No newline at end of file diff --git a/docs/speedup_vs_dims_1_obs_cubic.html b/docs/speedup_vs_dims_1_obs_cubic.html index 91923e2..178b7cd 100644 --- a/docs/speedup_vs_dims_1_obs_cubic.html +++ b/docs/speedup_vs_dims_1_obs_cubic.html @@ -1,2 +1,2 @@
-
\ No newline at end of file +
\ No newline at end of file diff --git a/docs/speedup_vs_dims_1_obs_cubic.svg b/docs/speedup_vs_dims_1_obs_cubic.svg index c79bbf2..2827ee2 100644 --- a/docs/speedup_vs_dims_1_obs_cubic.svg +++ b/docs/speedup_vs_dims_1_obs_cubic.svg @@ -1 +1 @@ -12345651015InterpN Speedup vs. ScipyCubic, 1 Observation PointNumber of DimensionsSpeedup vs. Scipy \ No newline at end of file +12345651015InterpN Speedup vs. ScipyCubic, 1 Observation PointNumber of DimensionsSpeedup vs. Scipy \ No newline at end of file diff --git a/docs/speedup_vs_dims_1_obs_linear.html b/docs/speedup_vs_dims_1_obs_linear.html index 9646c79..ae193a7 100644 --- a/docs/speedup_vs_dims_1_obs_linear.html +++ b/docs/speedup_vs_dims_1_obs_linear.html @@ -1,2 +1,2 @@
-
\ No newline at end of file +
\ No newline at end of file diff --git a/docs/speedup_vs_dims_1_obs_linear.svg b/docs/speedup_vs_dims_1_obs_linear.svg index 6c69a66..2d676d6 100644 --- a/docs/speedup_vs_dims_1_obs_linear.svg +++ b/docs/speedup_vs_dims_1_obs_linear.svg @@ -1 +1 @@ -123456050100150200InterpN Speedup vs. ScipyLinear, 1 Observation PointNumber of DimensionsSpeedup vs. Scipy \ No newline at end of file +123456050100150200InterpN Speedup vs. ScipyLinear, 1 Observation PointNumber of DimensionsSpeedup vs. Scipy \ No newline at end of file diff --git a/docs/throughput_vs_dims_1000_obs.html b/docs/throughput_vs_dims_1000_obs.html index ebca626..97e3b20 100644 --- a/docs/throughput_vs_dims_1000_obs.html +++ b/docs/throughput_vs_dims_1000_obs.html @@ -1,2 +1,2 @@
-
\ No newline at end of file +
\ No newline at end of file diff --git a/docs/throughput_vs_dims_1000_obs.svg b/docs/throughput_vs_dims_1000_obs.svg index 9b602b7..ffed13b 100644 --- a/docs/throughput_vs_dims_1000_obs.svg +++ b/docs/throughput_vs_dims_1000_obs.svg @@ -1 +1 @@ -246250.01250.12512460.0010.010.11LinearScipy RegularGridInterpolator LinearInterpN MultilinearRegularInterpN MultilinearRectilinearInterpN NearestRegularInterpN NearestRectilinearNumpy InterpCubicScipy RegularGridInterpolator CubicInterpN MulticubicRegularInterpN MulticubicRectilinearScipy RectBivariateSpline CubicInterpolation on 4x...x4 N-Dimensional Grid1000 Observation PointsNumber of DimensionsNormalized ThroughputLinearCubic \ No newline at end of file +246250.01250.12512460.0010.010.11LinearScipy RegularGridInterpolator LinearInterpN MultilinearRegularInterpN MultilinearRectilinearInterpN NearestRegularInterpN NearestRectilinearNumpy InterpCubicScipy RegularGridInterpolator CubicInterpN MulticubicRegularInterpN MulticubicRectilinearScipy RectBivariateSpline CubicInterpolation on 4x...x4 N-Dimensional Grid1000 Observation PointsNumber of DimensionsNormalized ThroughputLinearCubic \ No newline at end of file diff --git a/docs/throughput_vs_dims_1_obs.html b/docs/throughput_vs_dims_1_obs.html index 1ccb288..463def2 100644 --- a/docs/throughput_vs_dims_1_obs.html +++ b/docs/throughput_vs_dims_1_obs.html @@ -1,2 +1,2 @@
-
\ No newline at end of file +
\ No newline at end of file diff --git a/docs/throughput_vs_dims_1_obs.svg b/docs/throughput_vs_dims_1_obs.svg index 19bacdb..a7200ef 100644 --- a/docs/throughput_vs_dims_1_obs.svg +++ b/docs/throughput_vs_dims_1_obs.svg @@ -1 +1 @@ -246250.01250.125122460.01250.1251LinearScipy RegularGridInterpolator LinearInterpN MultilinearRegularInterpN MultilinearRectilinearInterpN NearestRegularInterpN NearestRectilinearNumpy InterpCubicScipy RegularGridInterpolator CubicInterpN MulticubicRegularInterpN MulticubicRectilinearScipy RectBivariateSpline CubicInterpolation on 4x...x4 N-Dimensional Grid1 Observation PointNumber of DimensionsNormalized ThroughputLinearCubic \ No newline at end of file +2460.001250.01250.125122460.01250.1251LinearScipy RegularGridInterpolator LinearInterpN MultilinearRegularInterpN MultilinearRectilinearInterpN NearestRegularInterpN NearestRectilinearNumpy InterpCubicScipy RegularGridInterpolator CubicInterpN MulticubicRegularInterpN MulticubicRectilinearScipy RectBivariateSpline CubicInterpolation on 4x...x4 N-Dimensional Grid1 Observation PointNumber of DimensionsNormalized ThroughputLinearCubic \ No newline at end of file From 1b23fc80879f8feef14211a631f42eaaa0bf3796 Mon Sep 17 00:00:00 2001 From: James Logan Date: Thu, 13 Nov 2025 21:38:08 -0500 Subject: [PATCH 3/5] use html plots for docs --- docs/1d_quality_of_fit_Rectilinear.html | 2 +- docs/1d_quality_of_fit_Rectilinear.svg | 2 +- docs/1d_quality_of_fit_Regular.html | 2 +- docs/1d_quality_of_fit_Regular.svg | 2 +- docs/2d_quality_of_fit_Rectilinear.html | 2 +- docs/2d_quality_of_fit_Rectilinear.svg | 2 +- docs/2d_quality_of_fit_Regular.html | 2 +- docs/2d_quality_of_fit_Regular.svg | 2 +- docs/index.md | 8 +++++- docs/nearest_quality_of_fit.html | 2 +- docs/nearest_quality_of_fit.svg | 2 +- docs/perf.md | 35 ++++++++++++++++++++----- docs/stylesheets/extra.css | 5 ++++ examples/cubic_comparison.py | 20 +++++++------- examples/nearest_comparison.py | 10 +++---- mkdocs.yml | 10 +++++-- 16 files changed, 74 insertions(+), 34 deletions(-) create mode 100644 docs/stylesheets/extra.css diff --git a/docs/1d_quality_of_fit_Rectilinear.html b/docs/1d_quality_of_fit_Rectilinear.html index 1d24eaf..cf01bf4 100644 --- a/docs/1d_quality_of_fit_Rectilinear.html +++ b/docs/1d_quality_of_fit_Rectilinear.html @@ -1,2 +1,2 @@
-
\ No newline at end of file +
\ No newline at end of file diff --git a/docs/1d_quality_of_fit_Rectilinear.svg b/docs/1d_quality_of_fit_Rectilinear.svg index ebbda33..b258c2f 100644 --- a/docs/1d_quality_of_fit_Rectilinear.svg +++ b/docs/1d_quality_of_fit_Rectilinear.svg @@ -1 +1 @@ -05−1−0.500.51−1−0.500.51−202−200μ−100μ0−202−0.200.2−202−2−1.5−1−0.50DataInterpNSciPyInterpN ErrorSciPy ErrorComparison — InterpN vs. Scipy w/ Cubic InterpolantRectilinear Gridxxxf(x)ErrorQuadraticSineStepError, QuadraticError, SineError, Step \ No newline at end of file +05−1−0.500.51−1−0.500.51−202−200μ−100μ0−202−0.200.2−202−2−1.5−1−0.50DataInterpNScipyInterpN ErrorScipy ErrorComparison — InterpN vs. Scipy w/ Cubic InterpolantRectilinear Gridxxxf(x)ErrorQuadraticSineStepError, QuadraticError, SineError, Step \ No newline at end of file diff --git a/docs/1d_quality_of_fit_Regular.html b/docs/1d_quality_of_fit_Regular.html index 981f84f..b4dd8e4 100644 --- a/docs/1d_quality_of_fit_Regular.html +++ b/docs/1d_quality_of_fit_Regular.html @@ -1,2 +1,2 @@
-
\ No newline at end of file +
\ No newline at end of file diff --git a/docs/1d_quality_of_fit_Regular.svg b/docs/1d_quality_of_fit_Regular.svg index aac34c4..fd3b512 100644 --- a/docs/1d_quality_of_fit_Regular.svg +++ b/docs/1d_quality_of_fit_Regular.svg @@ -1 +1 @@ -05−1−0.500.51012−202−10f−5f0−202−0.200.2−202012DataInterpNSciPyInterpN ErrorSciPy ErrorComparison — InterpN vs. Scipy w/ Cubic InterpolantRegular Gridxxxf(x)ErrorQuadraticSineStepError, QuadraticError, SineError, Step \ No newline at end of file +05−1−0.500.51012−202−10f−5f0−202−0.200.2−202012DataInterpNScipyInterpN ErrorScipy ErrorComparison — InterpN vs. Scipy w/ Cubic InterpolantRegular Gridxxxf(x)ErrorQuadraticSineStepError, QuadraticError, SineError, Step \ No newline at end of file diff --git a/docs/2d_quality_of_fit_Rectilinear.html b/docs/2d_quality_of_fit_Rectilinear.html index 8771d5e..b218428 100644 --- a/docs/2d_quality_of_fit_Rectilinear.html +++ b/docs/2d_quality_of_fit_Rectilinear.html @@ -1,2 +1,2 @@
-
\ No newline at end of file +
\ No newline at end of file diff --git a/docs/2d_quality_of_fit_Rectilinear.svg b/docs/2d_quality_of_fit_Rectilinear.svg index 01f9a7a..39d73b8 100644 --- a/docs/2d_quality_of_fit_Rectilinear.svg +++ b/docs/2d_quality_of_fit_Rectilinear.svg @@ -1 +1 @@ -Sampled data1020304050−0.00200.002Quadratic Test Function w/ Cubic InterpolantRectilinear GridTruthInterpNSciPyError, InterpNError, SciPy \ No newline at end of file +Sampled data1020304050−0.00200.002Quadratic Test Function w/ Cubic InterpolantRectilinear GridTruthInterpNScipyError, InterpNError, Scipy \ No newline at end of file diff --git a/docs/2d_quality_of_fit_Regular.html b/docs/2d_quality_of_fit_Regular.html index b15f0a6..1e4bb85 100644 --- a/docs/2d_quality_of_fit_Regular.html +++ b/docs/2d_quality_of_fit_Regular.html @@ -1,2 +1,2 @@
-
\ No newline at end of file +
\ No newline at end of file diff --git a/docs/2d_quality_of_fit_Regular.svg b/docs/2d_quality_of_fit_Regular.svg index e846635..dc91922 100644 --- a/docs/2d_quality_of_fit_Regular.svg +++ b/docs/2d_quality_of_fit_Regular.svg @@ -1 +1 @@ -Sampled data1020304050−500f0500fQuadratic Test Function w/ Cubic InterpolantRegular GridTruthInterpNSciPyError, InterpNError, SciPy \ No newline at end of file +Sampled data1020304050−500f0500fQuadratic Test Function w/ Cubic InterpolantRegular GridTruthInterpNScipyError, InterpNError, Scipy \ No newline at end of file diff --git a/docs/index.md b/docs/index.md index 70c7fc5..3c4ef88 100644 --- a/docs/index.md +++ b/docs/index.md @@ -26,7 +26,13 @@ The methods provided here, while more limited in scope than scipy's, * can also be used easily in web and embedded applications via the Rust library * are permissively licensed -![ND throughput 1000 obs](./throughput_vs_dims_1000_obs.svg) +--8<-- +docs/speedup_vs_dims_1_obs_linear.html +--8<-- + +--8<-- +docs/speedup_vs_dims_1_obs_cubic.html +--8<-- See [here](https://interpnpy.readthedocs.io/en/latest/perf/) for more info about quality-of-fit, throughput, and memory usage. diff --git a/docs/nearest_quality_of_fit.html b/docs/nearest_quality_of_fit.html index dfdf6e7..4a8ce70 100644 --- a/docs/nearest_quality_of_fit.html +++ b/docs/nearest_quality_of_fit.html @@ -1,2 +1,2 @@
-
\ No newline at end of file +
\ No newline at end of file diff --git a/docs/nearest_quality_of_fit.svg b/docs/nearest_quality_of_fit.svg index ff2f0ab..503b8a5 100644 --- a/docs/nearest_quality_of_fit.svg +++ b/docs/nearest_quality_of_fit.svg @@ -1 +1 @@ -Grid samples−1012−101Nearest-Neighbor Quality of Fit — InterpN vs. SciPy griddata (nearest)TruthInterpNSciPyError: InterpNError: SciPySciPy - InterpN \ No newline at end of file +Grid samples−1012−101Nearest-Neighbor Quality of Fit — InterpN vs. Scipy griddata (nearest)TruthInterpNScipyError: InterpNError: ScipyScipy - InterpN \ No newline at end of file diff --git a/docs/perf.md b/docs/perf.md index 3e694f6..3ca56ff 100644 --- a/docs/perf.md +++ b/docs/perf.md @@ -10,16 +10,25 @@ The linear methods' quality of fit, being linear, is not very interesting. ### 1D Cubic Interpolation & Extrapolation InterpN shows significantly improvements in both numerical error and quality-of-fit, especially where sharp changes or strong higher derivatives are present. -![1D cubic quality of fit](./1d_quality_of_fit_Rectilinear.svg) + +--8<-- +docs/1d_quality_of_fit_Rectilinear.html +--8<-- ### 2D Cubic Interpolation & Extrapolation Both InterpN and Scipy methods can full capture a quadratic function in arbitrary dimensions, including under extrapolation. However, InterpN produces several orders of magnitude less floating point error, despite requiring significantly less run time. -![2D cubic](./2d_quality_of_fit_Rectilinear.svg) + +--8<-- +docs/2d_quality_of_fit_Rectilinear.html +--8<-- ### 2D Nearest-Neighbor Interpolation & Extrapolation InterpN's regular- and rectilinear- grid nearest-neighbor methods match scipy griddata at all tested conditions. Midpoint tie-breaking is not guaranteed to match exactly. -![2D nearest](./nearest_quality_of_fit.svg) + +--8<-- +docs/nearest_quality_of_fit.html +--8<-- ---- ## Throughput @@ -36,7 +45,10 @@ are shown to highlight that InterpN achieves parity even with specialized low-di despite not specifically handling low-dimensional special cases. #### 1000 Observation Points -![ND throughput 1000 obs](./throughput_vs_dims_1000_obs.svg) + +--8<-- +docs/throughput_vs_dims_1000_obs.html +--8<-- #### 1 Observation Point For evaluating a single point at a time, the 1D-specialized `numpy.interp` is somewhat faster, @@ -49,13 +61,24 @@ the interpolator object (which removes the timing effect of their initial linear performing a warmup that clears an appropriately-sized region of memory for allocation. This discrepancy also vanishes for higher numbers of observation points. -![ND throughput 1 obs](./throughput_vs_dims_1_obs.svg) +--8<-- +docs/speedup_vs_dims_1_obs_linear.html +--8<-- +--8<-- +docs/speedup_vs_dims_1_obs_cubic.html +--8<-- ### 3D Throughput vs. Input Size Evaluating points in large batches is substantially faster than one-at-a-time for all tested methods. -![3D linear throughput](./3d_throughput_vs_nobs.svg) +--8<-- +docs/3d_throughput_vs_nobs_prealloc_linear.html +--8<-- + +--8<-- +docs/3d_throughput_vs_nobs_prealloc_cubic.html +--8<-- ---- ## Memory Usage diff --git a/docs/stylesheets/extra.css b/docs/stylesheets/extra.css new file mode 100644 index 0000000..bdfeae1 --- /dev/null +++ b/docs/stylesheets/extra.css @@ -0,0 +1,5 @@ + +.plotly-graph-div { + filter: invert(100%) hue-rotate(180deg); +} + diff --git a/examples/cubic_comparison.py b/examples/cubic_comparison.py index c1a4531..bc71b0c 100644 --- a/examples/cubic_comparison.py +++ b/examples/cubic_comparison.py @@ -126,14 +126,14 @@ def _axis_name(prefix: str, row: int, col: int, ncols: int) -> str: mode="lines", line=dict(color="black", width=2, dash="dot"), opacity=0.7, - name="SciPy", + name="Scipy", legendgroup="scipy", - showlegend="SciPy" not in legend_tracker, + showlegend="Scipy" not in legend_tracker, ), row=1, col=col, ) - legend_tracker.add("SciPy") + legend_tracker.add("Scipy") truth = fn(xinterp) fig_1d.add_trace( @@ -157,14 +157,14 @@ def _axis_name(prefix: str, row: int, col: int, ncols: int) -> str: mode="lines", line=dict(color="black", width=2, dash="dot"), opacity=0.7, - name="SciPy Error", + name="Scipy Error", legendgroup="scipy_err", - showlegend="SciPy Error" not in legend_tracker, + showlegend="Scipy Error" not in legend_tracker, ), row=2, col=col, ) - legend_tracker.add("SciPy Error") + legend_tracker.add("Scipy Error") for col in range(1, 4): fig_1d.update_xaxes(title_text="x", row=2, col=col) @@ -267,10 +267,10 @@ def _axis_name(prefix: str, row: int, col: int, ncols: int) -> str: subplot_titles=[ "Truth", "InterpN", - "SciPy", + "Scipy", "", "Error, InterpN", - "Error, SciPy", + "Error, Scipy", ], horizontal_spacing=0.06, vertical_spacing=0.18, @@ -281,7 +281,7 @@ def _axis_name(prefix: str, row: int, col: int, ncols: int) -> str: [ (zinterp, "Truth"), (z_interpn, "InterpN"), - (z_sp, "SciPy"), + (z_sp, "Scipy"), ], start=1, ): @@ -364,7 +364,7 @@ def _axis_name(prefix: str, row: int, col: int, ncols: int) -> str: for col, (z_data, name) in enumerate( [ (z_interpn - zinterp, "Error, InterpN"), - (z_sp - zinterp, "Error, SciPy"), + (z_sp - zinterp, "Error, Scipy"), ], start=2, ): diff --git a/examples/nearest_comparison.py b/examples/nearest_comparison.py index b8097cc..1f6df8e 100644 --- a/examples/nearest_comparison.py +++ b/examples/nearest_comparison.py @@ -1,7 +1,7 @@ """ Generate a quality-of-fit comparison figure for nearest-neighbor interpolation. -This script compares InterpN's nearest-neighbor interpolator against SciPy's +This script compares InterpN's nearest-neighbor interpolator against Scipy's ``griddata`` with the ``nearest`` method on a slightly irregular rectilinear grid. The resulting SVG is saved into the ``docs`` directory. """ @@ -89,10 +89,10 @@ def _axis_name(prefix: str, row: int, col: int, ncols: int) -> str: plots = [ (z_truth, "Truth", False), (interpn_vals, "InterpN", False), - (griddata_vals, "SciPy", False), + (griddata_vals, "Scipy", False), (interpn_vals - z_truth, "Error: InterpN", True), - (griddata_vals - z_truth, "Error: SciPy", True), - (griddata_vals - interpn_vals, "SciPy - InterpN", True), + (griddata_vals - z_truth, "Error: Scipy", True), + (griddata_vals - interpn_vals, "Scipy - InterpN", True), ] fig = make_subplots( @@ -161,7 +161,7 @@ def _axis_name(prefix: str, row: int, col: int, ncols: int) -> str: fig.update_layout( title=dict( text="Nearest-Neighbor Quality of Fit —" - " InterpN vs. SciPy griddata (nearest)", + " InterpN vs. Scipy griddata (nearest)", y=0.97, yanchor="top", ), diff --git a/mkdocs.yml b/mkdocs.yml index 970bd77..abcfb69 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -25,14 +25,20 @@ theme: features: - search.suggest - search.highlight + plugins: - mkdocstrings - search + markdown_extensions: - pymdownx.highlight: anchor_linenums: true line_spans: __span pygments_lang_class: true - pymdownx.inlinehilite - - pymdownx.snippets - - pymdownx.superfences \ No newline at end of file + - pymdownx.snippets: + check_paths: true + - pymdownx.superfences + +extra_css: + - stylesheets/extra.css \ No newline at end of file From 65341f362790c214c20da9687ddbbd68b86c895a Mon Sep 17 00:00:00 2001 From: James Logan Date: Thu, 13 Nov 2025 21:40:06 -0500 Subject: [PATCH 4/5] update docs --- docs/perf.md | 5 ----- docs/stylesheets/extra.css | 6 ++++-- mkdocs.yml | 33 +++++++++++++++++---------------- 3 files changed, 21 insertions(+), 23 deletions(-) diff --git a/docs/perf.md b/docs/perf.md index 3ca56ff..18c8ab4 100644 --- a/docs/perf.md +++ b/docs/perf.md @@ -92,8 +92,3 @@ The linear methods all use roughly the same amount of RAM during evaluation. In The memory profiler picks up a large amount of RAM that is not actually part of the function evaluation, but belongs to the outer process. As a result, all methods show a bogus memory usage floor of about 97MB. ![ND memory usage](./ram_vs_dims.svg) - ----- -## Profile-Guided Optimisation - -To build the extension with profile-guided optimization using pre-built profiles, do `sh ./scripts/distr_pgo_install.sh`. You can also generate your own PGO profiles like `sh ./scripts/distr_pgo_profile.sh`. diff --git a/docs/stylesheets/extra.css b/docs/stylesheets/extra.css index bdfeae1..5a41d18 100644 --- a/docs/stylesheets/extra.css +++ b/docs/stylesheets/extra.css @@ -1,5 +1,7 @@ -.plotly-graph-div { - filter: invert(100%) hue-rotate(180deg); +@media (prefers-color-scheme: dark) { + .plotly-graph-div { + filter: invert(100%) hue-rotate(180deg); + } } diff --git a/mkdocs.yml b/mkdocs.yml index abcfb69..97fcc44 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -6,22 +6,23 @@ theme: - python palette: # Palette toggle for automatic mode - - media: "(prefers-color-scheme)" - toggle: - icon: material/brightness-auto - name: Switch to light mode - # Palette toggle for dark mode - - media: "(prefers-color-scheme: dark)" - scheme: slate - toggle: - icon: material/brightness-4 - name: Switch to light mode - # Palette toggle for light mode - - media: "(prefers-color-scheme: light)" - scheme: default - toggle: - icon: material/brightness-7 - name: Switch to dark mode + # - media: "(prefers-color-scheme)" + # toggle: + # icon: material/brightness-auto + # name: Switch to light mode + # # Palette toggle for dark mode + # - media: "(prefers-color-scheme: dark)" + # scheme: slate + # toggle: + # icon: material/brightness-4 + # name: Switch to light mode + # # Palette toggle for light mode + # - media: "(prefers-color-scheme: light)" + # scheme: default + # toggle: + # icon: material/brightness-7 + # name: Switch to dark mode + scheme: slate features: - search.suggest - search.highlight From 88fb79a9ce529f27a6b2af4130f8117490ec48cf Mon Sep 17 00:00:00 2001 From: James Logan Date: Thu, 13 Nov 2025 21:53:02 -0500 Subject: [PATCH 5/5] fmt --- benches/bench_cpu.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/benches/bench_cpu.py b/benches/bench_cpu.py index 4980286..496cbc8 100644 --- a/benches/bench_cpu.py +++ b/benches/bench_cpu.py @@ -187,9 +187,7 @@ def _plot_normalized_vs_nobs( paper_bgcolor="rgba(0,0,0,0)", font=dict(color="black"), ) - per_kind_output = output_path.with_stem( - output_path.stem + f"_{kind.lower()}" - ) + per_kind_output = output_path.with_stem(output_path.stem + f"_{kind.lower()}") fig.write_image(str(per_kind_output)) fig.write_html( str(per_kind_output.with_suffix(".html")),