Skip to content

Commit 2001c0f

Browse files
authored
Merge pull request #45 from biosustain/fix_sphinx_docs
📝 Fix documentation
2 parents 8ad358e + 29db0ac commit 2001c0f

File tree

3 files changed

+25
-477
lines changed

3 files changed

+25
-477
lines changed

docs/tutorial/analysis.ipynb

Lines changed: 15 additions & 473 deletions
Large diffs are not rendered by default.

docs/tutorial/plotting.ipynb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@
107107
" N,\n",
108108
" model_family=\"all\", # Include mechanistic, phenomenological, and non-parametric\n",
109109
" phase_boundary_method=\"tangent\", # tangent or threshold\n",
110-
" spline_s=0.2,\n",
110+
" spline=0.2,\n",
111111
" window_points=7,\n",
112112
")\n",
113113
"\n",
@@ -245,7 +245,7 @@
245245
" N,\n",
246246
" model_family=\"all\", # Include mechanistic, phenomenological, and non-parametric\n",
247247
" phase_boundary_method=\"tangent\", # tangent or threshold\n",
248-
" spline_s=0.2,\n",
248+
" spline=0.2,\n",
249249
" window_points=7,\n",
250250
")\n",
251251
"\n",
@@ -325,7 +325,7 @@
325325
"source": [
326326
"# Phase boundary comparison on spline fit\n",
327327
"fit_spline = gc.non_parametric.fit_non_parametric(\n",
328-
" t, N, method=\"spline\", spline_s=0.2, window_points=7\n",
328+
" t, N, method=\"spline\", spline=0.2, window_points=7\n",
329329
")\n",
330330
"\n",
331331
"phase_boundary_rows = []\n",

src/growthcurves/non_parametric.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,16 @@
66
All methods operate in linear OD space (not log-transformed).
77
"""
88

9+
from logging import getLogger
10+
911
import numpy as np
1012
from scipy.interpolate import make_smoothing_spline
1113
from scipy.stats import theilslopes
1214

1315
from .inference import bad_fit_stats
1416

17+
logger = getLogger(__name__)
18+
1519
# Default settings for the auto-spline (sigma-based smoothing + OD weights).
1620
_SPLINE_SMOOTH_MULT = 5.0
1721
_SPLINE_GCV_WEIGHT_FLOOR_Q = 0.15
@@ -27,7 +31,7 @@
2731
# -----------------------------------------------------------------------------
2832

2933

30-
def fit_sliding_window(t, N, window_points=15, step=None, n_fits=None):
34+
def fit_sliding_window(t, N, window_points=15, step=None, n_fits=None, **kwargs):
3135
"""
3236
Calculate maximum specific growth rate using the sliding window method.
3337
@@ -54,6 +58,8 @@ def fit_sliding_window(t, N, window_points=15, step=None, n_fits=None):
5458
Returns None if calculation fails.
5559
5660
"""
61+
if kwargs:
62+
logger.warning("fit_sliding_window received unused kwargs: %s", kwargs)
5763
if len(t) < window_points or np.ptp(t) <= 0:
5864
return None
5965

0 commit comments

Comments
 (0)