ENH: Standardize cell naming in TradLife_A.BaseProj#100
Merged
Conversation
Rename benefit/size cells to a unified ``claims_*`` and ``*_pp`` convention so naming reflects the role each cell plays: - ``claims`` -> ``claims_death`` and ``benefit_total`` -> ``claims`` promote ``claims`` to the umbrella term for benefit cashflows. - ``benefit_*`` -> ``claims_*`` for individual benefit components. - ``size_*`` -> ``*_pp`` for per-policy values, with ``size_benefit_*`` -> ``claims_*_pp`` as the combined case. - ``claim_pp`` -> ``claims_death_pp``, ``expense_acq`` -> ``expense_acq_pp``, and ``expense_maint`` -> ``expense_maint_pp`` so every per-policy cell follows the ``_pp`` suffix. - The four mirror cells in the ``PV`` space are renamed accordingly: ``pv_claims`` -> ``pv_claims_death``, ``pv_benefit_total`` -> ``pv_claims``, ``pv_benefit_mat`` -> ``pv_claims_mat``, ``pv_benefit_surr`` -> ``pv_claims_surr``. Updates the BaseProj/PV module docstrings, the ``BaseProj.rst`` / ``PV.rst`` autosummary listings, and the cell-name strings used by ``plot_tradlife_a.py``, ``plot_pvcashflows.py``, and ``tradlife_a-demo.ipynb``. Verified by ``test_pv_net_cf_matches_simplelife`` (passes for all three policy pairs) and a smoke check confirming all 37 new names resolve and all 13 old names are gone. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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
Standardize the cell naming convention in
TradLife_A'sBaseProj(and the four mirror cells inPV) so naming reflects the role each cell plays:claimsis now the umbrella term for benefit cashflows (wasbenefit_total).claims_*(wasbenefit_*)._ppsuffix (wassize_*), withsize_benefit_*→claims_*_ppas the combined case.size_get the_ppsuffix too:claim_pp→claims_death_pp,expense_acq→expense_acq_pp,expense_maint→expense_maint_pp.pv_claims→pv_claims_death,pv_benefit_total→pv_claims,pv_benefit_mat→pv_claims_mat,pv_benefit_surr→pv_claims_surr.Files touched
lifelib/libraries/annuallife/TradLife_A/BaseProj/__init__.py— cell definitions, internal references, module docstring.lifelib/libraries/annuallife/TradLife_A/PV/__init__.py— mirror-cell renames + body updates referencing renamed BaseProj cells.lifelib/libraries/annuallife/plot_tradlife_a.py—varslist strings.lifelib/libraries/annuallife/plot_pvcashflows.py—varslist strings.lifelib/libraries/annuallife/tradlife_a-demo.ipynb— samevarslist strings.makedocs/source/libraries/annuallife/BaseProj.rst— autosummary/autofunction listings.makedocs/source/libraries/annuallife/PV.rst— autosummary/autofunction listings.Test plan
pytest lifelib/tests/libraries/test_tradlife_a.py—test_pv_net_cf_matches_simplelifepasses for all three policy pairs.benefit_total,benefit_*,size_*,size_benefit_*,claim_pp,expense_acq,expense_maint,pv_benefit_*) are gone from the loaded model.proj.cells['claims_surr'](t),proj.cells['claims_death'](t),proj.cells['pv_claims_surr'](t),proj.cells['pv_claims_death'](t)) resolves and yields cashflows.Notes for reviewers
BaseProj/__init__.pywere updated so the prose still matches the convention (e.g. the oldSizeandBenefitsections are now_ppandClaims).invst_income_pp(formerlysize_invst_income) chains intoreserve_prem_rsrv_aft_mat_pp, which callspol.ReserveNLP_Rate('VAL', t)— that attribute is missing on the policy interface. The formula body is unchanged from the pre-rename code, andtest_pv_net_cf_matches_simplelifedoesn't traverse this path. Out of scope for this PR.🤖 Generated with Claude Code