Skip to content

Commit

Permalink
build docs with mkdocs
Browse files Browse the repository at this point in the history
  • Loading branch information
jay-m-dev committed May 19, 2023
1 parent d97a8dc commit 42fedb3
Show file tree
Hide file tree
Showing 22 changed files with 389 additions and 149 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Docs Build

on:
push:
branches:
- mkdocs_no_exec

jobs:
build_docs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.10'

- name: Install dependencies
run: |
pip install --upgrade pip
pip install .
pip install -r docs/requirements_docs.txt
# - name: Convert notebooks to HTML
# # if: ${{ github.event_name == 'push' && contains(github.event.head_commit.modified, 'Tutorial/') && contains(github.event.head_commit.modified, '.ipynb') }}
# run: |
# # jupyter nbconvert --to html --allow-errors --no-input --show-input --template classic --output-dir docs/tutorial Tutorial/*.ipynb
# jupyter nbconvert --to html --allow-errors --template classic --output-dir docs/tutorial Tutorial/*.ipynb

# - name: Build Tutorial Table of Contents
# run: |
# bash docs/scripts/build_tutorial_toc.sh

- name: Build Documentation sources
run: |
bash docs/scripts/build_docs_sources.sh
- name: Build mkdocs.yml
run: |
bash docs/scripts/build_mkdocs.sh
- name: Build and Deploy Docs
run: |
mkdocs gh-deploy --force --clean --verbose
36 changes: 1 addition & 35 deletions .github/workflows/publish_package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,38 +29,4 @@ jobs:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: twine upload dist/*
build-and-publish-conda:
needs: build-and-publish-pypi
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: '3.10'

- name: Install dependencies
run: |
conda install -c conda-forge grayskull conda-build anaconda-client -y
- name: Build conda recipe from PYPI
run: |
$CONDA/bin/grayskull pypi tpot2
- name: Update meta.yaml
run: |
sed -i "/tpot2 --help/d" tpot2/meta.yaml
sed -i "/^ license:/ s/.*/ license: LGPLv3/" tpot2/meta.yaml
sed -i "/^ license_file:/ s/.*/ license_file: ..\/LICENSE/" tpot2/meta.yaml
- name: Build package with conda-forge
run: |
$CONDA/bin/conda-build tpot2 -c conda-forge
- name: Upload to conda-forge
env:
CONDA_API_TOKEN: ${{ secrets.CONDA_API_TOKEN }}
run: |
$CONDA/bin/anaconda -t $CONDA_API_TOKEN upload -u conda-forge $CONDA/conda-bld/noarch/*.tar.bz2

4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,6 @@ cache_folder/
dask-worker-space/
.tox/
*.egg-info/
.coverage
.coverage
target/
.venv/
1 change: 1 addition & 0 deletions docs/Tutorial
1 change: 1 addition & 0 deletions docs/cite.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Citing TPOT2
3 changes: 3 additions & 0 deletions docs/contribute.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Contributing

We welcome you to check the existing issues for bugs or enhancements to work on. If you have an idea for an extension to TPOT, please file a new issue so we can discuss it.
3 changes: 3 additions & 0 deletions docs/css/extra.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.md-grid {
max-width: 100%;
}
3 changes: 3 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{%
include-markdown "../README.md"
%}
34 changes: 34 additions & 0 deletions docs/installation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Installation

TPOT2 requires a working installation of Python.

### Creating a conda environment (optional)

We recommend using conda environments for installing TPOT2, though it would work equally well if manually installed without it.

[More information on making anaconda environments found here.](https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html)

```
conda create --name tpot2env python=3.10
conda activate tpot2env
```

### Note for M1 Mac or other Arm-based CPU users

You need to install the lightgbm package directly from conda using the following command before installing TPOT2.

This is to ensure that you get the version that is compatible with your system.

```
conda install --yes -c conda-forge 'lightgbm>=3.3.3'
```

### Developer/Latest Branch Installation


```
pip install -e /path/to/tpot2repo
```

If you downloaded with git pull, then the repository folder will be named TPOT2. (Note: this folder is the one that includes setup.py inside of it and not the folder of the same name inside it).
If you downloaded as a zip, the folder may be called tpot2-main.
112 changes: 112 additions & 0 deletions docs/related.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
Other Automated Machine Learning (AutoML) tools and related projects:

<table>
<tr>
<th width="20%">Name</th>
<th width="15%">Language</th>
<th width="15%">License</th>
<th>Description</th>
</tr>
<tr>
<td><a target="_blank" href="http://www.cs.ubc.ca/labs/beta/Projects/autoweka/">Auto-WEKA</a></td>
<td>Java</td>
<td>GPL-v3</td>
<td>Automated model selection and hyper-parameter tuning for Weka models.</td>
</tr>
<tr>
<td><a target="_blank" href="https://github.com/automl/auto-sklearn">auto-sklearn</a></td>
<td>Python</td>
<td>BSD-3-Clause</td>
<td>An automated machine learning toolkit and a drop-in replacement for a scikit-learn estimator.</td>
</tr>
<tr>
<td><a target="_blank" href="https://github.com/ClimbsRocks/auto_ml">auto_ml</a></td>
<td>Python</td>
<td>MIT</td>
<td>Automated machine learning for analytics & production. Supports manual feature type declarations.</td>
</tr>
<tr>
<td><a target="_blank" href="http://docs.h2o.ai/h2o/latest-stable/h2o-docs/automl.html">H2O AutoML</a></td>
<td>Java with Python, Scala & R APIs and web GUI</td>
<td>Apache 2.0</td>
<td>Automated: data prep, hyperparameter tuning, random grid search and stacked ensembles in a distributed ML platform.</td>
</tr>
<tr>
<td><a target="_blank" href="https://github.com/joeddav/devol">devol</a></td>
<td>Python</td>
<td>MIT</td>
<td>Automated deep neural network design via genetic programming.</td>
</tr>
<tr>
<td><a target="_blank" href="https://github.com/AxeldeRomblay/MLBox">MLBox</a></td>
<td>Python</td>
<td>BSD-3-Clause</td>
<td>Accurate hyper-parameter optimization in high-dimensional space with support for distributed computing.</td>
</tr>
<tr>
<td><a target="_blank" href="https://github.com/RecipeML/Recipe">Recipe</a></td>
<td>C</td>
<td>GPL-v3</td>
<td>Machine-learning pipeline optimization through genetic programming. Uses grammars to define pipeline structure.</td>
</tr>
<tr>
<td><a target="_blank" href="https://github.com/reiinakano/xcessiv">Xcessiv</a></td>
<td>Python</td>
<td>Apache 2.0</td>
<td>A web-based application for quick, scalable, and automated hyper-parameter tuning and stacked ensembling in Python.</td>
</tr>
<tr>
<td><a target="_blank" href="https://github.com/PGijsbers/gama">GAMA</a></td>
<td>Python</td>
<td>Apache 2.0</td>
<td>Machine-learning pipeline optimization through asynchronous evaluation based genetic programming. </td>
</tr>
<tr>
<td><a target="_blank" href="https://pymoo.org">PyMoo</a></td>
<td>Python</td>
<td>Apache 2.0</td>
<td>Multi-objective optimization in Python. </td>
</tr>
<tr>
<td><a target="_blank" href="https://github.com/kstaats/karoo_gp">Karoo GP</a></td>
<td>Python</td>
<td>MIT</td>
<td>A Python based genetic programming application suite with support for symbolic regression and classification. </td>
</tr>
<tr>
<td><a target="_blank" href="https://github.com/Hintzelab/MABE/wiki">MABE</a></td>
<td>C++</td>
<td><a target="_blank" href="https://github.com/Hintzelab/MABE/wiki/license">See here</a></td>
<td>A Python based genetic programming application suite with support for symbolic regression and classification. </td>
</tr>
<tr>
<td><a target="_blank" href="https://github.com/jpbonson/SBBFramework">SBBFramework</a></td>
<td>Python</td>
<td>BSD-2-Clause</td>
<td>Python implementation of Symbiotic Bid-Based (SBB) framework for problem decomposition using Genetic Programming (GP). </td>
</tr>
<tr>
<td><a target="_blank" href="https://github.com/moshesipper/tiny_gp">Tiny GP</a></td>
<td>Python</td>
<td>GPL-v3</td>
<td>A minimalistic program implementing Koza-style (tree-based) genetic programming to solve a symbolic regression problem. </td>
</tr>
<tr>
<td><a target="_blank" href="https://github.com/alegonz/baikal">Baikal</a></td>
<td>Python</td>
<td>BSD-3-Clause</td>
<td>A graph-based functional API for building complex scikit-learn pipelines. </td>
</tr>
<tr>
<td><a target="_blank" href="https://github.com/scikit-learn-contrib/skdag">skdag</a></td>
<td>Python</td>
<td>MIT</td>
<td>A more flexible alternative to scikit-learn Pipelines. </td>
</tr>
<tr>
<td><a target="_blank" href="https://github.com/d6t/d6tflow">d6tflow</a></td>
<td>Python</td>
<td>MIT</td>
<td>A python library which makes building complex data science workflows easy, fast and intuitive. </td>
</tr>
</table>
7 changes: 7 additions & 0 deletions docs/requirements_docs.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
mkdocs==1.4.2
mkdocs-material==9.1.6
mkdocs-include-markdown-plugin==4.0.4
nbconvert==7.4.0
mkdocs-jupyter==0.24.1
mkdocstrings==0.21.2
mkdocstrings-python==0.10.1
25 changes: 25 additions & 0 deletions docs/scripts/build_docs_sources.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash

function iterate_files() {
local directory="$1"
base_dir="docs/documentation"

for file in "$directory"/*; do
if [ -f "$file" ] && [[ "$file" == *.py ]] && [ "$(basename "$file")" != "__init__.py" ] && \
! echo "$file" | grep -q "test" && [ "$(basename "$file")" != "graph_utils.py" ]; then
directories=$base_dir/$(dirname "$file")
file_name=$(basename "$file")
md_file=$directories/"${file_name%.*}".md

mkdir -p $directories && touch $md_file
include_line=$(dirname "$file")
include_line="${include_line//\//.}"."${file_name%.*}"
echo "::: $include_line" > $md_file

elif [ -d "$file" ]; then
iterate_files "$file"
fi
done
}

iterate_files "tpot2"
Loading

0 comments on commit 42fedb3

Please sign in to comment.