Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
hypertiling
hypertiling
Commits
fe5d7fef
Commit
fe5d7fef
authored
May 24, 2022
by
Manuel Schrauth
Browse files
include Jupyter notebooks in sphinx
parent
65386abb
Pipeline
#15322
canceled with stages
in 7 minutes and 43 seconds
Changes
7
Pipelines
1
Expand all
Hide whitespace changes
Inline
Side-by-side
doc/conf.py
View file @
fe5d7fef
...
...
@@ -17,9 +17,9 @@ sys.path.insert(0, os.path.abspath('..'))
# -- Project information -----------------------------------------------------
project
=
'
H
ypertiling'
project
=
'
h
ypertiling'
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 -------------------------------------------------
...
...
doc/index.rst
View file @
fe5d7fef
...
...
@@ -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
...
...
examples/examples.ipynb
View file @
fe5d7fef
...
...
@@ -5,26 +5,7 @@
"id": "dc547e92",
"metadata": {},
"source": [
"<center>\n",
"<br>\n",
"<font size=\"+3\">\n",
" <p style=\"font-family: 'Open Sans'; text-align:center;\">\n",
" <b>\n",
" hypertiling\n",
" </b>\n",
" </p>\n",
"</font>\n",
"<br>\n",
"\n",
"<font size=\"+1\">\n",
" <p style=\"font-family: 'Open Sans'; text-align:center;\">\n",
" <b><br>\n",
" Examples \n",
" </b>\n",
"</p>\n",
"</font>\n",
"<br>\n",
"</center>\n"
"# Getting Started"
]
},
{
...
...
@@ -231,7 +212,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3
(ipykernel)
",
"language": "python",
"name": "python3"
},
...
...
@@ -245,7 +226,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.
6.13
"
"version": "3.
9.7
"
},
"toc": {
"base_numbering": 1,
...
...
%% 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
```
...
...
examples/geodesics.ipynb
View file @
fe5d7fef
...
...
@@ -5,26 +5,7 @@
"id": "5669a1da",
"metadata": {},
"source": [
"<center>\n",
"<br>\n",
"<font size=\"+3\">\n",
" <p style=\"font-family: 'Open Sans'; text-align:center;\">\n",
" <b>\n",
" hypertiling\n",
" </b>\n",
" </p>\n",
"</font>\n",
"<br>\n",
"\n",
"<font size=\"+1\">\n",
" <p style=\"font-family: 'Open Sans'; text-align:center;\">\n",
" <b><br>\n",
" Geodesics \n",
" </b>\n",
"</p>\n",
"</font>\n",
"<br>\n",
"</center>\n"
"# Geodesics"
]
},
{
...
...
@@ -291,7 +272,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3
(ipykernel)
",
"language": "python",
"name": "python3"
},
...
...
@@ -305,7 +286,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.
6.13
"
"version": "3.
9.7
"
},
"toc": {
"base_numbering": 1,
...
...
%% 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>