Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 2 additions & 49 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,7 @@
import sys
from pathlib import Path

# Ensure pandoc is in PATH for nbsphinx
try:
import pypandoc

pandoc_dir = str(Path(pypandoc.get_pandoc_path()).parent)
if pandoc_dir not in os.environ.get("PATH", ""):
os.environ["PATH"] = f"{pandoc_dir}{os.pathsep}{os.environ.get('PATH', '')}"
except ImportError:
pass # pypandoc not available, assume system pandoc
# (removed pypandoc handling; notebooks are not processed during docs build)

ROOT = Path(__file__).resolve().parents[1]
sys.path.insert(0, str(ROOT))
Expand Down Expand Up @@ -75,7 +67,6 @@
"sphinx.ext.viewcode",
"sphinx.ext.napoleon", # supporto Google/NumPy style docstrings
"sphinx.ext.intersphinx", # cross-link con altra doc
"nbsphinx", # Jupyter notebook support
]

# Make autosummary scan pages and create stubs automatically
Expand Down Expand Up @@ -127,45 +118,7 @@
# Evita warning se mancano __all__
autodoc_inherit_docstrings = True

# -- nbsphinx configuration --------------------------------------------------

# Add the tutorial directory to the source paths
import shutil

tutorial_source = ROOT / "tutorial"
tutorial_dest = Path(__file__).parent / "tutorial"

# Create symlink or copy notebooks to docs/tutorial if they don't exist
if not tutorial_dest.exists():
tutorial_dest.mkdir(exist_ok=True)

# This is processed by Jinja2 and inserted before each notebook
nbsphinx_prolog = r"""
{% set docname = env.doc2path(env.docname, base=None) %}

.. raw:: html

<div class="admonition note">
<p class="admonition-title">Note</p>
<p>This page was generated from
<a class="reference external" href="https://github.com/GiulioRossetti/ASH/blob/{{ env.config.release|e }}/{{ docname|e }}">{{ docname|e }}</a>.
</p>
</div>
"""

# Execute notebooks before conversion: 'always', 'never', 'auto' (default)
nbsphinx_execute = (
"never" # Don't execute notebooks during build (they should be pre-executed)
)

# Allow errors in notebook execution
nbsphinx_allow_errors = True

# Timeout for notebook execution (in seconds)
nbsphinx_timeout = 180

# Exclude output files and checkpoint folders
nbsphinx_exclude_output_prompt = False
# Notebooks in `tutorial/` are intended to live in the repo and be browsed on GitHub.

# -- Options for HTML output -------------------------------------------------

Expand Down
2 changes: 0 additions & 2 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
sphinx>=4.0
furo
nbsphinx>=0.8.0
pypandoc-binary
ipykernel
jupyter
numpy<2.0
Expand Down
23 changes: 12 additions & 11 deletions docs/tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,18 @@ Each tutorial is a Jupyter notebook that demonstrates different aspects of the l

All tutorial notebooks are available in the `tutorial/ <https://github.com/GiulioRossetti/ASH/tree/main/tutorial>`_ folder of the repository.

.. toctree::
:maxdepth: 2
:caption: Tutorial Notebooks

tutorial/00-basics
tutorial/01-attribute_analysis
tutorial/02-walks
tutorial/03-generators
tutorial/04-io
tutorial/05-multiego
tutorial/06-segregation
Tutorial notebooks (links on GitHub)
-----------------------------------

The notebooks are kept in the repository under the `tutorial/` folder and are intended to be opened on GitHub or in your local Jupyter environment. The documentation build no longer renders notebooks into the HTML site; instead use the links below to view or download the notebooks from GitHub:

- `00-basics.ipynb <https://github.com/GiulioRossetti/ASH/blob/main/tutorial/00-basics.ipynb>`_
- `01-attribute_analysis.ipynb <https://github.com/GiulioRossetti/ASH/blob/main/tutorial/01-attribute_analysis.ipynb>`_
- `02-walks.ipynb <https://github.com/GiulioRossetti/ASH/blob/main/tutorial/02-walks.ipynb>`_
- `03-generators.ipynb <https://github.com/GiulioRossetti/ASH/blob/main/tutorial/03-generators.ipynb>`_
- `04-io.ipynb <https://github.com/GiulioRossetti/ASH/blob/main/tutorial/04-io.ipynb>`_
- `05-multiego.ipynb <https://github.com/GiulioRossetti/ASH/blob/main/tutorial/05-multiego.ipynb>`_
- `06-segregation.ipynb <https://github.com/GiulioRossetti/ASH/blob/main/tutorial/06-segregation.ipynb>`_

