Skip to content

Commit

Permalink
Merge pull request #43 from automl/docs
Browse files Browse the repository at this point in the history
Setup for automated doc generation via mkdocs
  • Loading branch information
Bronzila committed Jul 22, 2023
2 parents 8b6d373 + bb2f2c8 commit 24b9409
Show file tree
Hide file tree
Showing 30 changed files with 148 additions and 216 deletions.
59 changes: 13 additions & 46 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ on:
# Trigger on any push to the main
push:
branches:
- main
- master
- development

# Trigger on any push to a PR that targets main
pull_request:
branches:
- main
- master
- development

permissions:
Expand All @@ -23,49 +23,16 @@ env:
name: DEHB

jobs:
build-and-deploy:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: "3.8"

- name: Install dependencies
run: |
pip install ".[dev]"
- name: Make docs
run: |
make clean
make docs
- name: Pull latest gh-pages
if: (contains(github.ref, 'development') || contains(github.ref, 'main'))
run: |
cd ..
git clone https://github.com/${{ github.repository }}.git --branch gh-pages --single-branch gh-pages
- name: Copy new docs into gh-pages
if: (contains(github.ref, 'development') || contains(github.ref, 'main'))
run: |
branch_name=${GITHUB_REF##*/}
cd ../gh-pages
rm -rf $branch_name
cp -r ../${{ env.name }}/docs/build/html $branch_name
- name: Push to gh-pages
if: (contains(github.ref, 'development') || contains(github.ref, 'main'))
run: |
last_commit=$(git log --pretty=format:"%an: %s")
cd ../gh-pages
branch_name=${GITHUB_REF##*/}
git add $branch_name/
git config --global user.name 'Github Actions'
git config --global user.email '[email protected]'
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}
git commit -am "$last_commit"
git push
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.x
- uses: actions/cache@v3
with:
key: ${{ github.ref }}
path: .cache
- run: pip install "mkdocs-material" "mkdocstrings[python]"
- run: mkdocs gh-deploy --force
4 changes: 2 additions & 2 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ on:
# Triggers with push to main
push:
branches:
- main
- master
- development

# Triggers with push to a PR aimed at main
pull_request:
branches:
- main
- master
- development

schedule:
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# DEHB: Evolutionary Hyperband for Scalable, Robust and Efficient Hyperparameter Optimization
[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
[![Tests](https://github.com/automl/DEHB/actions/workflows/pytest.yml/badge.svg)](https://github.com/automl/DEHB/actions/workflows/pytest.yml)
[![docs](https://github.com/automl/DEHB/actions/workflows/docs.yml/badge.svg)](https://github.com/automl/DEHB/actions/workflows/docs.yml)
[![Coverage Status](https://coveralls.io/repos/github/automl/DEHB/badge.svg)](https://coveralls.io/github/automl/DEHB)
[![PyPI](https://img.shields.io/pypi/v/dehb)](https://pypi.org/project/dehb/)
[![Static Badge](https://img.shields.io/badge/python-3.8%20%7C%203.9%20%7C%203.10%20%7C%203.11%20-blue)](https://pypi.org/project/dehb/)
Expand Down
4 changes: 0 additions & 4 deletions dehb/__init__.py

This file was deleted.

30 changes: 0 additions & 30 deletions docs/Makefile

This file was deleted.

11 changes: 0 additions & 11 deletions docs/advanced_usage/index.rst

This file was deleted.

9 changes: 0 additions & 9 deletions docs/api.rst

This file was deleted.

Binary file added docs/assets/automl_org.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 0 additions & 11 deletions docs/basic_usage/index.rst

This file was deleted.

41 changes: 0 additions & 41 deletions docs/commands.rst

This file was deleted.

17 changes: 0 additions & 17 deletions docs/conf.py

This file was deleted.

10 changes: 0 additions & 10 deletions docs/faq.rst

This file was deleted.

8 changes: 0 additions & 8 deletions docs/glossary.rst

This file was deleted.

3 changes: 3 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Welcome to DEHB

Evolutionary Hyperband for Scalable, Robust and Efficient Hyperparameter Optimization.
18 changes: 0 additions & 18 deletions docs/index.rst

This file was deleted.

6 changes: 0 additions & 6 deletions docs/installation.rst

This file was deleted.

3 changes: 3 additions & 0 deletions docs/references/bracket_manager.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Bracket manager

::: dehb.utils.bracket_manager
3 changes: 3 additions & 0 deletions docs/references/de.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# DE

::: dehb.optimizers.de
3 changes: 3 additions & 0 deletions docs/references/dehb.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# DEHB

::: dehb.optimizers.dehb
6 changes: 6 additions & 0 deletions examples/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Examples
========

We provide several examples of how to use DEHB with Python. The examples were structured in order to give the user an
introduction to the interface of DEHB and how to use it. Moreover the examples show how to use DEHB with and without
the ConfigSpace library and an exemplary optimization with PyTorch.
72 changes: 72 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
site_name: DEHB

nav:
- Home: index.md
- Code Reference:
- DEHB: references/dehb.md
- DE: references/de.md
- Bracket Manager: references/bracket_manager.md

theme:
name: material
logo: assets/automl_org.png
favicon: assets/automl_org.png
icon:
repo: fontawesome/brands/github
features:
- content.code.annotate
- content.code.copy
- navigation.footer
- navigation.tabs
- navigation.tabs.sticky
- toc.follow
- header.autohide
- search.suggest
- search.highlight
- search.share
font:
text: Roboto
code: Roboto Mono
palette:
- scheme: slate
media: "(prefers-color-scheme: dark)"
primary: indigo
accent: deep purple
toggle:
icon: material/eye-outline
name: Switch to light mode

# Palette toggle for light mode
- scheme: default
media: "(prefers-color-scheme: light)"
primary: indigo
accent: deep purple
toggle:
icon: material/eye
name: Switch to dark mode

plugins:
- search
- mkdocstrings:
default_handler: python
enable_inventory: true
custom_templates: docs/_templates
handlers:
python:
paths: [src]
options: # https://mkdocstrings.github.io/python/usage/
docstring_section_style: spacy
show_docstring_attributes: true
show_docstring_description: true
show_root_heading: false
show_root_toc_entry: false
show_object_full_path: false
merge_init_into_class: true
docstring_style: google
show_if_no_docstring: false
show_bases: true
show_source: true
members_order: "source"
show_signature: true
separate_signature: false
show_signature_annotations: false
File renamed without changes.
11 changes: 11 additions & 0 deletions src/dehb/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import datetime
from .optimizers import DE, AsyncDE
from .optimizers import DEHB
from .utils import SHBracketManager

name = "DEHB"
author = (
"N. Awad and N. Mallik and F. Hutter"
)
copyright = f"Copyright {datetime.date.today().strftime('%Y')}, Noor Awad, Neeratyoy Mallik and Frank Hutter"
version = "0.0.5"
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 24b9409

Please sign in to comment.