Skip to content

MAINT: Test and clarify timing precision accessors - #914

Closed
lntutor wants to merge 1 commit into
QuantEcon:mainfrom
lntutor:test-timings-accessors-889
Closed

lntutor wants to merge 1 commit into
QuantEcon:mainfrom
lntutor:test-timings-accessors-889

Conversation

@lntutor

@lntutor lntutor commented Jul 26, 2026

Copy link
Copy Markdown

Summary

  • add isolated coverage for timing precision reads, updates, and validation errors
  • clarify get_default_precision() as the read-only equivalent of float_precision()
  • replace uncollected doctest-style prompts with regular usage guidance
  • clean existing whitespace violations in the timing module

Closes #889

Validation

  • uv run --extra testing pytest quantecon/tests/test_timings.py -q
  • uv run --extra testing flake8 quantecon/timings quantecon/tests/test_timings.py

I also started the full pytest quantecon -q suite; it ran cleanly through 47% before the local terminal session ended unexpectedly.

Copy link
Copy Markdown
Collaborator

Hi @lntutor, thank you for picking this up and for engaging with all three parts of #889 rather than just the tests. You were the first to claim the issue, and your reading of the accessor duplication and the never-run doctest example was correct.

I am closing this PR, but not because the work was poor. The reason is a mistake in the issue itself: the audit checked for a test directory under quantecon/timings/ and missed that the module is already fully covered by TestGlobalPrecision in quantecon/util/tests/test_timing.py (get, set, all three ValueError paths, state restoration). So the test half of this PR duplicated coverage that already existed. The >>>-absence assertion also would not survive #920, which is moving the project toward running docstring examples rather than removing them.

The docstring half was the valuable part, and I have carried it forward in #959 with credit to you: it documents get_default_precision() as the read-only equivalent of float_precision(), repairs the one example line that fails under strict doctest (keeping the >>> form so #920 can execute it), and picks up your whitespace and end-of-file fixes. I hope that is an acceptable outcome; please say if you would rather rework this PR to that scope yourself and I will close #959 instead.

I have also closed #889 with a note about what went wrong. If you would like another issue, the 2026-07 Technical Debt Audit milestone has plenty, and I would be happy to review.

Thanks again, and apologies for the wasted effort on the test side.


Generated by Claude Code

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.

MAINT: Add tests for quantecon/timings and deduplicate its accessors

2 participants