QuantEcon / QuantEcon/QuantEcon.py
ENH: Emit real DeprecationWarnings from mc_compute_stationary / mc_sample_path (or bless them)
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 2.4k
- Forks
- 2.3k
- Avg merge
- 3d 3h
- Merged PRs (30d)
- 3
Description
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).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with quantecon/init.py and markov/core.py at mc_compute_stationary and mc_sample_path, then review the module docstrings and issue #865 for the deprecation context. Record an explicit decision between deprecating or blessing the wrappers, add the corresponding tests and changelog entry, and ensure no comment-only deprecation remains.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100