feat: add failure-mode decomposition to ruin output#1669
Merged
Conversation
…s relationship between E[X] and TAG in the simplified model
matplotlib removed the plt.cm.get_cmap accessor (deprecated since 3.7, removed in 3.9), which raised AttributeError at runtime and broke the mypy lint gate in CI. Switch to the modern plt.colormaps[name] registry indexing already used elsewhere in the visualization package (technical_plots.py).
Coverage Report
|
The Part-10b ruin-path figure in 07_hjb_insurance_optimization.ipynb wrapped its plt.subplots(...) call across two lines with dpi=150 on the continuation line. test_nb07_sensitivity.test_every_figure_creation_sets_dpi_150 scans line-by-line and requires dpi=150 on the same physical line as the plt.subplots( call, so it flagged this as the only test failure in CI. Move dpi=150 onto the subplots line (net zero-char change). No other figure-creation call in the notebook is affected.
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.
Summary
Promotes the current
developwork tomain. The headline change is a new failure-mode decomposition capability on the ruin output, alongside a CI lint fix and an extensive round of HJB optimization-notebook (No. 07) work.This PR is titled
feat:because it contains a feature commit (957e342); per the project's release rules, the PR title is the sole inputpython-semantic-releaseuses to determine the version bump and changelog entry onmain. This will produce a minor version bump (pre-1.0,major_on_zero = false).Changes
Features
957e342): adds a reusableWidgetManufacturer.ruin_reasonfield populated at 9 trigger sites (first-wins, diagnostic-only), surfaced as part of the ruin output. Includes newtest_ruin_reason.py(195 lines) and a Part-10b butterfly chart in notebook 07 decomposing ruin into plain-language causes (No-Insurance vs. HJB Adaptive).Fixes
05e28a8):matplotlibremoved theplt.cm.get_cmapaccessor (deprecated in 3.7, removed in 3.9), which raisedAttributeErrorat runtime and broke CI. Switchedimproved_tower_plot.pyto the modernplt.colormaps[name]registry indexing already used elsewhere in the visualization package.Docs & chore
4b54a6c).0e6845a) and optimization-directory cleanup (b82958e).Validation
mypy ergodic_insurance/ --ignore-missing-imports→ Success, no issues in 347 source files.black --check .→ all files unchanged.isort --check-only .→ no changes needed.pylint ergodic_insurance/ --fail-under=7.0→ rated 9.94/10 (exit 0).