Skip to content

Commit

Permalink
sagemathgh-36904: src/sage/game_theory/: fix doctest warnings due t…
Browse files Browse the repository at this point in the history
…o 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
- sagemath#12345: short description why this is a dependency
- sagemath#34567: ...
-->

<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
    
URL: sagemath#36904
Reported by: David Coudert
Reviewer(s): Matthias Köppe
  • Loading branch information
Release Manager committed Dec 24, 2023
2 parents 8cb5fbe + e85c02f commit 2064082
Show file tree
Hide file tree
Showing 3 changed files with 211 additions and 186 deletions.
25 changes: 13 additions & 12 deletions src/sage/game_theory/gambit_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,18 +115,19 @@
converted to Python integers (due to the preparser). Here is an example
showing the Battle of the Sexes::
sage: import gambit # optional - gambit
sage: g = gambit.Game.new_table([2,2]) # optional - gambit
sage: g[int(0), int(0)][int(0)] = int(2) # optional - gambit
sage: g[int(0), int(0)][int(1)] = int(1) # optional - gambit
sage: g[int(0), int(1)][int(0)] = int(0) # optional - gambit
sage: g[int(0), int(1)][int(1)] = int(0) # optional - gambit
sage: g[int(1), int(0)][int(0)] = int(0) # optional - gambit
sage: g[int(1), int(0)][int(1)] = int(0) # optional - gambit
sage: g[int(1), int(1)][int(0)] = int(1) # optional - gambit
sage: g[int(1), int(1)][int(1)] = int(2) # optional - gambit
sage: solver = gambit.nash.ExternalLCPSolver() # optional - gambit
sage: solver.solve(g) # optional - gambit
sage: # optional - gambit
sage: import gambit
sage: g = gambit.Game.new_table([2,2])
sage: g[int(0), int(0)][int(0)] = int(2)
sage: g[int(0), int(0)][int(1)] = int(1)
sage: g[int(0), int(1)][int(0)] = int(0)
sage: g[int(0), int(1)][int(1)] = int(0)
sage: g[int(1), int(0)][int(0)] = int(0)
sage: g[int(1), int(0)][int(1)] = int(0)
sage: g[int(1), int(1)][int(0)] = int(1)
sage: g[int(1), int(1)][int(1)] = int(2)
sage: solver = gambit.nash.ExternalLCPSolver()
sage: solver.solve(g)
[<NashProfile for '': [[1.0, 0.0], [1.0, 0.0]]>,
<NashProfile for '': [[0.6666666667, 0.3333333333], [0.3333333333, 0.6666666667]]>,
<NashProfile for '': [[0.0, 1.0], [0.0, 1.0]]>]
Expand Down
Loading

0 comments on commit 2064082

Please sign in to comment.