Skip to content

MAINT: Rename PolymatrixGame.from_nf and to_nfg - #979

Merged
mmcky merged 2 commits into
mainfrom
polymatrix-rename
Oct 7, 2026
Merged

mmcky merged 2 commits into
mainfrom
polymatrix-rename

Conversation

@oyamad

@oyamad oyamad commented Oct 3, 2026

Copy link
Copy Markdown
Member

Renames PolymatrixGame.from_nf and PolymatrixGame.to_nfg to from_normal_form_game and to_normal_form_game.

"nfg" refers to the Gambit .nfg format in game_converters once #978 is merged, where to_nfg writes a file. The new names also match PayoffVector.from_normal_form_game and to_normal_form_game there.

The old names remain as aliases that emit a DeprecationWarning, following the pattern of util.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)

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>
@coveralls

coveralls commented Oct 3, 2026 •

Copy link
Copy Markdown

Coverage Status

coverage: 94.084% (+0.08%) from 94.0% — polymatrix-rename into main

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
@mmcky
mmcky merged commit 9f10414 into main Oct 7, 2026
15 checks passed
@mmcky
mmcky deleted the polymatrix-rename branch October 7, 2026 23:33
@mmcky

mmcky commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

Thanks @oyamad! Both #978 and this rename are now in. The .nfg reader and writer are a nice addition, and the Lisp-reader approach to the parser made the review easy. Much appreciated.

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>
@mmcky mmcky mentioned this pull request Oct 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants