Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dbbf3d5987
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if fit.experiment_id is not None: | ||
| fit_table = table[table["experiment_id"].astype(str) == str(fit.experiment_id)] |
There was a problem hiding this comment.
Handle compound-summary fits when filtering residual rows
plot_residuals() drops all points for fits produced with FitSettings(strategy="per_compound_summary") because those fits have experiment_id="compound_summary", but raw observation tables only contain real experiment IDs (e.g., exp1, exp2). This filter makes fit_table empty, so the loop silently skips plotting residuals and users get an empty diagnostic despite having a successful fit. Please special-case summary fits (or any fit ID not present in the table) so residuals are computed from the aggregated compound-level observations instead of filtering everything out.
Useful? React with 👍 / 👎.
Summary
This PR adds residual plotting to the Axes-first plotting API.
Included:
plot_residuals()observed - predictedaggregate=FalseDoseResponseData.response_unitplot_residuals()frombindcurve.plottingand top-levelbindcurveNotes
This PR keeps residual plotting as a standalone helper so users can compose diagnostics flexibly:
It does not add a multi-panel residual layout yet. That can come later as a compound/grid plotting layer.
Test plan
mainwithbehind_by=0