UltimateMortality accepts any AbstractVector - #143
Open
alecloudenback wants to merge 2 commits into
Open
alecloudenback wants to merge 2 commits into
alecloudenback wants to merge 2 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## refactor/07-standin-semantics #143 +/- ##
================================================================
Coverage ? 91.05%
================================================================
Files ? 10
Lines ? 380
Branches ? 0
================================================================
Hits ? 346
Misses ? 34
Partials ? 0 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
UltimateMortality previously required a Vector of Real and rejected ranges, views, and vectors containing missing; mortality_vector is now an alias for it. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JFnc6pvofuNXTW2xdCcewT
OffsetArray(v, start_age - 1) shifts relative to v's own axes, so a vector already indexed by age (or any input not starting at 1) was placed at the wrong ages: re-anchoring a table starting at 40 with start_age = 0 gave axes 39:40. Offset by start_age - firstindex(v) instead. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
alecloudenback
force-pushed
the
refactor/08-vector-constructor
branch
from
September 24, 2026 22:50
bcd9510 to
b8f54a9
Compare
alecloudenback
force-pushed
the
refactor/07-standin-semantics
branch
from
September 24, 2026 22:50
1197964 to
9610214
Compare
This branch has not been deployed
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.
Updated 2026-09-24 (review fix), one commit added: Anchor UltimateMortality at start_age for any input axes.
OffsetArray(v, start_age - 1)shifted relative tov's own axes, so an input already indexed by age was placed at the wrong ages (re-anchoring a table starting at 40 tostart_age = 0gave axes39:40). It now offsets bystart_age - firstindex(v); tests cover plain vectors, views and offset inputs.UltimateMortalityandmortality_vectorhad the identical body, but the first was typedArray{<:Real,1}and rejected ranges and views (UltimateMortality(0:0.1:1)was aMethodError), while the second accepted anything.Changes
UltimateMortality(v::AbstractVector; start_age=0), element type unconstrained somissing-bearing vectors keep working. No copy is made, and the docstring says so.mortality_vectoris a one-line alias ofUltimateMortality.Testing
missing, the no-copy guarantee, and alias equality.Stacked on #142 (base branch
refactor/07-standin-semantics). Merge the stack in order; once the base PR is merged and its branch deleted, GitHub retargets this PR tomaster.🤖 Generated with Claude Code
https://claude.ai/code/session_01JFnc6pvofuNXTW2xdCcewT