Commit fe5d7fef authored by Manuel Schrauth's avatar Manuel Schrauth
Browse files

include Jupyter notebooks in sphinx

parent 65386abb
Pipeline #15322 canceled with stages
in 7 minutes and 43 seconds
......@@ -17,9 +17,9 @@ sys.path.insert(0, os.path.abspath('..'))
# -- Project information -----------------------------------------------------
project = 'Hypertiling'
project = 'hypertiling'
copyright = '2022, The Hypertiling project'
author = 'Manuel Schrauth, Felix Dusel, Dietmar Herdt, Florian Goth'
author = 'Manuel Schrauth, Felix Dusel, Dietmar Herdt, Florian Goth, Jefferson S. E. Portela'
# -- General configuration ---------------------------------------------------
......@@ -27,7 +27,11 @@ author = 'Manuel Schrauth, Felix Dusel, Dietmar Herdt, Florian Goth'
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.napoleon']
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.napoleon', 'nbsphinx']
nbsphinx_execute = 'never'
nbsphinx_allow_errors = True
source_suffix = ['.rst', '.md']
# note: do not add .ipynb when nbspinx is enabled, otherwise you get the "missing title" error
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
......@@ -35,7 +39,7 @@ templates_path = ['_templates']
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store', 'html']
# -- Options for HTML output -------------------------------------------------
......
......@@ -21,12 +21,21 @@ Welcome to the official documentation of the hypertiling package! This page is u
.. toctree::
:maxdepth: 2
:caption: Contents
:caption: Get Hypertiling
installation
source
changelog
getting_started
.. toctree::
:maxdepth: 2
:caption: Examples
nbcopies/examples.ipynb
nbcopies/geodesics.ipynb
nbcopies/logo.ipynb
nbcopies/refinements.ipynb
.. toctree::
:maxdepth: 2
......
%% Cell type:markdown id:dc547e92 tags:
 
<center>
<br>
<font size="+3">
<p style="font-family: 'Open Sans'; text-align:center;">
<b>
hypertiling
</b>
</p>
</font>
<br>
<font size="+1">
<p style="font-family: 'Open Sans'; text-align:center;">
<b><br>
Examples
</b>
</p>
</font>
<br>
</center>
# Getting Started
 
%% Cell type:markdown id:7af94644 tags:
 
Import tiling object from *hypertiling* library
 
%% Cell type:code id:754487e6 tags:
 
``` python
from hypertiling import HyperbolicTiling
```
 
%% Cell type:markdown id:cc8e0d9a tags:
 
Set parameters, initialize and generate the tiling
 
%% Cell type:code id:8af13c20 tags:
 
``` python
p = 7
q = 3
nlayers = 5
 
T = HyperbolicTiling(p,q,nlayers)
T.generate()
 
print("Number of polygons:", len(T))
```
 
%% Output
 
Number of polygons: 232
 
%% Cell type:markdown id:5d703018 tags:
 
Use available script for a quick plot
 
%% Cell type:code id:c415f6f1 tags:
 
``` python
from hypertiling.plot import plot_tiling
 
import matplotlib.pyplot as plt
import matplotlib.cm as cmap
import numpy as np
```
 
%% Cell type:code id:9686c270 tags:
 
``` python
plot_tiling(T, np.random.rand(len(T)), cmap=cmap.RdBu, edgecolor="k", lw=0.12)
plt.show()
```
 
%% Output
 
 
%% Cell type:code id:8b2e4cb7 tags:
 
``` python
p = 4
q = 5
nlayers = 6
 
T = HyperbolicTiling(p,q,nlayers)
T.generate()
print("Number of polygons:", len(T))
```
 
%% Output
 
Number of polygons: 3421
 
%% Cell type:code id:36a719c9 tags:
 
``` python
plot_tiling(T, np.random.rand(len(T)), cmap=cmap.RdBu, edgecolor="k", lw=0.12)
plt.show()
```
 
%% Output
 
 
%% Cell type:code id:b5b3c2ff tags:
 
``` python
p = 3
q = 12
nlayers = 4
 
T = HyperbolicTiling(p,q,nlayers)
T.generate()
print("Number of polygons:", len(T))
```
 
%% Output
 
Number of polygons: 2161
 
%% Cell type:code id:55e3d92a tags:
 
``` python
plot_tiling(T, np.random.rand(len(T)), cmap=cmap.RdBu, edgecolor="k", lw=0.12)
plt.show()
```
 
%% Output
 
 
%% Cell type:code id:9d76471a tags:
 
``` python
```
......
%% Cell type:markdown id:5669a1da tags:
 
<center>
<br>
<font size="+3">
<p style="font-family: 'Open Sans'; text-align:center;">
<b>
hypertiling
</b>
</p>
</font>
<br>
<font size="+1">
<p style="font-family: 'Open Sans'; text-align:center;">
<b><br>
Geodesics
</b>
</p>
</font>
<br>