DOC: clarify timing precision accessors and repair doctest example - #959
Open
quantecon-services wants to merge 1 commit into
Open
quantecon-services wants to merge 1 commit into
quantecon-services wants to merge 1 commit into
Conversation
Document that get_default_precision() is the read-only equivalent of float_precision() called with no argument, and note why both exist. Repair the float_precision() example so it passes under a strict doctest run: the print() line had no expected output. Also strip trailing whitespace and add the missing newline at end of file. Inspired by the docstring half of #914 by @lntutor. Closes out the documentation criteria of #889; the module was already fully covered by TestGlobalPrecision in quantecon/util/tests/test_timing.py. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016SV8c3M2nrjtkSSjQ6Ky2L
This was referenced Sep 9, 2026
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
Closes out the documentation half of #889. Docstring-only change to
quantecon/timings/timings.py, plus a trailing-newline fix inquantecon/timings/__init__.py.get_default_precision()is the read-only equivalent offloat_precision()called with no argument, and explain why both exist (the timing utilities inquantecon/util/timing.pyonly need to read the setting).float_precision()example so it passes under a strict doctest run. Theprint(...)line had no expected output; it is now>>> qe.timings.float_precision()with expected output4. The>>>examples are kept rather than rewritten as prose so the module is ready for the docstring sweep in TEST: run docstring examples without comparing output (#866) #920.No test file is added.
quantecon/timings/timings.pyis already at 100% line coverage viaTestGlobalPrecisioninquantecon/util/tests/test_timing.py, which covers get, set, the threeValueErrorpaths, and state restoration.Inspired by the docstring half of #914 by @lntutor, with thanks.
Validation
pytest --doctest-modules quantecon/timings/timings.pypasses (fails onmain)flake8 --select=F401,F405,E231 quantecon/timingsclean; fullflake8 quantecon/timingsalso cleanpytest quantecon/util/tests/test_timing.pypasses (27 tests)AI disclosure
Drafted with Claude Code from a review of #914 and #915, then checked by hand.
🤖 Generated with Claude Code
https://claude.ai/code/session_016SV8c3M2nrjtkSSjQ6Ky2L
Generated by Claude Code