Repository navigation
Property tests use independent references instead of reimplemented calendar oracles - #52
Merged
Merged
Conversation
…ndent references The stream, day-count, and finance/tax property tests no longer compare against helpers in strategies.py that reimplement DCAF's calendar logic. Expected values now come from hand calculations, properties of the helpers under test, or DCAF helpers that are themselves tested against hand values in test_time_helpers.py. The calendar window helper is shared across finance, project, and stream modules, so it is now public as calendar_period_windows. Co-Authored-By: Claude <noreply@anthropic.com>
j-bryan
force-pushed
the
anchored-oracle-cleanup
branch
from
October 13, 2026 22:13
4914ef4 to
295ad66
Compare
This was referenced Oct 13, 2026
dylanjm
approved these changes
Oct 15, 2026
dylanjm
left a comment
Collaborator
There was a problem hiding this comment.
Changes are good and remove some slop.
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.
Related to #36 and #38 (closes neither). Stacked on #49, in stack #51. This PR changes no library behavior.
What changes
tests/unit/strategies.pythat copied DCAF's own calculations are removed:year_fraction,counted_days,calendar_windows,calendar_period_key,timing_point,tail_days,anchored_boundary, andis_month_end. The stream, day-count, and finance/tax tests now use one of the following for expected values:tests/unit/test_time_helpers.py.test_day_count_convention.py: consecutive spans add up, actual/actual measures a calendar year as exactly 1, and actual/365-no-leap drops exactly Feb. 29._calendar_period_windowsis now public ascalendar_period_windows, because finance, project, and stream modules all use it. The change is a rename only.test_time_helpers.pychecks values within1e-13of a whole day. Loosen the whole-day float tolerance to 1e-8 #53 adds the cases at the edges of its looser tolerance.add_periodsinstead of the removedanchored_boundaryoracle. This also reformats oneparametrizeentry intest_finance_tax_anchoring.pythatruff formatflagged.Testing
uv run ruff check,uv run ruff format --check,uv run mypy dcaf/, anduv run pytestpass (1013 tests), and the Hypothesis properties also pass at 3,000 examples each.🤖 Generated with Claude Code