Repository navigation
FIX: export solve_discrete_riccati_system from the quantecon namespace - #996
Open
jadhavgaurav wants to merge 1 commit into
Open
jadhavgaurav wants to merge 1 commit into
jadhavgaurav wants to merge 1 commit into
Conversation
The docs stub for `quantecon.matrix_eqn` documents `solve_discrete_riccati_system` under `currentmodule:: quantecon`, but `quantecon/__init__.py` did not import it, so autodoc could not find it and the API docs had no entry. The deprecated `quantecon.matrix_eqn` shim also tells users to write `from quantecon import solve_discrete_riccati_system`, which raised ImportError. Import it next to the other two matrix-equation solvers. A new test checks that every name the shim exports is available from `quantecon`. Fixes QuantEcon#987. Signed-off-by: Gaurav Jadhav <gaurav.vjadhav01@gmail.com>
|
Thanks for the pull request, @jadhavgaurav! QuantEcon welcomes AI-assisted contributions under its Code of AI Use. Every pull request carries one
This comment is posted on every external pull request that arrives without the line, so it is not a flag on yours. Nothing is blocked; a maintainer reads the reply. |
Contributor
Author
|
Added the Assisted-by line to the description. Confirming that a human chose this task, read the change, and will answer review on it. |
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.
Fixes #987.
solve_discrete_riccati_systemis documented undercurrentmodule:: quanteconindocs/source/tools/matrix_eqn.rstand is listed in thequantecon.matrix_eqnshim, butquantecon/__init__.pyimported onlysolve_discrete_lyapunovandsolve_discrete_riccati. So autodoc could not import it, and the advice in the shim's deprecation warning (from quantecon import solve_discrete_riccati_system) raisedImportError.This PR takes the first fix suggested in the issue: import the function next to the other two in
quantecon/__init__.py. The committed docs stub is used as it is.Test:
test_deprecated_matrix_eqn_names_are_exported_by_quanteconinquantecon/tests/test_matrix_eqn.pychecks that every name inquantecon.matrix_eqn.__all__is available fromquanteconand is the same object as inquantecon._matrix_eqn. It fails without the import (AttributeError: module 'quantecon' has no attribute 'solve_discrete_riccati_system') and passes with it.Checked locally on Python 3.13:
pytest quantecongives 770 passed, 1 skipped.flake8 --select=F401,F405,E231 quanteconis clean.python qe_apidoc.pyindocs/leavesdocs/sourceunchanged.I did not build the Sphinx docs. The five other names the issue lists (
ckron,gridmake,annotate_nodes,num_compositions_jit,simulate_linear_model) are not touched here, since exporting them is a separate API decision.Assisted-by: Claude Code (Claude Sonnet 5.5)