Skip to content

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

Description

@mmcky

Problem

quantecon/timings/ is the only subpackage with no test file at all, yet it exposes public API — qe.timings.float_precision() is reachable from the top-level namespace. It is 66 lines with two public functions and a module-level mutable global. Three things to address:

  1. No tests. float_precision() has a validation branch (ValueError for non-integer or negative input) and get/set dual behaviour, neither exercised. The module-level global means tests need to restore state — worth getting right in the first test rather than retrofitting.
  2. Two names for one read. float_precision() called with no argument and get_default_precision() return the same value by the same mechanism. One can go, or the relationship should be documented — as it stands a reader cannot tell which is canonical.
  3. Docstring examples are doctest-shaped but never executed (adjacent: Run docstring examples in CI (--doctest-modules) #866 on running doctests in CI), so they are unverified prose that reads as tested.

Acceptance criteria

  • A test module covering get, set, validation errors, and state restoration between tests
  • The duplicate accessor removed, or its relationship to float_precision() documented
  • Doctest examples either run under a configured doctest collector or are reformatted so they don't claim to be tested

From the July 2026 technical-debt audit (AI-assisted; claims verified against 28d4b3b on 2026-07-25).

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions