Skip to content

Commit a1db8a4

Browse files
author
Release Manager
committed
gh-36904: `src/sage/game_theory/`: fix doctest warnings due to modularization Use more block-scope tags to avoid doctest warnings like ``` File "src/sage/game_theory/normal_form_game.py", line 1093, in sage.game_theory.normal_form_game.NormalFormGame._gambit_ Warning: Consider using a block-scoped tag by inserting the line 'sage: # optional - gambit' just before this line to avoid repeating the tag 29 times threegame = NormalFormGame() # optional - gambit ``` ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> <!-- If your change requires a documentation PR, please link it appropriately --> <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> <!-- Feel free to remove irrelevant items. --> - [x] The title is concise, informative, and self-explanatory. - [x] The description explains in detail what this PR is about. - [ ] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation accordingly. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on - #12345: short description why this is a dependency - #34567: ... --> <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> URL: #36904 Reported by: David Coudert Reviewer(s): Matthias Köppe
2 parents 32c9ad9 + e85c02f commit a1db8a4

File tree

3 files changed

+211
-186
lines changed

3 files changed

+211
-186
lines changed

src/sage/game_theory/gambit_docs.py

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -115,18 +115,19 @@
115115
converted to Python integers (due to the preparser). Here is an example
116116
showing the Battle of the Sexes::
117117
118-
sage: import gambit # optional - gambit
119-
sage: g = gambit.Game.new_table([2,2]) # optional - gambit
120-
sage: g[int(0), int(0)][int(0)] = int(2) # optional - gambit
121-
sage: g[int(0), int(0)][int(1)] = int(1) # optional - gambit
122-
sage: g[int(0), int(1)][int(0)] = int(0) # optional - gambit
123-
sage: g[int(0), int(1)][int(1)] = int(0) # optional - gambit
124-
sage: g[int(1), int(0)][int(0)] = int(0) # optional - gambit
125-
sage: g[int(1), int(0)][int(1)] = int(0) # optional - gambit
126-
sage: g[int(1), int(1)][int(0)] = int(1) # optional - gambit
127-
sage: g[int(1), int(1)][int(1)] = int(2) # optional - gambit
128-
sage: solver = gambit.nash.ExternalLCPSolver() # optional - gambit
129-
sage: solver.solve(g) # optional - gambit
118+
sage: # optional - gambit
119+
sage: import gambit
120+
sage: g = gambit.Game.new_table([2,2])
121+
sage: g[int(0), int(0)][int(0)] = int(2)
122+
sage: g[int(0), int(0)][int(1)] = int(1)
123+
sage: g[int(0), int(1)][int(0)] = int(0)
124+
sage: g[int(0), int(1)][int(1)] = int(0)
125+
sage: g[int(1), int(0)][int(0)] = int(0)
126+
sage: g[int(1), int(0)][int(1)] = int(0)
127+
sage: g[int(1), int(1)][int(0)] = int(1)
128+
sage: g[int(1), int(1)][int(1)] = int(2)
129+
sage: solver = gambit.nash.ExternalLCPSolver()
130+
sage: solver.solve(g)
130131
[<NashProfile for '': [[1.0, 0.0], [1.0, 0.0]]>,
131132
<NashProfile for '': [[0.6666666667, 0.3333333333], [0.3333333333, 0.6666666667]]>,
132133
<NashProfile for '': [[0.0, 1.0], [0.0, 1.0]]>]

0 commit comments

Comments
 (0)