Skip to content

Commit

Permalink
Reformat markdown files with mdformat. (#185)
Browse files Browse the repository at this point in the history
* Reformat markdown files with mdformat.

* Move paper.

* Fix quote.
  • Loading branch information
drvinceknight committed Jun 1, 2022
1 parent 20f33e5 commit 071e373
Show file tree
Hide file tree
Showing 14 changed files with 125 additions and 32 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/prose.yml
Expand Up @@ -25,3 +25,8 @@ jobs:
- name: Run alex on README.md
run: |
alex README.md
- name: Check formatting of md files
run: |
python -m pip install mdformat
python -m mdformat --check .
18 changes: 10 additions & 8 deletions CITATION.md
@@ -1,13 +1,15 @@
Please use the following to cite the latest version of the Nashpy library::

@misc{nashpyproject,
author = {{ {The Nashpy project developers} }},
title = {Nashpy: <RELEASE TITLE>},
month = <MONTH>,
year = <YEAR>,
doi = {<DOI INFORMATION>},
url = {http://dx.doi.org/10.5281/zenodo.<DOI NUMBER>}
}
```
@misc{nashpyproject,
author = {{ {The Nashpy project developers} }},
title = {Nashpy: <RELEASE TITLE>},
month = <MONTH>,
year = <YEAR>,
doi = {<DOI INFORMATION>},
url = {http://dx.doi.org/10.5281/zenodo.<DOI NUMBER>}
}
```

To check the details (RELEASE TITLE, DOI INFORMATION and DOI NUMBER) please view
the Zenodo page for the project. Click on the badge/link below:
Expand Down
24 changes: 12 additions & 12 deletions README.md
Expand Up @@ -21,16 +21,16 @@ Nashpy is:
aims to use the best of available tools to ensure the code is correct,
readable and robust.
- Feature rich, the following are implemented:
- Support enumeration [How to docs 🐍](https//nashpy.readthedocs.io/en/stable/how-to/solve-with-support-enumeration.html) - [Theory docs 📘](https//nashpy.readthedocs.io/en/stable/discussion/support-enumeration.html)
- Vertex enumeration [How to docs 🐍](https//nashpy.readthedocs.io/en/stable/how-to/solve-with-vertex-enumeration.html) - [Theory docs 📘](https//nashpy.readthedocs.io/en/stable/discussion/vertex-enumeration.html)
- Lemke-Howson algorithm [How to docs 🐍](https//nashpy.readthedocs.io/en/stable/how-to/solve-with-lemke-howson.html) - [Theory docs 📘](https//nashpy.readthedocs.io/en/stable/discussion/lemke-howson.html)
- Fictitious play [How to docs 🐍](https//nashpy.readthedocs.io/en/stable/how-to/use-fictitious-play.html) - [Theory docs 📘](https//nashpy.readthedocs.io/en/stable/discussion/fictitious-play.html)
- Stochastic fictitious play [How to docs 🐍](https//nashpy.readthedocs.io/en/stable/how-to/use-stochastic-fictitious-play.html) - [Theory docs 📘](https//nashpy.readthedocs.io/en/stable/discussion/stochastic-fictitious-play.html)
- Replicator dynamics [How to docs 🐍](https//nashpy.readthedocs.io/en/stable/how-to/use-replicator-dynamics.html) - [Theory docs 📘](https//nashpy.readthedocs.io/en/stable/discussion/replicator-dynamics.html)
- Replicator-mutation dynamics [How to docs 🐍](https//nashpy.readthedocs.io/en/stable/how-to/use-replicator-dynamics-with-mutation.html) - [Theory docs 📘](https//nashpy.readthedocs.io/en/stable/discussion/replicator-dynamics.html#the-replicator-mutation-dynamics-equation)
- Asymmetric replicator dynamics [How to docs 🐍](https//nashpy.readthedocs.io/en/stable/how-to/use-asymmetric-replicator-dynamics.html) - [Theory docs 📘](https//nashpy.readthedocs.io/en/stable/discussion/asymmetric-replicator-dynamics.html)
- Moran processes [How to docs 🐍](https//nashpy.readthedocs.io/en/stable/how-to/use-moran-processes.html)
- Generate games from repeated games [How to docs 🐍](https//nashpy.readthedocs.io/en/stable/how-to/obtain-a-repeated-game.html) - [Theory docs 📘](https//nashpy.readthedocs.io/en/stable/discussion/repeated-games.html)
- Support enumeration [How to docs 🐍](https//nashpy.readthedocs.io/en/stable/how-to/solve-with-support-enumeration.html) - [Theory docs 📘](https//nashpy.readthedocs.io/en/stable/discussion/support-enumeration.html)
- Vertex enumeration [How to docs 🐍](https//nashpy.readthedocs.io/en/stable/how-to/solve-with-vertex-enumeration.html) - [Theory docs 📘](https//nashpy.readthedocs.io/en/stable/discussion/vertex-enumeration.html)
- Lemke-Howson algorithm [How to docs 🐍](https//nashpy.readthedocs.io/en/stable/how-to/solve-with-lemke-howson.html) - [Theory docs 📘](https//nashpy.readthedocs.io/en/stable/discussion/lemke-howson.html)
- Fictitious play [How to docs 🐍](https//nashpy.readthedocs.io/en/stable/how-to/use-fictitious-play.html) - [Theory docs 📘](https//nashpy.readthedocs.io/en/stable/discussion/fictitious-play.html)
- Stochastic fictitious play [How to docs 🐍](https//nashpy.readthedocs.io/en/stable/how-to/use-stochastic-fictitious-play.html) - [Theory docs 📘](https//nashpy.readthedocs.io/en/stable/discussion/stochastic-fictitious-play.html)
- Replicator dynamics [How to docs 🐍](https//nashpy.readthedocs.io/en/stable/how-to/use-replicator-dynamics.html) - [Theory docs 📘](https//nashpy.readthedocs.io/en/stable/discussion/replicator-dynamics.html)
- Replicator-mutation dynamics [How to docs 🐍](https//nashpy.readthedocs.io/en/stable/how-to/use-replicator-dynamics-with-mutation.html) - [Theory docs 📘](https//nashpy.readthedocs.io/en/stable/discussion/replicator-dynamics.html#the-replicator-mutation-dynamics-equation)
- Asymmetric replicator dynamics [How to docs 🐍](https//nashpy.readthedocs.io/en/stable/how-to/use-asymmetric-replicator-dynamics.html) - [Theory docs 📘](https//nashpy.readthedocs.io/en/stable/discussion/asymmetric-replicator-dynamics.html)
- Moran processes [How to docs 🐍](https//nashpy.readthedocs.io/en/stable/how-to/use-moran-processes.html)
- Generate games from repeated games [How to docs 🐍](https//nashpy.readthedocs.io/en/stable/how-to/obtain-a-repeated-game.html) - [Theory docs 📘](https//nashpy.readthedocs.io/en/stable/discussion/repeated-games.html)

## Documentation

Expand Down Expand Up @@ -68,6 +68,7 @@ Create bi matrix games by passing two 2 dimensional arrays/lists:
array([3, 3])

```

## Other game theoretic software

- [Gambit](http://www.gambit-project.org/) is a library with a python api and
Expand All @@ -77,7 +78,6 @@ array([3, 3])
- [Axelrod](http://axelrod.readthedocs.io/en/stable/) a research library aimed
at the study of the Iterated Prisoners dilemma


## Development

Clone the repository and create a virtual environment:
Expand Down Expand Up @@ -122,7 +122,7 @@ $ make html
```

Full contribution documentation is available at
https://nashpy.readthedocs.io/en/latest/contributing/index.html
https://nashpy.readthedocs.io/en/latest/contributing/index.html

Pull requests are welcome.

Expand Down
Expand Up @@ -2,5 +2,7 @@ Source files for an image used in the description of extensive form games.

Compilation instructions:

$ latexmk --xelatex main.tex
$ convert -density 300 main.pdf -quality 90 main.png
```
$ latexmk --xelatex main.tex
$ convert -density 300 main.pdf -quality 90 main.png
```
Expand Up @@ -2,5 +2,7 @@ Source files for an image used in the description of extensive form games.

Compilation instructions:

$ latexmk --xelatex main.tex
$ convert -density 300 main.pdf -quality 90 main.png
```
$ latexmk --xelatex main.tex
$ convert -density 300 main.pdf -quality 90 main.png
```
Expand Up @@ -2,5 +2,7 @@ Source files for an image used in the description of extensive form games.

Compilation instructions:

$ latexmk --xelatex main.tex
$ convert -density 300 main.pdf -quality 90 main.png
```
$ latexmk --xelatex main.tex
$ convert -density 300 main.pdf -quality 90 main.png
```
6 changes: 4 additions & 2 deletions docs/_static/discussion/extensive-form-games/README.md
Expand Up @@ -2,5 +2,7 @@ Source files for an image used in the description of extensive form games.

Compilation instructions:

$ latexmk --xelatex main.tex
$ convert -density 300 main.pdf -quality 90 main.png
```
$ latexmk --xelatex main.tex
$ convert -density 300 main.pdf -quality 90 main.png
```
Expand Up @@ -3,5 +3,7 @@ extensive form game.

Compilation instructions:

$ latexmk --xelatex main.tex
$ convert -density 300 main.pdf -quality 90 main.png
```
$ latexmk --xelatex main.tex
$ convert -density 300 main.pdf -quality 90 main.png
```
6 changes: 4 additions & 2 deletions docs/_static/discussion/repeated-coordination-game/README.md
Expand Up @@ -2,5 +2,7 @@ Source files for an image used in the description of a repeated game

Compilation instructions:

$ latexmk --xelatex main.tex
$ convert -density 300 main.pdf -quality 90 main.png
```
$ latexmk --xelatex main.tex
$ convert -density 300 main.pdf -quality 90 main.png
```
1 change: 1 addition & 0 deletions docs/contributing/discussion/index.rst
Expand Up @@ -23,3 +23,4 @@ Discussion
alex/index.rst
github_actions/index.rst
readthedocs/index.rst
mdformat/index.rst
40 changes: 40 additions & 0 deletions docs/contributing/discussion/mdformat/index.rst
@@ -0,0 +1,40 @@
.. _mdformat-discussion:

Ensuring consistent markdown format with mdformat
=================================================

From the :code:`mdformat`'s `documentation page
<https://mdformat.readthedocs.io/en/stable/>`_:

.. pull-quote::

"Mdformat is an opinionated Markdown formatter that can be used to enforce a
consistent style in Markdown files. Mdformat is a Unix-style command-line
tool as well as a Python library."

The rationale for using :code:`mdformat` is the same as the one for using
:ref:`black <black-discussion>` which is to avoid spending any time thinking
about the formatting of source files.

Examples of choices that :code:`mdformat` will make:

.. code-block:: md
# Hello world
Here is how to write some python code:
print("Hello Nashpy!)
become:

.. code-block:: md
# Hello world
Here is how to write some python code:
```
print("Hello Nashpy!)
```
32 changes: 32 additions & 0 deletions docs/contributing/how-to/how-to-format-markdown-files/index.rst
@@ -0,0 +1,32 @@
How to format markdown files
============================

The markdown files are all formatted according to a consistent style using
`mdformat <https://mdformat.readthedocs.io/en/stable/>`_.

How to install mdformat
-----------------------

To install :code:`mdformat` run::

$ python -m pip install mdformat

How to format all markdown files
--------------------------------

To run :code:`mdformat` on a specific :code:`<file>`::

$ python -m mdformat <file>

This will reformat :code:`<file>` in place.

To run :code:`mdformat` recursively from the current directory::

$ python -m mdformat .

How to check markdown files
---------------------------

To check the format of :code:`<file>`::

$ python -m mdformat --check <file>
1 change: 1 addition & 0 deletions docs/contributing/how-to/index.rst
Expand Up @@ -20,3 +20,4 @@ How to:
how-to-make-a-commit/index.rst
how-to-push-changes/index.rst
how-to-open-a-pull-request/index.rst
how-to-format-markdown-files/index.rst
File renamed without changes.

0 comments on commit 071e373

Please sign in to comment.