From 2d58660d9dad463455aabacf6cd6a99d02d82bea Mon Sep 17 00:00:00 2001 From: Maximilian Schmidt Date: Fri, 17 Jul 2020 14:05:31 +0900 Subject: [PATCH 1/2] Add deploy phase to CI, simplify several steps in CI --- .travis.yml | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4bb7dda8..53276bc1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,16 +5,16 @@ python: - "3.8" env: - DEP=[all] - - DEP= + - DEP=[dev] branches: only: - master jobs: exclude: - python: "3.6" - env: DEP= + env: DEP=[dev] - python: "3.7" - env: DEP= + env: DEP=[dev] before_install: - wget http://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh - chmod +x miniconda.sh @@ -24,16 +24,16 @@ before_install: - source activate myenv - pip install --upgrade pip install: - - pip install pytest pytest-cov coveralls - - pip install flake8 black - - pip install mypy - pip install -e .$DEP + - pip install pytest-cov coveralls script: - black --check . - flake8 --config=.flake8 . - mypy cgp - if [ "$DEP" = "[all]" ]; then - cd docs && make html && cd ../ || exit 1; + make -C docs/ html || exit 1; + touch docs/_build/html/.nojekyll + fi - pytest --cov=cgp - if [ "$DEP" = "[all]" -a $TRAVIS_PYTHON_VERSION = 3.8 ]; then @@ -43,3 +43,14 @@ script: fi after_success: - coveralls +deploy: + provider: pages:git + skip_cleanup: true + verbose: true + token: $GITHUB_TOKEN + edge: true + local_dir: ./docs/_build/html/ + keep_history: true + on: + python: 3.8 + condition: $DEP = "[all]" \ No newline at end of file From 4db00df3c7ec75881c9d9415a56d819c2b2fbc6a Mon Sep 17 00:00:00 2001 From: Maximilian Schmidt Date: Fri, 17 Jul 2020 14:05:44 +0900 Subject: [PATCH 2/2] Mention docs in README, add badge for docs, add missing basic_usage.rst to docs --- README.rst | 9 ++++++--- docs/basic_usage.rst | 7 +++++++ 2 files changed, 13 insertions(+), 3 deletions(-) create mode 100644 docs/basic_usage.rst diff --git a/README.rst b/README.rst index b4ca7e74..e5782165 100644 --- a/README.rst +++ b/README.rst @@ -21,6 +21,8 @@ :target: https://github.com/psf/black .. image:: https://coveralls.io/repos/github/Happy-Algorithms-League/python-gp/badge.svg?branch=master :target: https://coveralls.io/github/Happy-Algorithms-League/python-gp?branch=master +.. image:: https://readthedocs.org/projects/ansicolortags/badge/?version=latest + :target: https://happy-algorithms-league.github.io/hal-cgp/ Cartesian genetic programming (CGP) in pure Python. @@ -36,8 +38,6 @@ Figure from Jordan, Schmidt, Senn & Petrovici, "Evolving to learn: discovering i .. long-description-end -A simple example of CGP applied to a symbolic regression problem can be found in `examples/example_evo_regression.py`. - .. installation-start ============ Installation @@ -72,11 +72,14 @@ The adventurous can install the most recent development version directly from ou .. installation-end -.. basic-usage-start =========== Basic usage =========== +For detailed documentation, please refer to `https://happy-algorithms-league.github.io/hal-cgp/ `_. Here we only provide a preview. + +.. basic-usage-start + Follow these steps to solve a basic regression problem: 1. Define an objective function. diff --git a/docs/basic_usage.rst b/docs/basic_usage.rst new file mode 100644 index 00000000..05190834 --- /dev/null +++ b/docs/basic_usage.rst @@ -0,0 +1,7 @@ +=========== +Basic usage +=========== + +.. include:: ../README.rst + :start-after: basic-usage-start + :end-before: basic-usage-end