Skip to content

MAINT: tidy tic/tac/toc deprecation follow-ups - #958

Merged
mmcky merged 5 commits into
mainfrom
claude/quantecon-pr-833-review-3ibe6f
Sep 23, 2026
Merged

mmcky merged 5 commits into
mainfrom
claude/quantecon-pr-833-review-3ibe6f

Conversation

@quantecon-services

@quantecon-services quantecon-services commented Sep 9, 2026 •

Copy link
Copy Markdown
Collaborator

Follow-up to #833 (merged as 090feca). The branch still carries #833's original commits, so when squash-merging keep only the MAINT: tidy tic/tac/toc deprecation follow-ups commit message.

Small review follow-ups to the tic/tac/toc/loop_timer deprecation (#786, Step 1):

  • Module docstring: state the v1.0 removal target explicitly so it matches the warning text and the .. deprecated:: 0.12.0 directives (rendered docs read "deprecated since 0.12.0, removed in v1.0").
  • Tests: use @pytest.mark.filterwarnings("ignore::DeprecationWarning") on the four behavioural tests that exercise the deprecated timers, replacing the nested warnings.catch_warnings() blocks. The TestDeprecation tests for tac/toc keep their local catch_warnings() since they need to silence only the preceding tic() while asserting on the next call.
  • Drop a stray # noqa: comment that carried prose rather than a code.

No behaviour change. pytest quantecon/util/tests/test_timing.py -W error::DeprecationWarning passes (33 tests).

🤖 Generated with Claude Code

https://claude.ai/code/session_01A58YqvGkFvFkgtxg7PAsBt


Generated by Claude Code

Builder106 and others added 4 commits July 18, 2026 15:41
Emit a DeprecationWarning from the public `tic`, `tac`, `toc` and
`loop_timer` functions, pointing users to the modern `Timer` context
manager and `timeit` function added in #783/#794. Removal is targeted
for v0.12.0.

- `__Timer__.loop_timer` now calls its own methods (`self.tic`/`tac`/
  `toc`) instead of the public wrappers, so a single `loop_timer` call
  emits exactly one warning rather than one per run.
- The warning uses `stacklevel=3` so it is attributed to the user's
  call site rather than the wrapper.
- Added `.. deprecated:: 0.12.0` directives to the module and the
  affected docstrings.
- Added tests asserting each function warns, that `loop_timer` warns
  only once, and that the warning points at the caller.

Note: the original issue mentioned removal in 0.9.*, but the library is
already at v0.11.2, so this targets v0.12.0 instead.
- State the v1.0 removal target in the module docstring so it matches
  the warning text and the `.. deprecated:: 0.12.0` directives.
- Use `@pytest.mark.filterwarnings("ignore::DeprecationWarning")` on the
  behavioural tests that exercise the deprecated timers, replacing the
  nested `warnings.catch_warnings()` blocks.
- Drop a stray `# noqa:` comment that carried prose instead of a code.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01A58YqvGkFvFkgtxg7PAsBt
@coveralls

coveralls commented Sep 9, 2026 •

Copy link
Copy Markdown

Coverage Status

coverage: 94.0%. remained the same — claude/quantecon-pr-833-review-3ibe6f into main

The squash merge of #833 conflicts with the original #833 commits carried on this branch, and a plain three-way merge silently re-adds the catch_warnings blocks this branch removed. The merged tree is therefore set to main plus 1249b84 exactly.
@mmcky mmcky changed the title MAINT: tidy tic/tac/toc deprecation follow-ups (stacked on #833) MAINT: tidy tic/tac/toc deprecation follow-ups Sep 23, 2026
@mmcky
mmcky merged commit 9db6de7 into main Sep 23, 2026
15 checks passed
@mmcky
mmcky deleted the claude/quantecon-pr-833-review-3ibe6f branch September 23, 2026 06:28
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.

5 participants