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

Migrate docs #1155

Merged
merged 64 commits into from
Nov 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
6da7ca5
docs(installation): add install instructs for windows
Oct 23, 2024
36d8597
docs(links): fix redirection
Oct 23, 2024
8014696
docs(installation): rst -> md
Oct 23, 2024
2c79a29
docs(package_overview): rst -> md
Oct 23, 2024
bc1989c
docs(getting_started): rst -> md
Oct 23, 2024
2e578ee
docs(minimal_example): rst -> md
Oct 23, 2024
8b850d3
docs(references): rst -> md
Oct 23, 2024
96e3536
docs(glossary): rst -> md
Oct 23, 2024
163233f
docs(faq): rst -> md
Oct 23, 2024
31140b8
docs(license): rst -> md
Oct 23, 2024
a4e8454
docs(experimental): rst -> md
Oct 23, 2024
c44abd0
Rename file
Oct 23, 2024
9da916e
renaem old files
Oct 23, 2024
cc657c8
docs: add hooks
Oct 23, 2024
73da945
docs: add mkdocs config
Oct 23, 2024
1a97979
docs(components): rst -> md
Oct 23, 2024
c0eccb6
refactor(acquisition_maximizer): fix typo
Oct 24, 2024
6cbcaec
docs(component): fix links
Oct 24, 2024
9b963dd
docs(2_multi_fidelity): rst -> md
Oct 24, 2024
42a6259
docs(1_components): fix links
Oct 24, 2024
d2f89fd
docs(api_generator): fix link generation
Oct 24, 2024
7815b3f
docs(3_multi_objective): rst -> md
Oct 24, 2024
987e6bc
docs(4_instances): rst -> md
Oct 24, 2024
8c2a6ad
docs(5.1_warmstarting): rst -> md
Oct 24, 2024
8d6c8c3
Fix link
Oct 24, 2024
bd49f2c
docs(5_ask_and_tell): rst -> md
Oct 24, 2024
b6de74d
docs(6_commandline): rst -> md
Oct 24, 2024
d9c9236
docs(7_stopping_criteria): rst -> md
Oct 24, 2024
9150904
docs(8_logging): rst -> md
Oct 24, 2024
87b744c
docs(9_parallelism): rst -> md
Oct 24, 2024
38fa278
docs(10_continue): rst -> md
Oct 24, 2024
3973334
docs(11_reproducibility): rst -> md
Oct 24, 2024
f4c711e
docs(12_optimzations): rst -> md
Oct 24, 2024
72a89c8
docs(examples): hide turbo and boing
Oct 24, 2024
0121f6b
docs(examples): rst -> md
Oct 24, 2024
b10dd3e
docs(examples): fix tiny
Oct 24, 2024
8cea410
docs(examples): fix navigation sections
Oct 24, 2024
2a4a16e
docs(examples): fix navigation sections
Oct 24, 2024
c3adc50
fix typo
Oct 24, 2024
524c24d
Update
Oct 24, 2024
4891644
ignore more
Oct 24, 2024
360ba4b
docs(docstring): fix refs
Oct 24, 2024
52bdc1d
docs(docstring): fix refs
Oct 24, 2024
a88d82f
docs(home): add sections
Oct 24, 2024
866f949
build(setup): add requirements for mkdocs
Oct 24, 2024
234c4ee
refactor(abstract_intensifier): track param max_config_calls
Oct 24, 2024
5bd9817
refactor(docs): remove old files
Oct 24, 2024
fdf25d4
refactor(acquisition): fix 'acqusition' typo
Oct 24, 2024
a6b1f71
Update CHANGELOG.md
Oct 24, 2024
5fc3d4a
docs(examples): flags to run when building (does not work yet)
Oct 24, 2024
6e2f242
Update Makefile
Oct 24, 2024
ba7e2c3
Update CHANGELOG.md
Oct 24, 2024
32d5111
Fix links
Oct 29, 2024
a710875
Update github workflow for doc building
Oct 29, 2024
55e91eb
docs(3_getting_started): fix links
Nov 21, 2024
0c6e0a3
Minor modifications
LukasFehring Nov 21, 2024
f85b4d4
docs(constants): add docstring
Nov 21, 2024
ddb3fd1
docs(multi_objective): fix broken link
Nov 21, 2024
9915c2a
docs(ask_and_tell): fix broken link
Nov 21, 2024
5ccd816
docs(parallelism.md): fix broken link
Nov 21, 2024
3a1bf19
docs(continue): fix broken link
Nov 21, 2024
418a282
delete .rst
Nov 21, 2024
acc6adc
Fix sidebar navigatoon
Nov 21, 2024
bf92c00
update CHANGELOG.md
Nov 21, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
92 changes: 15 additions & 77 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -1,89 +1,27 @@
# This workflow is just to test that the docs build successfully.
name: docs

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
on:
# Manual trigger option in GitHub
# This won't push to GitHub pages where docs are hosted due
# to the guarded if statement in those steps
workflow_dispatch:

