Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs #28

Merged
merged 11 commits into from
Dec 30, 2024
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ might have to be rewritten (utils.py)
- [Usage](#usage)
- [Contribute](#contribute)
- [Tests](#tests)
- [Docs](#docs)
- [License](#license)

## Description
Expand Down Expand Up @@ -140,6 +141,29 @@ pip install .[dev]
pytest tests
```

## Docs

Activate the topotherm environment:

```conda activate topotherm```

Then, install the optional requirements:

```pip install .[docs]```

In the topotherm root directory run:

```sphinx-apidoc -o docs/source/ .```

Then make the hmtl documentation files: ::

```
cd docs
make html
```

The documentation is located under docs/build/html.

## License

[MIT](https://en.wikipedia.org/wiki/MIT_License), see LICENSE file.
20 changes: 20 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = source
BUILDDIR = build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
35 changes: 35 additions & 0 deletions docs/make.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=source
set BUILDDIR=build

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.https://www.sphinx-doc.org/
exit /b 1
)

if "%1" == "" goto help

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%

:end
popd
8 changes: 8 additions & 0 deletions docs/modules.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
topotherm-0.2.0
===============

.. toctree::
:maxdepth: 4

setup
topotherm
7 changes: 7 additions & 0 deletions docs/setup.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
setup module
============

.. automodule:: setup
:members:
:undoc-members:
:show-inheritance:
Binary file added docs/source/Figure_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/Figure_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 31 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Configuration file for the Sphinx documentation builder.
#
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information


import sys

project = 'Topotherm'
copyright = '2024, Lambert, Jerry and Ceruti, Amedeo'
author = 'Jerry Lambert & Amedeo Ceruti'
release = '0.2.0'

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

extensions = ['sphinx.ext.autodoc']

templates_path = ['_templates']
exclude_patterns = []



# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output

html_theme = 'sphinx_rtd_theme'
html_static_path = ['_static']
28 changes: 28 additions & 0 deletions docs/source/documentation.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
Documentation
=========

Activate the topotherm environment: ::

conda activate topotherm

Then, install the optional requirements if needed ::

pip install sphinx sphinx-rtd-theme or pip install .[docs]

In the topotherm root directory run: ::

sphinx-apidoc -o docs/source/ .

Then make the hmtl documentation files: ::

cd docs
make html

The documentation is located under docs/build/html

Adding New Pages
-----------------

Create a new rts file under docs/source

Add the name of the created page in index.rst
Binary file added docs/source/graph.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
.. Topotherm documentation master file, created by
sphinx-quickstart on Wed Oct 9 10:16:32 2024.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.

Topotherm documentation
=======================

**Topotherm** is a pyomo-based mixed-integer linear programming district heating
network design model which scales well into larger districts for single
and mulitple time steps.

.. toctree::
overview
install
solver
usage
methodology
documentation
topotherm
:maxdepth: 2
:caption: Contents:

28 changes: 28 additions & 0 deletions docs/source/install.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
Install
=========

Use git to clone this repository into your computer. Then, install topotherm
with a package manager such as Anaconda, or directly with Python. ::

git
git clone https://github.com/jylambert/topotherm.git

Python
---------

This can also be done with venv or equivalent. ::

Python
cd topotherm
python setup.py install

Anaconda or mamba
---------------------

We recommend to install the dependencies with anaconda or mamba: ::

conda
cd topotherm
conda create -n topotherm python
conda activate topotherm
pip install -e .
Loading