Skip to content

#864 development constant tail bug extending obj#923

Open
kennethshsu wants to merge 2 commits into
mainfrom
#864_DevelopmentConstant_Tail_Bug_extending_obj
Open

#864 development constant tail bug extending obj#923
kennethshsu wants to merge 2 commits into
mainfrom
#864_DevelopmentConstant_Tail_Bug_extending_obj

Conversation

@kennethshsu
Copy link
Copy Markdown
Collaborator

@kennethshsu kennethshsu commented Jun 5, 2026

Summary of Changes

I plan on starting over, and let me try test driven dev this time. Can you review the tests first? I would recommend comparing against #868

Related GitHub Issue(s)

#864

Additional Context for Reviewers

The tests are the same, with the exception of the two cases where the pattern extends beyond the tail.

My plan is actually to start over, because I did too much work trying to regroup the CDF, and that added a lot of tech debt. Please just review the tests for now.

  • I passed tests locally for both code (uv run pytest) and documentation changes (uv run jb build docs --builder=custom --custom-builder=doctest)

Note

Low Risk
Test-only changes to development constant behavior specs; no runtime logic modified in this diff.

Overview
This PR expands test_constant.py with TDD coverage for DevelopmentConstant pattern handling (issue #864), without changing production code yet.

It reformats existing callable-axis tests and fixes the callable_axis=1 assertion to compare full patterns.values (not a truncated slice). test_constant_callable_axis1 is marked xfail until #864 lands.

New tests pin expected cdf_ / ldf_ when patterns are shorter than the triangle (no tail), on incremental triangles, and when patterns match, truncate, or extend past the development tail. Most of those scenarios are xfail with reason coming with #864; test_constant_pattern_no_tail and test_constant_incr run as passing specs today.

Reviewed by Cursor Bugbot for commit 1666375. Bugbot is set up for automated code reviews on this repo. Configure here.

@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.30%. Comparing base (31b3432) to head (1666375).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #923      +/-   ##
==========================================
+ Coverage   88.28%   88.30%   +0.01%     
==========================================
  Files          88       88              
  Lines        5029     5029              
  Branches      642      642              
==========================================
+ Hits         4440     4441       +1     
+ Misses        444      443       -1     
  Partials      145      145              
Flag Coverage Δ
unittests 88.30% <ø> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 1666375. Configure here.

.fit(agway)
.cdf_
)
assert np.all(abs(lhs.values[0, :, 0, :] - patterns.values) < atol)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Axis1 test drops ultimate column

Medium Severity

test_constant_callable_axis1 now compares fitted cdf_ values to all of patterns.values, but the pattern grid still includes the ultimate age column (value 1). The PR only intended to change tail-extension cases; this assertion should still exclude that column like patterns.values[:, :-1].

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 1666375. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant