Reformat the docs and add myst-nb as a doc dep

This commit is contained in:
Tom Hodson 2022-06-17 12:23:40 +02:00
parent b8392ed703
commit d2258ae35c
6 changed files with 57 additions and 46 deletions

14
code/docs/api_docs.rst Normal file
View File

@ -0,0 +1,14 @@
API Docs
========
MCMC : Markov Chain Monte Carlo Routines
---------------------------------------------
.. automodule:: MCFF.mcmc
:members:
Ising_Model : Ising Model Routines
---------------------------------------------
.. automodule:: MCFF.ising_model
:members:

View File

@ -34,8 +34,12 @@ release = "1.0"
extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.napoleon",
"myst_nb",
]
# Tell myst_nb not to execute the notebooks
nb_execution_mode = "off"
# Add any paths that contain templates here, relative to this directory.
templates_path = ["_templates"]

View File

@ -7,54 +7,14 @@ You can find the source code and main landing page for this project on `GitHub <
There is a `Jupyter notebook <https://github.com/TomHodson/ReCoDE_MCMCFF>`_ detailing how this page was generated in there.
Quickstart
----------
.. code-block:: python
from MCFF.mcmc import mcmc_generator
from MCFF.ising_model import show_state
### Simulation Inputs ###
N = 500 # Use an NxN system
initial_state = np.random.choice(
np.array([-1, 1], dtype=np.int8), size=(N, N)
) # the intial state to use
### Simulation Code ###
critical_states = [
s for s in mcmc_generator(initial_state, steps=5, stepsize=5*N**2, T= 3.5)
]
fig, axes = plt.subplots(
ncols=len(critical_states), figsize=(5 * len(critical_states), 5)
)
for s, ax in zip(critical_states, axes):
show_state(s, ax=ax)
.. image:: _static/states.png
:width: 100%
:alt: 5 grids showing black and white Ising Model states
.. toctree::
:maxdepth: 2
:caption: Contents:
:maxdepth: 1
:glob:
:caption: Table of Contents:
mcmc : Markov Chain Monte Carlo Routines
---------------------------------------------
.. automodule:: MCFF.mcmc
:members:
ising_model : Ising Model Routines
---------------------------------------------
.. automodule:: MCFF.ising_model
:members:
quickstart
api_docs
learning/*

30
code/docs/quickstart.rst Normal file
View File

@ -0,0 +1,30 @@
Quickstart
----------
.. code-block:: python
from MCFF.mcmc import mcmc_generator
from MCFF.ising_model import show_state
### Simulation Inputs ###
N = 500 # Use an NxN system
initial_state = np.random.choice(
np.array([-1, 1], dtype=np.int8), size=(N, N)
) # the intial state to use
### Simulation Code ###
critical_states = [
s for s in mcmc_generator(initial_state, steps=5, stepsize=5*N**2, T= 3.5)
]
fig, axes = plt.subplots(
ncols=len(critical_states), figsize=(5 * len(critical_states), 5)
)
for s, ax in zip(critical_states, axes):
show_state(s, ax=ax)
.. image:: _static/states.png
:width: 100%
:alt: 5 grids showing black and white Ising Model states

View File

@ -0,0 +1,2 @@
sphinx
myst-nb

View File

@ -23,5 +23,6 @@ sphinx:
python:
install:
- requirements: requirements.txt
- requirements: code/docs/requirements.txt
- method: pip
path: code/