Skip to content

Commit 1252077

Browse files
Merge pull request #20 from TristanHehnen/main
Added docs
2 parents ca800c1 + 0124f04 commit 1252077

19 files changed

Lines changed: 136 additions & 11 deletions

File tree

.github/workflows/docs.yaml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
name: Build & Deploy Sphinx docs
2+
3+
on:
4+
push:
5+
branches: [ main ] # change if your default branch is different
6+
pull_request:
7+
branches: [ main ] # build on PRs (no deploy)
8+
workflow_dispatch: # manual run
9+
10+
# Avoid overlapping deployments
11+
concurrency:
12+
group: "pages"
13+
cancel-in-progress: true
14+
15+
permissions:
16+
contents: read
17+
pages: write
18+
id-token: write
19+
20+
jobs:
21+
build:
22+
runs-on: ubuntu-latest
23+
steps:
24+
- name: Checkout
25+
uses: actions/checkout@v4
26+
27+
- name: Set up Python
28+
uses: actions/setup-python@v5
29+
with:
30+
python-version: "3.11" # pick the version you prefer
31+
32+
- name: Cache pip
33+
uses: actions/cache@v4
34+
with:
35+
path: ~/.cache/pip
36+
key: ${{ runner.os }}-pip-${{ hashFiles('docs/requirements.txt') }}
37+
restore-keys: |
38+
${{ runner.os }}-pip-
39+
40+
- name: Install docs dependencies
41+
run: |
42+
python -m pip install --upgrade pip
43+
pip install -r docs/requirements.txt
44+
45+
# If your docs use autodoc (import your package), install it too:
46+
- name: Install package (editable)
47+
run: pip install -e .
48+
49+
# Optional: set html_baseurl at build time (nice for canonical links)
50+
# Replace URL if you want to hardcode; otherwise you can delete -D line.
51+
- name: Build Sphinx HTML
52+
run: |
53+
sphinx-build \
54+
-b html \
55+
-D html_baseurl="https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/" \
56+
docs docs/_build/html
57+
58+
# Optional: include CNAME if you use a custom domain. Create docs/CNAME.
59+
- name: Add CNAME (if present)
60+
run: |
61+
if [ -f docs/CNAME ]; then
62+
cp docs/CNAME docs/_build/html/CNAME
63+
fi
64+
65+
- name: Upload artifact (site)
66+
uses: actions/upload-pages-artifact@v3
67+
with:
68+
path: docs/_build/html
69+
70+
# Deploy only on pushes (not PRs)
71+
deploy:
72+
if: ${{ github.event_name == 'push' }}
73+
needs: build
74+
runs-on: ubuntu-latest
75+
environment:
76+
name: github-pages
77+
url: ${{ steps.deployment.outputs.page_url }}
78+
steps:
79+
- id: deployment
80+
uses: actions/deploy-pages@v4

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
# FireSciPy
2-
Fundamental algorithms from the field of fire science, for computations with Python.
2+
3+
[![FireSciPy Documentation](https://img.shields.io/badge/docs-online-brightgreen)](https://FireDynamics.github.io/FireSciPy/)
4+
5+
Fundamental algorithms from the field of fire science and fire safety engineering, for computations with Python.

docs/conf.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import os
22
import sys
3-
fsp_path = os.path.join("..", "..")
4-
sys.path.insert(0, os.path.abspath(fsp_path)) # So FireSciPy is importable
3+
fsp_path = os.path.join("..", "src")
4+
sys.path.insert(0, os.path.abspath(fsp_path)) # So firescipy is importable
55

6-
project = "FireSciPy"
6+
project = "firescipy"
77
author = "Tristan Hehnen, Lukas Arnold"
88
release = "0.1.0"
99

docs/reference/handcalculation.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This subpackage contains various hand calculations used in fire safety engineeri
66
Design Fires Module
77
-------------------
88

9-
.. automodule:: FireSciPy.handcalculation.design_fires
9+
.. automodule:: firescipy.handcalculation.design_fires
1010
:members:
1111
:undoc-members:
1212
:show-inheritance:

docs/reference/pyrolysis.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This subpackage contains tools for modeling pyrolysis behavior and computing kin
66
Kinetics Module
77
---------------
88

9-
.. automodule:: FireSciPy.pyrolysis.kinetics
9+
.. automodule:: firescipy.pyrolysis.kinetics
1010
:members:
1111
:undoc-members:
1212
:show-inheritance:
@@ -15,7 +15,7 @@ Kinetics Module
1515
Modeling Module
1616
---------------
1717

18-
.. automodule:: FireSciPy.pyrolysis.modeling
18+
.. automodule:: firescipy.pyrolysis.modeling
1919
:members:
2020
:undoc-members:
2121
:show-inheritance:

docs/reference/utils.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Utils Module
22
============
33

4-
.. automodule:: FireSciPy.utils
4+
.. automodule:: firescipy.utils
55
:members:
66
:undoc-members:
77
:show-inheritance:

docs/requirements.txt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
numpy>=1.19.5
2+
scipy>=1.5.4
3+
pandas>=1.1.5
4+
matplotlib>=3.3.4
5+
Sphinx>=4.5.0,<5.0
6+
sphinx-rtd-theme>=1.3.0,<2.0
7+
myst-parser>=0.16.1,<1.0
8+
9+
sphinxcontrib-applehelp==1.0.2
10+
sphinxcontrib-devhelp==1.0.2
11+
sphinxcontrib-htmlhelp==2.0.0
12+
sphinxcontrib-qthelp==1.0.3
13+
sphinxcontrib-serializinghtml==1.1.5

pyproject.toml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
[build-system]
2+
requires = ["setuptools>=64", "wheel"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "firescipy"
7+
version = "0.1.0"
8+
description = "FireSciPy: Fundamental algorithms from the field of fire science, for computations with Python."
9+
readme = "README.md"
10+
requires-python = ">=3.9"
11+
license = { text = "CC-BY-4.0" } # adjust if you use another license
12+
authors = [
13+
{ name = "Tristan Hehnen", email = "you@example.com" },
14+
{ name = "Lukas Arnold", email = "you@example.com" }
15+
]
16+
dependencies = [
17+
"numpy>=1.19.5",
18+
"scipy>=1.5.4",
19+
"pandas>=1.1.5",
20+
"matplotlib>=3.3.4",
21+
# Add other runtime dependencies here
22+
]
23+
24+
[tool.setuptools.packages.find]
25+
where = ["src"]
26+
include = ["firescipy*"]

__init__.py renamed to src/firescipy/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
from . import handcalculation
55

66

7+
__version__ = "0.1.0"
8+
9+
710
# from .utils import ensure_nested_dict, get_nested_value, series_to_numpy, linear_model, calculate_residuals, calculate_R_squared, calculate_RMSE
811
#
912
# __all__ = ['ensure_nested_dict', 'get_nested_value', 'series_to_numpy', 'linear_model', 'calculate_residuals', 'calculate_R_squared', 'calculate_RMSE']

0 commit comments

Comments
 (0)