Skip to content

ENH: Emit real DeprecationWarnings from mc_compute_stationary / mc_sample_path (or bless them) #876

Description

@mmcky

Problem

quantecon/__init__.py has carried the comment "Imports that Should be Deprecated with markov package" above mc_compute_stationary and mc_sample_path (markov/core.py:696,711) across many release cycles — but neither function warns. The deprecation exists only for people reading our source: users get no signal, so eventual removal would feel abrupt, while keeping the aliases forever contradicts the stated intent. Both are thin wrappers over MarkovChain.

Proposed change

Decide, then implement — either branch is small:

A. Deprecate for real: add warnings.warn(..., DeprecationWarning, stacklevel=2) naming the replacement (MarkovChain(P).stationary_distributions / MarkovChain(P).simulate(...)) and a target removal version; changelog entry; pytest.warns test. This matches the module docstrings' direction, and given #865 is deciding shim-removal scheduling, the same release train could carry both notices.

B. Bless them: delete the comment, add both to the documented API, add tests.

Acceptance criteria

  • Behavior matches an explicit decision recorded in this thread; no "deprecated only in a comment" state remains
  • Changelog entry present

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

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions