Skip to content

FIX (game_theory): fix polym_lcp_solver type hints in howson_lcp#824

Open
mnshkw wants to merge 6 commits intoQuantEcon:mainfrom
mnshkw:fix/howson-lcp-type-hints
Open

FIX (game_theory): fix polym_lcp_solver type hints in howson_lcp#824
mnshkw wants to merge 6 commits intoQuantEcon:mainfrom
mnshkw:fix/howson-lcp-type-hints

Conversation

@mnshkw
Copy link

@mnshkw mnshkw commented Feb 16, 2026

Summary

This PR fixes the return type annotation of polym_lcp_solver in quantecon.game_theory.howson_lcp so that it matches the function’s actual return values.

This is a typing-only change.

Motivation

polym_lcp_solver returns:

  • NE (a tuple of per-player mixed strategies) when full_output=False
  • (NE, NashResult) when full_output=True

The previous type hint did not accurately represent the full_output=True case.

Changes

  • Update the return type annotation to reflect:
    • NE as tuple[NDArray, ...]
    • the full_output=True case as a 2-tuple (NE, NashResult)

Notes for Reviewers

All codes and documentation are written with assistance by LLMs.

@oyamad oyamad changed the title FIX (game_thoery): fix polym_lcp_solver type hints in howson_lcp FIX (game_theory): fix polym_lcp_solver type hints in howson_lcp Feb 17, 2026
@coveralls
Copy link

coveralls commented Feb 17, 2026

Coverage Status

coverage: 92.586%. remained the same
when pulling e0d5c39 on mnshkw:fix/howson-lcp-type-hints
into 92cb823 on QuantEcon:main.

@oyamad oyamad added the ready label Feb 17, 2026
Copy link
Member

@oyamad oyamad left a comment

Choose a reason for hiding this comment

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

@mnshkw Thanks! I added a commit that corrects the description in the Returns section.

@mmcky This is ready to merge. Thanks.

@mmcky
Copy link
Contributor

mmcky commented Feb 18, 2026

thanks @mnshkw and @oyamad -- once I get the green ticks I will merge this.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the type annotation for polym_lcp_solver in quantecon.game_theory.howson_lcp so static typing matches the function’s two return modes (full_output=False vs True) in the game theory solvers.

Changes:

  • Fix polym_lcp_solver return type hint to represent NE vs (NE, NashResult) accurately.
  • Adjust the docstring “Returns” section to better reflect the intended outputs.

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

Comments