Merged
Conversation
…r.predict()
Move prediction_window and prediction_times out of fit() so a single trained
model can serve any prediction window without retraining.
- IncomingAdmissionPredictor subclasses (Direct/Parametric/Empirical):
* fit() stores a full 24-hour arrival_rates_dict; prediction_window and
prediction_times become deprecated kwargs with a DeprecationWarning fallback
* predict()/predict_mean() now require prediction_window and slice the
24-hour profile dynamically via _iter_prediction_inputs
* Add _resolve_prediction_window, _snap_to_interval_boundary (with
UserWarning when snapping), and _normalize_prediction_time helpers
* Remove find_nearest_previous_prediction_time
- Thread prediction_window through call sites:
aggregate.get_prob_dist_using_survival_curve, predict.emergency_demand,
predict.service (including _safe_predict_mean); drop the now-obsolete
window-mismatch validation checks
- train.incoming_admission_predictor: stop forwarding the deprecated kwargs
- Tests: rewrite test_incoming_admission_predictors for the new API and
deprecation path; update test_service (drop window-mismatch branch)
- Notebooks: refresh 3e, 3f and 4a against the new API
- Docs: clean up Sphinx :meth:/:class:/:func:/:data: roles so auto-generated
docs render correctly; fix type hints flagged by mypy (Optional[...] on
prediction_window_hours/NTimes); patch 4c output metadata for nbformat
Note: saved models from older versions are no longer supported.
- Add prediction_time, filter_keys, and filter_key; nest prediction_context in DeprecationWarning path only - Update service, emergency_demand, and aggregate call sites - Add tests for new API, legacy dict, and filter_key when multiple services - Refresh module and class docstrings (fit #136 + service/weights wording
3ede94d to
d9fb3fb
Compare
This was referenced Apr 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.