Getting Started
---------------
Expand Down
1 change: 0 additions & 1 deletion requirements_docs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@ matplotlib
pandas
tqdm
sphinx_rtd_theme
nbsphinx
furo
109 changes: 8 additions & 101 deletions tutorial/00-basics.ipynb

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions tutorial/01-attribute_analysis.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"<span>\n",
"<b>Author:</b> <a href=\"https://andreafailla.github.io\">Andrea Failla</a><br/>\n",
"<b>Python version:</b> 3.9<br/>\n",
"<b>ASH version:</b> 0.1.0<br/>\n",
"<b>Last update:</b> July 2025\n",
"<b>ASH version:</b> 1.0.0<br/>\n",
"<b>Last update:</b> November 2025\n",
"</span>"
]
},
Expand Down
6 changes: 3 additions & 3 deletions tutorial/02-walks.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
"metadata": {},
"source": [
"<span>\n",
"<img src=\"http://ash.readthedocs.io/en/latest/_static/ash.png\" width=\"260px\" align=\"right\"/>\n",
"<img src=\"http://ash-model.readthedocs.io/en/latest/_static/ash.png\" width=\"260px\" align=\"right\"/>\n",
"</span>\n",
"<span>\n",
"<b>Author:</b> <a href=\"https://andreafailla.github.io\">Andrea Failla</a><br/>\n",
"<b>Python version:</b> 3.9<br/>\n",
"<b>ASH version:</b> 0.1.0<br/>\n",
"<b>Last update:</b> July 2025\n",
"<b>ASH version:</b> 1.0.0<br/>\n",
"<b>Last update:</b> November 2025\n",
"</span>"
]
},
Expand Down
6 changes: 3 additions & 3 deletions tutorial/03-generators.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
"metadata": {},
"source": [
"<span>\n",
"<img src=\"http://ash.readthedocs.io/en/latest/_static/ash.png\" width=\"260px\" align=\"right\"/>\n",
"<img src=\"http://ash-model.readthedocs.io/en/latest/_static/ash.png\" width=\"260px\" align=\"right\"/>\n",
"</span>\n",
"<span>\n",
"<b>Author:</b> <a href=\"https://andreafailla.github.io\">Andrea Failla</a><br/>\n",
"<b>Python version:</b> 3.9<br/>\n",
"<b>ASH version:</b> 0.1.0<br/>\n",
"<b>Last update:</b> July 2025\n",
"<b>ASH version:</b> 1.0.0<br/>\n",
"<b>Last update:</b> November 2025\n",
"</span>"
]
},
Expand Down
6 changes: 3 additions & 3 deletions tutorial/04-io.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
"metadata": {},
"source": [
"<span>\n",
"<img src=\"http://ash.readthedocs.io/en/latest/_static/ash.png\" width=\"260px\" align=\"right\"/>\n",
"<img src=\"http://ash-model.readthedocs.io/en/latest/_static/ash.png\" width=\"260px\" align=\"right\"/>\n",
"</span>\n",
"<span>\n",
"<b>Author:</b> <a href=\"https://andreafailla.github.io\">Andrea Failla</a><br/>\n",
"<b>Python version:</b> 3.9<br/>\n",
"<b>ASH version:</b> 0.1.0<br/>\n",
"<b>Last update:</b> July 2025\n",
"<b>ASH version:</b> 1.0.0<br/>\n",
"<b>Last update:</b> November 2025\n",
"</span>"
]
},
Expand Down
2 changes: 1 addition & 1 deletion tutorial/05-multiego.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"metadata": {},
"source": [
"<span>\n",
"<img src=\"http://ash.readthedocs.io/en/latest/_static/ash.png\" width=\"260px\" align=\"right\"/>\n",
"<img src=\"http://ash-model.readthedocs.io/en/latest/_static/ash.png\" width=\"260px\" align=\"right\"/>\n",
"</span>\n",
"<span>\n",
"<b>Author:</b> <a href=\"https://andreafailla.github.io\">Andrea Failla</a><br/>\n",
Expand Down
2 changes: 1 addition & 1 deletion tutorial/06-segregation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"metadata": {},
"source": [
"<span>\n",
"<img src=\"http://ash.readthedocs.io/en/latest/_static/ash.png\" width=\"260px\" align=\"right\"/>\n",
"<img src=\"http://ash-model.readthedocs.io/en/latest/_static/ash.png\" width=\"260px\" align=\"right\"/>\n",
"</span>\n",
"<span>\n",
"<b>Author:</b> <a href=\"https://andreafailla.github.io\">Andrea Failla</a><br/>\n",
Expand Down
Loading