# Trigger on push to these branches
push:
branches:
- main
- development

# Trigger on open/push to a PR targeting one of these branches
pull_request:
types:
- opened
- synchronize
- reopened
- ready_for_review
branches:
- main
- development

env:
name: SMAC3

permissions:
contents: write
jobs:
build-and-deploy:
if: ${{ !github.event.pull_request.draft }}
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.10"

- name: Install dependencies
id: install
run: |
pip install ".[gpytorch,dev]"

# Getting the version
SMAC_VERSION=$(python -c "import smac; print('v' + str(smac.version));")

# Make it a global variable
echo "SMAC_VERSION=$SMAC_VERSION" >> $GITHUB_ENV

- name: Make docs
run: |
make clean
make docs

- name: Pull latest gh-pages
if: (contains(github.ref, 'develop') || contains(github.ref, 'main')) && github.event_name == 'push'
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, 'develop') || contains(github.ref, 'main')) && github.event_name == 'push'
run: |
branch_name=${GITHUB_REF##*/}
cd ../gh-pages
rm -rf $branch_name
cp -r ../${{ env.name }}/docs/build/html $branch_name

# we also copy the current SMAC_VERSION
rm -rf $SMAC_VERSION
cp -r ../${{ env.name }}/docs/build/html $SMAC_VERSION


- name: Push to gh-pages
if: (contains(github.ref, 'develop') || contains(github.ref, 'main')) && github.event_name == 'push'
run: |
last_commit=$(git log --pretty=format:"%an: %s")
cd ../gh-pages
branch_name=${GITHUB_REF##*/}
git add $branch_name/
git add $SMAC_VERSION/
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@v4
- uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: "Install dependancies"
run: python -m pip install -e ".[dev]"
- name: "Build Docs"
run: mkdocs build --clean --strict
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -147,4 +147,7 @@ src

# Pycharm
.idea
.vscode
.vscode

projects
_api
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# 2.3.0

## Documentation
- Update windows install guide (#952)
- Correct intensifier for Algorithm Configuration Facade (#1162, #1165)
- Migrate sphinx docs to mkdocs (#1155)

# 2.2.1

## Improvements
Expand Down Expand Up @@ -688,7 +695,7 @@ Since many urgent features were already taken care of in 0.14.0, this release ma
conditions when starting multiple runs on a cluster.
* MAINT #209: adds the seed or a pseudo-seed to the output directory name for
better identifiability of the output directories.
* FIX #216: replace broken call to in EIPS acqusition function.
* FIX #216: replace broken call to in EIPS acquisition function.
* MAINT: use codecov.io instead of coveralls.io.
* MAINT: increase minimal required version of the ConfigSpace package to 0.3.2.

Expand Down
36 changes: 23 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -86,27 +86,37 @@ format: format-black format-isort
tests:
$(PYTEST) ${TESTS_DIR}

# Launch the docs, executing code blocks and examples
docs-full:
$(PYTHON) -m webbrowser -t "http://127.0.0.1:8000/"
SMAC_DOC_RENDER_EXAMPLES=all \
SMAC_DOCS_OFFLINE=true \
SMAC_EXEC_DOCS=true \
mkdocs serve --watch-theme

# Launch the docs and execute code blocks
docs-code:
$(PYTHON) -m webbrowser -t "http://127.0.0.1:8000/"
SMAC_DOCS_OFFLINE=true \
SMAC_EXEC_DOCS=true \
SMAC_DOC_RENDER_EXAMPLES=false \
mkdocs serve --watch-theme

# Launch the docs but dont run code examples
docs:
$(MAKE) -C ${DOCDIR} docs
@echo
@echo "View docs at:"
@echo ${INDEX_HTML}

examples:
$(MAKE) -C ${DOCDIR} examples
@echo
@echo "View docs at:"
@echo ${INDEX_HTML}
$(PYTHON) -m webbrowser -t "http://127.0.0.1:8000/"
SMAC_DOCS_OFFLINE=true \
SMAC_EXEC_DOCS=false \
SMAC_DOC_RENDER_EXAMPLES=false \
mkdocs serve --watch-theme
# https://github.com/pawamoy/markdown-exec/issues/19

# Build a distribution in ./dist
build:
$(PYTHON) setup.py sdist

clean: clean-build clean-docs clean-data

clean-docs:
$(MAKE) -C ${DOCDIR} clean

clean-build:
$(PYTHON) setup.py clean
rm -rf ${DIST}
Expand Down
43 changes: 22 additions & 21 deletions docs/10_experimental.rst → docs/10_experimental.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
Experimental
============
# Experimental

.. warning::
!!! warning
This part is experimental and might not work in each case. If you would like to suggest any changes, please let us know.


Installation in Windows via WSL
------------------------------
## Installation in Windows via WSL

SMAC can be installed in a WSL (Windows Subsystem for Linux) under Windows.

Expand All @@ -21,28 +19,31 @@ Download an Anaconda Linux version to drive D under Windows, e.g. D:\\Anaconda3-

In the WSL, Windows resources are mounted under /mnt:

.. code:: bash

cd /mnt/d
bash Anaconda3-2023.03-1-Linux-x86_64
```bash
cd /mnt/d
bash Anaconda3-2023.03-1-Linux-x86_64
```

Enter this command to create the environment variable:

.. code:: bash

export PATH="$PATH:/home/${USER}/anaconda3/bin
```bash
export PATH="$PATH:/home/${USER}/anaconda3/bin
```

Input 'python' to check if the installation was successful.
Input `python` to check if the installation was successful.

**3) Install SMAC**

Change to your home folder and install the general software there:

.. code:: bash

cd /home/${USER}
sudo apt-get install software-properties-common
sudo apt-get update
sudo apt-get install build-essential swig
conda install gxx_linux-64 gcc_linux-64 swig
curl https://raw.githubusercontent.com/automl/smac3/master/requirements.txt | xargs -n 1 -L 1 pip install
```bash
cd /home/${USER}
sudo apt-get install software-properties-common
sudo apt-get update
sudo apt-get install build-essential swig
conda install gxx_linux-64 gcc_linux-64 swig
curl https://raw.githubusercontent.com/automl/smac3/master/requirements.txt | xargs -n 1 -L 1 pip install
```

## Installation in Pure Windows
Please refer to this [issue](https://github.com/automl/SMAC3/issues/952) for installation instructions for SMAC3-1.4 and SMAC3-2.x.
72 changes: 72 additions & 0 deletions docs/1_installation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# Installation

## Requirements

SMAC is written in python3 and therefore requires an environment with python>=3.8.
Furthermore, the Random Forest used in SMAC requires SWIG as a build dependency.

!!! info

SMAC is tested on Linux and Mac machines with python >=3.8.


## SetUp

We recommend using Anaconda to create and activate an environment:

```bash
conda create -n SMAC python=3.10
conda activate SMAC
```

Now install swig either on the system level e.g. using the following command for Linux:
```bash
apt-get install swig
```

Or install swig inside of an already created conda environment using:

```bash
conda install gxx_linux-64 gcc_linux-64 swig
```

## Install SMAC
You can install SMAC either using PyPI or Conda-forge.

### PYPI
To install SMAC with PyPI call:

```bash
pip install smac
```

Or alternatively, clone the environment from GitHub directly:

```bash
git clone https://github.com/automl/SMAC3.git && cd SMAC3
pip install -e ".[dev]"
```

### Conda-forge

Installing SMAC from the `conda-forge` channel can be achieved by adding `conda-forge` to your channels with:

```bash
conda config --add channels conda-forge
conda config --set channel_priority strict
```

You must have `conda >= 4.9` installed. To update conda or check your current conda version, please follow the instructions from [the official anaconda documentation](https://docs.anaconda.com/anaconda/install/update-version/). Once the `conda-forge` channel has been enabled, SMAC can be installed with:

```bash
conda install smac
```

Read [SMAC feedstock](https://github.com/conda-forge/smac-feedstock) for more details.

## Windows (native or via WSL, experimental)

SMAC can be installed under Windows in a WSL (Windows Subsystem for Linux).
You can find an instruction on how to do this here: [Experimental](./10_experimental.md).
However, this is experimental and might not work in each case.
If you would like to suggest any changes, please let us know.
Loading
Loading