mirror of
https://github.com/ImperialCollegeLondon/ReCoDE_MCMCFF.git
synced 2025-06-26 08:51:16 +02:00
Reformat the docs and add myst-nb as a doc dep
This commit is contained in:
parent
b8392ed703
commit
d2258ae35c
14
code/docs/api_docs.rst
Normal file
14
code/docs/api_docs.rst
Normal 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:
|
@ -34,8 +34,12 @@ release = "1.0"
|
|||||||
extensions = [
|
extensions = [
|
||||||
"sphinx.ext.autodoc",
|
"sphinx.ext.autodoc",
|
||||||
"sphinx.ext.napoleon",
|
"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.
|
# Add any paths that contain templates here, relative to this directory.
|
||||||
templates_path = ["_templates"]
|
templates_path = ["_templates"]
|
||||||
|
|
||||||
|
@ -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.
|
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::
|
.. toctree::
|
||||||
:maxdepth: 2
|
:maxdepth: 1
|
||||||
:caption: Contents:
|
:glob:
|
||||||
|
:caption: Table of Contents:
|
||||||
|
|
||||||
mcmc : Markov Chain Monte Carlo Routines
|
quickstart
|
||||||
---------------------------------------------
|
api_docs
|
||||||
|
learning/*
|
||||||
.. automodule:: MCFF.mcmc
|
|
||||||
:members:
|
|
||||||
|
|
||||||
ising_model : Ising Model Routines
|
|
||||||
---------------------------------------------
|
|
||||||
|
|
||||||
.. automodule:: MCFF.ising_model
|
|
||||||
:members:
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
30
code/docs/quickstart.rst
Normal file
30
code/docs/quickstart.rst
Normal 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
|
@ -0,0 +1,2 @@
|
|||||||
|
sphinx
|
||||||
|
myst-nb
|
@ -23,5 +23,6 @@ sphinx:
|
|||||||
python:
|
python:
|
||||||
install:
|
install:
|
||||||
- requirements: requirements.txt
|
- requirements: requirements.txt
|
||||||
|
- requirements: code/docs/requirements.txt
|
||||||
- method: pip
|
- method: pip
|
||||||
path: code/
|
path: code/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user