Repository navigation
MAINT: Rename PolymatrixGame.from_nf and to_nfg - #979
Merged
Merged
Conversation
Rename them to `from_normal_form_game` and `to_normal_form_game`, as "nfg" now refers to the Gambit .nfg format in `game_converters`. The old names remain as deprecated aliases that emit a DeprecationWarning. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The focused API rename preserves compatibility and has appropriate test coverage.
Review effort: Balanced
Findings: None
What changed in this PR
Renames PolymatrixGame normal-form conversion methods while preserving backward compatibility.
Changes:
- Adds descriptive conversion method names.
- Keeps deprecated wrappers with warnings.
- Updates examples and tests.
| File | Description |
|---|---|
quantecon/game_theory/polymatrix_game.py |
Renames methods and adds deprecated wrappers. |
quantecon/game_theory/tests/test_polymatrix_game.py |
Tests new methods and warnings. |
quantecon/game_theory/tests/test_howson_lcp.py |
Updates conversion method calls. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
The next release is 0.13.0, matching the version used in #953. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Contributor
mmcky
added a commit
that referenced
this pull request
Oct 7, 2026
…version to 0.13.0 Addresses two Copilot comments: the module is skipped with importorskip where requests (now the notebooks extra) is not installed, and the teardown no longer fails when raise_for_status left no file behind. The deprecation version becomes 0.13.0, the next release, matching #979. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
mmcky
added a commit
that referenced
this pull request
Oct 8, 2026
…#953) * DEPR: deprecate fetch_nb_dependencies and demote requests Deprecates `quantecon.util.notebooks` in 0.12.0 for removal in v1.0, and moves `requests` out of the mandatory dependency set into a `notebooks` extra that is removed with the module. `requests` served exactly one call site in the package. The function has no remaining constituency: no usage across lecture-python.myst, lecture-python-advanced.myst, lecture-python-intro or lecture-python-programming.myst, and the callers that exist are dormant notebooks descending from two 2017-era demos. Its default remote, QuantEcon/QuantEcon.notebooks, was last pushed 2023-07-15. Data still needed moves to QuantEcon/data-lectures. Calling the function emits a DeprecationWarning attributed to the caller's frame. Where `requests` is absent the lazy import raises an ImportError naming the extra. The stale 2016 TODO block, which no longer described the code, is replaced by the deprecation directive. Adds `r.raise_for_status()` as harm reduction for the module's final release: #870 reported that a missing remote path saved GitHub's 404 HTML page under the requested filename and reported success. Verified against the reported reproducer, which now raises HTTPError and writes no file. The other three defects in #870 are left unfixed, the function being scheduled for removal. Part of #880. Supersedes #870, #904 and #905, all closed. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> * TEST: skip the notebooks tests without requests; set the deprecation version to 0.13.0 Addresses two Copilot comments: the module is skipped with importorskip where requests (now the notebooks extra) is not installed, and the teardown no longer fails when raise_for_status left no file behind. The deprecation version becomes 0.13.0, the next release, matching #979. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Merged
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.
Renames
PolymatrixGame.from_nfandPolymatrixGame.to_nfgtofrom_normal_form_gameandto_normal_form_game."nfg" refers to the Gambit
.nfgformat ingame_convertersonce #978 is merged, whereto_nfgwrites a file. The new names also matchPayoffVector.from_normal_form_gameandto_normal_form_gamethere.The old names remain as aliases that emit a
DeprecationWarning, following the pattern ofutil.array.searchsorted. The module docstring example and the tests use the new names, and a test checks that the old names warn.🤖 Generated with Claude Code (Claude Fable 5.1)