-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from AdamRJensen/sphinx
Setup sphinx and automatic documentation
- Loading branch information
Showing
25 changed files
with
1,999 additions
and
1,577 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,11 @@ | ||
.ipynb_checkpoints | ||
.vscode | ||
*/.ipynb_checkpoints/* | ||
__pycache__/* | ||
test_file.csv | ||
__pycache__/ | ||
|
||
# Distribution / packaging | ||
*/build/ | ||
*.egg-info/ | ||
|
||
# generated documentation | ||
docs/source/generated |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
version: 2 | ||
|
||
conda: | ||
environment: docs/environment.yml | ||
|
||
build: | ||
image: latest | ||
|
||
# This part is necessary otherwise the project is not built | ||
python: | ||
version: 3.7 | ||
install: | ||
- method: pip | ||
path: . | ||
|
||
# By default readthedocs does not checkout git submodules | ||
submodules: | ||
include: all |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,28 @@ | ||
# Open source code for calculating self-shading of two-axis tracking solar collectors | ||
This repository contains Python code for simulation self-shading in fields of two-axis solar trackers. | ||
"twoaxistracking" is a python package for simulating self-shading in fields of two-axis trackers. | ||
|
||
The two main functions are `generate_field_layout` and `two_axis_shading_fraction`. The function `generate_field_layout` calculates the collector locations for a user-defined regular field layout. For an introduction to regular field layouts and the defining parameters, please see the paper by [Cumpston and Pye (2014)](https://doi.org/10.1016/j.solener.2014.06.012). | ||
## Documentation | ||
The documentation can be found at [readthedocs](https://twoaxistracking.readthedocs.io/). | ||
|
||
The function `two_axis_shading_fraction` is used to calculate the shading fraction based on a specific field layout, aperture geometry, and solar position. Check out the [example tutorial](https://github.com/AdamRJensen/two_axis_tracker_shading/blob/main/notebooks/Example%20time%20series%20generation.ipynb) to get started! Alternatively, each function is documented according to the numpydoc style guide. | ||
## Installation and dependencies | ||
The package can be installed using pip: | ||
|
||
pip install twoaxistracking | ||
|
||
## Dependencies | ||
The main non-standard dependency is `shapely`, which handles the geometric operations. It is recommended to install `shapely` using conda, which can be done by executing the following command in an Anaconda Prompt: | ||
|
||
conda install shapely | ||
|
||
The solar modeling library `pvlib` is recommended for calculating the solar position and can similarly be installed by the command: | ||
The solar modeling library `pvlib` is recommended for calculating the solar position and can be installed by the command: | ||
|
||
conda install -c conda-forge pvlib-python | ||
## Citing | ||
If you use the package in published work, please cite: | ||
> Adam R. Jensen et al. 2022. | ||
> "Self-shading of two-axis tracking solar collectors: Impact of field layout, latitude, and aperture shape." | ||
> Accepted in Solar Energy. | ||
## Contributing | ||
Contributions to the repository, e.g., bug fixes and improvements to speed up the code are more than welcome. | ||
|
||
|
||
## License | ||
BSD 3-clause. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
name: readthedocs | ||
channels: | ||
- defaults | ||
- conda-forge | ||
dependencies: | ||
- python=3.7 | ||
- pandas | ||
- matplotlib | ||
- numpy | ||
- shapely # Should be installed with conda | ||
- sphinx | ||
- pip: | ||
- pvlib | ||
- myst-nb | ||
- sphinx-book-theme |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
||
if "%1" == "" goto help | ||
|
||
%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 | ||
) | ||
|
||
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% | ||
goto end | ||
|
||
:help | ||
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% | ||
|
||
:end | ||
popd |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
# Configuration file for the Sphinx documentation builder. | ||
# | ||
# This file only contains a selection of the most common options. For a full | ||
# list see the documentation: | ||
# https://www.sphinx-doc.org/en/master/usage/configuration.html | ||
|
||
# -- Path setup -------------------------------------------------------------- | ||
|
||
# If extensions (or modules to document with autodoc) are in another directory, | ||
# add these directories to sys.path here. If the directory is relative to the | ||
# documentation root, use os.path.abspath to make it absolute, like shown here. | ||
import os | ||
import sys | ||
sys.path.insert(0, os.path.abspath('../../')) | ||
|
||
# -- Project information ----------------------------------------------------- | ||
|
||
project = 'Two-axis tracking' | ||
copyright = '2021-2022, twoaxistracking Development Team' | ||
author = 'twoaxistracking Development Team' | ||
|
||
|
||
# -- General configuration --------------------------------------------------- | ||
|
||
# Add any Sphinx extension module names here, as strings. They can be | ||
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom | ||
# ones. | ||
extensions = [ | ||
'myst_nb', # markdown and jupyter-notebook parsing | ||
'sphinx.ext.autodoc', # generate documentation from docstrings | ||
'sphinx.ext.autosummary', | ||
'sphinx.ext.intersphinx', | ||
'sphinx.ext.napoleon', # parsing of Numpy docstrings | ||
] | ||
|
||
# Add any paths that contain templates here, relative to this directory. | ||
# 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 = [] | ||
|
||
|
||
# -- Options for HTML output ------------------------------------------------- | ||
|
||
# The theme to use for HTML and HTML Help pages. See the documentation for | ||
# a list of builtin themes. | ||
html_theme = 'sphinx_book_theme' | ||
html_title = 'Two-axis tracking' | ||
html_logo = "_static/twoaxistracking_logo.svg" | ||
html_favicon = "_static/twoaxistracking_logo.svg" | ||
|
||
# Add any paths that contain custom static files (such as style sheets) here, | ||
# relative to this directory. They are copied after the builtin static files, | ||
# so a file named "default.css" will overwrite the builtin "default.css". | ||
html_static_path = ['_static'] | ||
|
||
# The name of the Pygments (syntax highlighting) style to use. | ||
pygments_style = 'sphinx' | ||
|
||
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. | ||
html_show_copyright = False | ||
|
||
# Example configuration for intersphinx: refer to the Python standard library. | ||
intersphinx_mapping = { | ||
'python': ('https://docs.python.org/3/', None), | ||
'numpy': ('https://numpy.org/doc/stable/', None), | ||
'pandas': ('https://pandas.pydata.org/pandas-docs/stable', None), | ||
'matplotlib': ('https://matplotlib.org/stable', None), | ||
'shapely': ('https://shapely.readthedocs.io/en/stable', None), | ||
} | ||
|
||
# Number of seconds for a cell to execute before timeout (default=30) | ||
nbsphinx_timeout = 60 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
.. currentmodule:: twoaxistracking | ||
|
||
|
||
Code documentation | ||
================== | ||
|
||
.. autosummary:: | ||
:toctree: generated/ | ||
|
||
shaded_fraction | ||
generate_field_layout |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Simulating two-axis tracking solar collectors | ||
|
||
`twoaxistracking` is a python package for simulating two-axis tracking solar collectors, particularly self-shading. | ||
|
||
For a quick introduction to the package, check out the [intro tutorial](../notebooks/intro_tutorial) which demonstrates the main functionality. For further details, check out the [code documentation](../documentation). | ||
|
||
Note, in the photovoltaics community, two-axis trackers are also commonly referred to as dual-axis trackers (DAT). | ||
|
||
|
||
## Contributing | ||
Contributions to the repository, e.g., bug fixes, feature request are more than welcome! | ||
|
||
|
||
## License | ||
[BSD 3-clause](https://github.com/AdamRJensen/twoaxistracking/blob/main/LICENSE). | ||
|
||
|
||
## Citing | ||
If you use the package in published work, please cite: | ||
> Adam R. Jensen et al. 2022. | ||
> "Self-shading of two-axis tracking solar collectors: Impact of field layout, latitude, and aperture shape." | ||
> Solar Energy (2022). [https://doi.org/10.1016/j.solener.2022.02.023](https://doi.org/10.1016/j.solener.2022.02.023) | ||
|
||
```{toctree} | ||
:maxdepth: 1 | ||
:hidden: | ||
notebooks/intro_tutorial | ||
installation | ||
documentation | ||
whatsnew | ||
notebooks/reference_dataset | ||
notebooks/field_layout_discretization | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Installation | ||
|
||
The package can be installed from [PyPi](https://pypi.org/) with the following command: | ||
|
||
pip install twoaxistracking | ||
|
||
The main non-standard dependency is `shapely`, which handles the geometric operations (i.e., shading calculations). It is highly recommended to install `shapely` using conda, which can be done by executing the following command in an Anaconda Prompt: | ||
|
||
conda install shapely | ||
|
||
The solar energy modeling library `pvlib` is recommended for calculating the solar position and can be installed by the command: | ||
|
||
pip install pvlib |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.