You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adds the full E-class style codes plus the pyflakes bug-detectors to
the CI strict-select list so they fail the build instead of merely
warning. Local pre-commit config now mirrors CI, so 'green locally'
implies 'green CI'. Plus README onboarding for new contributors.
Strict-select gates now include:
* E9 / F63 / F7 / F82 syntax errors, undefined names
* F401 / F811 / F841 unused imports / redefinitions / unused locals
* E202 whitespace before '}'
* E226 missing whitespace around arithmetic operator
* E251 unexpected spaces around keyword/parameter equals
* E402 module-level import not at top of file
* E501 line too long (88-char limit, matches BoTorch)
* E741 ambiguous variable name ('I'/'l'/'O')
Files modified to conform:
* boxcrete/slump_model.py drop unused 'import torch'
* docs/generate_mix_analyses.py drop unused 'cost'/'str_1' locals;
wrap ~20 long f-strings
* test/test_partial_fixed_noise_likelihood.py drop unused 'n_total'
* boxcrete/features.py move 'from boxcrete.utils import
DEFAULT_X_COLUMNS' to top of module
* experiments/regenerate_strength_json.py relocate '# noqa: E402'
to opening line of multi-line import
* boxcrete/plotting.py:191 rename 'I' -> 'eye_n' (E741)
* test/test_models.py:412 rename 'I' -> 'eye_n' (E741)
* boxcrete/utils.py:275-276,467 f-string '{x = }' -> '{x=}' (E202/E251)
* experiments/check_artifacts_drift.py '*100' -> '* 100' (E226)
* test/test_lengthscale_identifiability.py '*100' -> '* 100' (E226)
* boxcrete/concrete_model.py wrap 5 long docstring/error lines
* boxcrete/kernels.py wrap 196-char inline comment
* boxcrete/likelihoods.py wrap 4 long pragma-comment lines
* boxcrete/utils.py wrap 5 long docstring/error lines
* boxcrete/slump_model.py wrap 1 long module-docstring line
* docs/generate_mix_analyses.py wrap 1 long obs-str line
* experiments/regenerate_strength_json.py wrap 2 long print lines
* test/test_models.py:220 tighten long docstring
* test/test_strength_curve_monotonicity.py wrap 3 long error-msg lines
* test/test_utils.py:679 tighten long docstring
Bonus fix in .flake8: explicit 'exclude' list was silently overriding
flake8's defaults, so .git, __pycache__, .hg, etc. were being linted.
Sapling stores backup copies of working-tree files under
.git/sl/origbackups/ — without the explicit re-add of the default
excludes, flake8 was reporting violations from old deleted research
code. Defaults restored explicitly.
Developer ergonomics:
* .pre-commit-config.yaml synced to the CI strict-select so the
local pre-commit hook fails on the same codes CI does (no more
'green locally, red on CI' surprises).
* README adds a 'Development' section explaining
'pip install -e ".[dev]" && pre-commit install' onboarding, the
role of black (auto-fix) vs flake8 (gate), and the 88-char line
convention (matches BoTorch/GPyTorch).
# K shape: [..., n] — element-wise multiply by h1, h2 (same shape)
176
-
return (
177
-
K*h1*h2
178
-
) # pragma: no cover -- diag=True kernel-eval branch; BoTorch's posterior(...).variance computes full covariance and extracts the diagonal, never calling kernel.forward with diag=True
176
+
# ``diag=True`` kernel-eval branch; BoTorch's
177
+
# ``posterior(...).variance`` computes the full covariance
178
+
# and extracts the diagonal, so kernel.forward is never
179
+
# called with diag=True in the production fit path.
180
+
returnK*h1*h2# pragma: no cover
179
181
# K shape: [..., n1, n2]; multiply by h1[...,n1,1] and h2[...,1,n2]
Copy file name to clipboardExpand all lines: boxcrete/likelihoods.py
+23-12Lines changed: 23 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -128,10 +128,12 @@ def __init__(
128
128
noise_prior=None,
129
129
**kwargs,
130
130
):
131
-
if (
132
-
noise_constraintisNone
133
-
): # pragma: no cover -- production callers always pass an explicit noise_constraint via build_strength_kernel_for_aug_dim; this default-fallback path is research-only
134
-
noise_constraint=LogTransformedInterval(
131
+
ifnoise_constraintisNone:
132
+
# ``pragma: no cover`` -- production callers always pass
133
+
# an explicit ``noise_constraint`` via
134
+
# ``build_strength_kernel_for_aug_dim``; this default-
135
+
# fallback path is research-only.
136
+
noise_constraint=LogTransformedInterval( # pragma: no cover
else: # pragma: no cover -- defensive fallback; V2 fit always either passes a 2D X (training) or has _train_times set (eval) before this method is called
0 commit comments