Skip to content

Commit

Permalink
merge changes from dev to current branch
Browse files Browse the repository at this point in the history
  • Loading branch information
dengdifan committed Dec 2, 2024
2 parents 7688157 + 000dd2d commit 5dc6809
Show file tree
Hide file tree
Showing 101 changed files with 1,745 additions and 1,259 deletions.
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
2 changes: 1 addition & 1 deletion .github/workflows/recent_reminder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
echo "$(<recent_issues.md) <br />" >> mail.html
- name: Send mail
id: mail
uses: dawidd6/action-send-mail@v3
uses: dawidd6/action-send-mail@v4
with:
server_address: ${{secrets.MAIL_SERVER_ADDRESS}}
server_port: ${{secrets.MAIL_SERVER_PORT}}
Expand Down
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
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
# 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
- Add logger information on handling of stopIteration error (#960)
- Replace deprecated ConfigSpace methods (#1139)
- Separated Wallclock time measurements from CPU time measurements and storing them under new 'cpu_time' variable (#1173)

## Dependencies
- Allow numpy >= 2.x (#1146)
Expand Down Expand Up @@ -688,7 +696,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

0 comments on commit 5dc6809

Please sign in to comment.