├── .coveragerc ├── .github ├── ISSUE_TEMPLATE.md ├── PULL_REQUEST_TEMPLATE.md ├── dependabot.yml └── workflows │ ├── lint.yml │ └── test.yml ├── .gitignore ├── CHANGELOG.md ├── CONTRIBUTING.md ├── LICENSE.txt ├── MANIFEST.in ├── README.md ├── docs ├── .nojekyll ├── _images │ ├── 3dmap_mend.png │ ├── WC_structure.png │ ├── basic_viz.png │ ├── batch.png │ ├── diagram_fireworks.png │ ├── diagram_highthroughput.png │ ├── diagram_highthroughput2.png │ ├── intro_figure.png │ ├── logo-med.png │ ├── miniwf.png │ ├── ml.png │ ├── multiobj_fws.png │ ├── multiobj_log.png │ ├── opt.png │ ├── opt_basic.png │ ├── opttask_overview.png │ ├── perovskites_zoomin.png │ ├── progression.png │ ├── quickstart_lp.png │ ├── quickstart_viz1.png │ ├── rsfw.png │ ├── rsfwdiagram.png │ ├── server.png │ ├── singlewf.png │ └── singlewf_withrs.png ├── _sources │ ├── advanced.rst.txt │ ├── basic.rst.txt │ ├── guide.rst.txt │ ├── index.rst.txt │ ├── modules.rst.txt │ ├── quickstart.rst.txt │ ├── rocketsled.auto_sleds.rst.txt │ ├── rocketsled.benchmarks.rst.txt │ ├── rocketsled.examples.rst.txt │ ├── rocketsled.rst.txt │ ├── rocketsled.tests.rst.txt │ └── tutorial.rst.txt ├── _static │ ├── 3dmap_mend.png │ ├── Comparison.png │ ├── WC_structure.png │ ├── ajax-loader.gif │ ├── basic.css │ ├── basic.png │ ├── basic_viz.png │ ├── batch.png │ ├── comment-bright.png │ ├── comment-close.png │ ├── comment.png │ ├── diagram_fireworks.png │ ├── diagram_highthroughput.png │ ├── diagram_highthroughput2.png │ ├── doctools.js │ ├── documentation_options.js │ ├── down-pressed.png │ ├── down.png │ ├── file.png │ ├── fw.png │ ├── intro figure.png │ ├── intro_figure.png │ ├── jquery-3.2.1.js │ ├── jquery.js │ ├── language_data.js │ ├── logo-big.png │ ├── logo-med.png │ ├── logo-small.png │ ├── miniwf.png │ ├── minus.png │ ├── ml.png │ ├── multiobj_fws.png │ ├── multiobj_log.png │ ├── multiple_wf.png │ ├── nature.css │ ├── opt.png │ ├── opt_basic.png │ ├── opttask_overview.png │ ├── perovskites_zoomin.png │ ├── plus.png │ ├── progression.png │ ├── pygments.css │ ├── quickstart_lp.png │ ├── quickstart_viz1.png │ ├── rsfwdiagram.png │ ├── rsfwicon.png │ ├── rslogo.png │ ├── searchtools.js │ ├── server.png │ ├── singlewf.png │ ├── singlewf_withrs.png │ ├── underscore-1.3.1.js │ ├── underscore.js │ ├── up-pressed.png │ ├── up.png │ └── websupport.js ├── advanced.html ├── basic.html ├── genindex.html ├── guide.html ├── index.html ├── modules.html ├── objects.inv ├── py-modindex.html ├── quickstart.html ├── rocketsled.auto_sleds.html ├── rocketsled.benchmarks.html ├── rocketsled.examples.html ├── rocketsled.html ├── rocketsled.tests.html ├── search.html ├── searchindex.js └── tutorial.html ├── docs_rst ├── Makefile ├── _static │ ├── 3dmap_mend.png │ ├── Comparison.png │ ├── WC_structure.png │ ├── basic.png │ ├── basic_viz.png │ ├── batch.png │ ├── diagram_fireworks.png │ ├── diagram_highthroughput.png │ ├── diagram_highthroughput2.png │ ├── fw.png │ ├── intro_figure.png │ ├── logo-big.png │ ├── logo-med.png │ ├── logo-small.png │ ├── miniwf.png │ ├── ml.png │ ├── multiobj_fws.png │ ├── multiobj_log.png │ ├── multiple_wf.png │ ├── nature.css │ ├── opt.png │ ├── opt_basic.png │ ├── opttask_overview.png │ ├── perovskites_zoomin.png │ ├── progression.png │ ├── quickstart_lp.png │ ├── quickstart_viz1.png │ ├── rsfwdiagram.png │ ├── rsfwicon.png │ ├── rslogo.png │ └── server.png ├── _templates │ └── layout.html ├── advanced.rst ├── basic.rst ├── conf.py ├── guide.rst ├── index.rst ├── modules.rst ├── rocketsled.examples.rst ├── rocketsled.rst ├── rocketsled.tests.rst └── tutorial.rst ├── pyproject.toml ├── requirements-dev.txt ├── requirements.txt ├── rocketsled ├── __init__.py ├── acq.py ├── control.py ├── defaults.yaml ├── examples │ ├── __init__.py │ ├── basic.py │ ├── batch.py │ └── complex.py ├── task.py ├── tests │ ├── __init__.py │ ├── deserialize_func.py │ ├── missioncontrol_plot.png │ ├── test_task.py │ ├── test_utils.py │ └── tests_launchpad.yaml └── utils.py ├── setup.cfg ├── setup.py └── tasks.py /.coveragerc: -------------------------------------------------------------------------------- 1 | [report] 2 | exclude_lines = 3 | # Ignore coverage of code that requires the module to be executed. 4 | if __name__ == .__main__.: 5 | ignore_errors=True 6 | omit = 7 | */dev_scripts/* 8 | */docs/* 9 | */docs_rst/* 10 | */examples/* 11 | */.cicleci/* 12 | */python?.?/* 13 | */site-packages/* 14 | *tests/* 15 | */versioneer.py 16 | */_version.py 17 | */*.md 18 | */*.yaml 19 | */*.cfg 20 | */*.gitignore 21 | */*.txt 22 | */setup.py 23 | */__init__.py 24 | */rocketsled.egg-info/* 25 | */.eggs/* -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | Please submit help issues to: 2 | https://discuss.matsci.org/c/matminer/automatminer 3 | 4 | The Github issues is no longer used except for internal development purposes. 5 | 6 | If you are unable to use the Discourse forum, you may submit an issue here, but you must **clearly** state the reason you are unable to use the Discourse forum in your ticket. Otherwise, your issue will be **closed** without response. 7 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ## Summary 2 | 3 | 5 | 6 | * Feature 1 7 | * Feature 2 8 | * Fix 1 9 | * Fix 2 10 | 11 | ## TODO (if any) 12 | 13 | 15 | 16 | * Feature 1 supports a, but not b. -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: pip 4 | directory: "/" 5 | schedule: 6 | interval: daily 7 | time: "13:00" 8 | open-pull-requests-limit: 10 9 | ignore: 10 | - dependency-name: pint 11 | versions: 12 | - 0.16.1 13 | - "0.17" 14 | - dependency-name: pymatgen 15 | versions: 16 | - 2020.12.31 17 | - 2021.2.14 18 | - 2021.2.16 19 | - 2021.2.8.1 20 | - 2021.3.3 21 | - 2021.3.4 22 | - 2022.0.3 23 | - 2022.0.4 24 | - 2022.0.5 25 | - dependency-name: dscribe 26 | versions: 27 | - 0.4.0 28 | - dependency-name: tqdm 29 | versions: 30 | - 4.56.0 31 | - 4.56.1 32 | - 4.56.2 33 | - 4.57.0 34 | - 4.58.0 35 | - 4.59.0 36 | - dependency-name: monty 37 | versions: 38 | - 2021.3.3 39 | - 4.0.2 40 | - dependency-name: pandas 41 | versions: 42 | - 1.2.1 43 | - 1.2.2 44 | - 1.2.3 45 | - dependency-name: plotly 46 | versions: 47 | - 4.14.3 48 | - dependency-name: requests 49 | versions: 50 | - 2.25.1 51 | - dependency-name: sympy 52 | versions: 53 | - 1.7.1 54 | -------------------------------------------------------------------------------- /.github/workflows/lint.yml: -------------------------------------------------------------------------------- 1 | name: Linting 2 | 3 | on: [push, pull_request] 4 | 5 | jobs: 6 | build: 7 | runs-on: ubuntu-latest 8 | strategy: 9 | max-parallel: 1 10 | matrix: 11 | python-version: [3.7, 3.8, 3.9] 12 | steps: 13 | - uses: actions/checkout@v2 14 | with: 15 | fetch-depth: 0 16 | - name: Set up Python ${{ matrix.python-version }} 17 | uses: actions/setup-python@v2 18 | with: 19 | python-version: ${{ matrix.python-version }} 20 | - name: Install dependencies 21 | run: | 22 | python -m pip install --upgrade pip 23 | pip install -r requirements-dev.txt --quiet 24 | - name: black 25 | run: | 26 | 27 | # Black step should fail if there are any errors 28 | black --version 29 | black --check --diff --color rocketsled 30 | - name: pylint 31 | run: | 32 | # Enforce the absolute bare minimum 33 | pylint --fail-under=5 rocketsled 34 | - name: flake8 35 | run: | 36 | flake8 --version 37 | # exit-zero treats all errors as warnings. 38 | flake8 --count --exit-zero --max-complexity=20 --statistics rocketsled 39 | -------------------------------------------------------------------------------- /.github/workflows/test.yml: -------------------------------------------------------------------------------- 1 | # This workflow runs only on Ubuntu and aims to be more complete than the Mac and Windows workflows. 2 | # In particular, Openbabel and many of the external command line dependencies are included for testing.defaults: 3 | # The ext package is also only tested in this workflow. Coverage is also computed based on this platform. 4 | name: Testing 5 | 6 | on: [ push, pull_request ] 7 | 8 | jobs: 9 | 10 | test: 11 | strategy: 12 | max-parallel: 4 13 | matrix: 14 | python-version: [3.7, 3.8] 15 | mongodb-version: ['4.0'] 16 | 17 | runs-on: ubuntu-latest 18 | 19 | env: 20 | RUNNING_ON_GHACTIONS: "True" 21 | MPLBACKEND: "Agg" 22 | 23 | steps: 24 | - uses: actions/checkout@v2 25 | - name: Set up Python ${{ matrix.python-version }} 26 | uses: actions/setup-python@v2 27 | with: 28 | python-version: ${{ matrix.python-version }} 29 | 30 | - name: Start MongoDB 31 | uses: supercharge/mongodb-github-action@1.6.0 32 | with: 33 | mongodb-version: ${{ matrix.mongodb-version }} 34 | 35 | - name: Run tests 36 | run: | 37 | # Sleeping to allow mongo a bit more time to boot, avoiding connect errors 38 | sleep 10 39 | mongo localhost/admin --eval 'db.createUser({user: "admin",pwd: "password",roles: [ { role: "root", db: "admin" } ]})' 40 | python3 -m venv test_env 41 | . test_env/bin/activate 42 | python -m pip install --upgrade pip 43 | pip install -r requirements.txt -r requirements-dev.txt 44 | # Using non-editable install for testing building of MANIFEST files 45 | pip install . 46 | pytest --cov=rocketsled rocketsled 47 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.py[cod] 2 | 3 | # doc builds 4 | docs/_build/* 5 | docs/_build/*/* 6 | docs/_build/*/*/* 7 | 8 | # C extensions 9 | *.so 10 | 11 | # Packages 12 | *.egg 13 | *.egg-info 14 | dist 15 | build 16 | eggs 17 | parts 18 | bin 19 | var 20 | sdist 21 | develop-eggs 22 | .installed.cfg 23 | lib 24 | lib64 25 | .eggs 26 | 27 | # Installer logs 28 | pip-log.txt 29 | 30 | # Unit test / coverage reports 31 | .coverage 32 | .tox 33 | nosetests.xml 34 | 35 | # Translations 36 | *.mo 37 | 38 | # Mr Developer 39 | .mr.developer.cfg 40 | .project 41 | .pydevproject 42 | 43 | # IPython checkpoints 44 | *-checkpoint.ipynb 45 | 46 | # Pycharm 47 | .idea/* 48 | turboworks/.idea/* 49 | 50 | # Launcher stuff 51 | */launcher* 52 | launcher* 53 | 54 | #Leftover launcher stuff 55 | FW.json 56 | 57 | #testing files 58 | */testing_dir 59 | testing_dir* 60 | 61 | #python interpreted files 62 | .pyc 63 | 64 | # .DS_Store (native mac OSX files) 65 | .DS_Store 66 | 67 | # Huge DB file 68 | unc_inversedesign/ 69 | old/perovskites/.DS_Store 70 | 71 | old/perovskites/.DS_Store 72 | 73 | old/perovskites/.DS_Store 74 | .idea/ 75 | 76 | 77 | # auto sleds 78 | rocketsled/auto_sleds/* 79 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to rocketsled and FireWorks 2 | We love your input! We want to make contributing to rocketsled as easy and transparent as possible, whether it's: 3 | * Reporting a bug 4 | * Discussing the current state of the code 5 | * Submitting a fix 6 | * Proposing or implementing new features 7 | * Becoming a maintainer 8 | 9 | ## Reporting bugs, getting help, and discussion 10 | At any time, feel free to start a thread on our [Google Group](https://groups.google.com/forum/#!forum/fireworkflows). 11 | 12 | If you are making a bug report, incorporate as many elements of the following as possible to ensure a timely response and avoid the need for followups: 13 | * A quick summary and/or background 14 | * Steps to reproduce - be specific! **Provide sample code.** 15 | * What you expected would happen, compared to what actually happens 16 | * The full stack trace of any errors you encounter 17 | * Notes (possibly including why you think this might be happening, or steps you tried that didn't work) 18 | 19 | We love thorough bug reports as this means the development team can make quick and meaningful fixes. When we confirm your bug report, we'll move it to the GitHub issues where its progress can be further tracked. 20 | 21 | ## Contributing code modifications or additions through Github 22 | We use github to host code, to track issues and feature requests, as well as accept pull requests. We maintain a list of all contributors to FireWorks (incl. rocketsled) [here.](https://materialsproject.github.io/fireworks/contributors.html) 23 | 24 | Pull requests are the best way to propose changes to the codebase. Follow the [Github flow](https://www.atlassian.com/git/tutorials/comparing-workflows/forking-workflow) for more information on this procedure. 25 | 26 | The basic procedure for making a PR is: 27 | * Fork the repo and create your branch from master. 28 | * Commit your improvements to your branch and push to your Github fork (repo). 29 | * When you're finished, go to your fork and make a Pull Request. It will automatically update if you need to make further changes. 30 | 31 | ### How to Make a **Great** Pull Request 32 | We have a few tips for writing good PRs that are accepted into the main repo: 33 | 34 | * Use the Google Code style for all of your code. Find an example [here.](https://sphinxcontrib-napoleon.readthedocs.io/en/latest/example_google.html) 35 | * Your code should have (4) spaces instead of tabs. 36 | * If needed, update the documentation. 37 | * **Write tests** for new features! Good tests are 100%, absolutely necessary for good code. We use the python `unittest` framework -- see some of the other tests in this repo for examples, or review the [Hitchhiker's guide to python](https://docs.python-guide.org/writing/tests/) for some good resources on writing good tests. 38 | * Understand your contributions will fall under the same license as this repo. 39 | 40 | When you submit your PR, our CI service will automatically run your tests. 41 | We welcome good discussion on the best ways to write your code, and the comments on your PR are an excellent area for discussion. 42 | 43 | #### References 44 | This document was adapted from the open-source contribution guidelines for Facebook's Draft, as well as briandk's [contribution template](https://gist.github.com/briandk/3d2e8b3ec8daf5a27a62). 45 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | Rocketsled Copyright (c) 2018, The Regents of the University of 2 | California, through Lawrence Berkeley National Laboratory (subject 3 | to receipt of any required approvals from the U.S. Dept. of Energy). 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions 8 | are met: 9 | 10 | (1) Redistributions of source code must retain the above copyright 11 | notice, this list of conditions and the following disclaimer. 12 | 13 | (2) Redistributions in binary form must reproduce the above 14 | copyright notice, this list of conditions and the following 15 | disclaimer in the documentation and/or other materials provided with 16 | the distribution. 17 | 18 | (3) Neither the name of the University of California, Lawrence 19 | Berkeley National Laboratory, U.S. Dept. of Energy nor the names of 20 | its contributors may be used to endorse or promote products derived 21 | from this software without specific prior written permission. 22 | 23 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 24 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 25 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 26 | FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 27 | COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 28 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 29 | BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 30 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 31 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 32 | LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 33 | ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 34 | POSSIBILITY OF SUCH DAMAGE. 35 | 36 | You are under no obligation whatsoever to provide any bug fixes, 37 | patches, or upgrades to the features, functionality or performance 38 | of the source code ("Enhancements") to anyone; however, if you 39 | choose to make your Enhancements available either publicly, or 40 | directly to Lawrence Berkeley National Laboratory or its 41 | contributors, without imposing a separate written license agreement 42 | for such Enhancements, then you hereby grant the following license: 43 | a non-exclusive, royalty-free perpetual license to install, use, 44 | modify, prepare derivative works, incorporate into other computer 45 | software, distribute, and sublicense such enhancements or derivative 46 | works thereof, in binary and source code form. -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | include LICENSE.txt 2 | include CHANGELOG.md 3 | include rocketsled/defaults.yaml 4 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | # rocketsled 3 | 4 | | Tests | Release | 5 | |:----------:|:-------------:| 6 | | ![example workflow](https://github.com/hackingmaterials/matbench/actions/workflows/python-package.yml/badge.svg) | [![PyPI version](https://img.shields.io/pypi/v/rocketsled.svg?colorB=blue)](https://pypi.org/project/rocketsled/) | 7 | 8 | 9 | rocketsled is a black-box optimization framework "on rails" for high-throughput computation with FireWorks. 10 | 11 | - [**Website (including documentation)**](https://hackingmaterials.github.io/rocketsled/) 12 | - [**Help/Support**](https://discuss.matsci.org) 13 | - [**Source**](https://github.com/hackingmaterials/rocketsled) 14 | - [**FireWorks website**](https://materialsproject.github.io/fireworks) 15 | 16 | If you find rocketsled useful, please encourage its development by citing the [following paper](http://doi.org//10.1088/2515-7639/ab0c3d) in your research: 17 | 18 | ``` 19 | Dunn, A., Brenneck, J., Jain, A., Rocketsled: a software library for optimizing 20 | high-throughput computational searches. J. Phys. Mater. 2, 034002 (2019). 21 | ``` 22 | 23 | If you find FireWorks useful, please consider citing [its paper](http://dx.doi.org/10.1002/cpe.3505) as well: 24 | 25 | ``` 26 | Jain, A., Ong, S. P., Chen, W., Medasani, B., Qu, X., Kocher, M., Brafman, M., 27 | Petretto, G., Rignanese, G.-M., Hautier, G., Gunter, D., and Persson, K. A. 28 | FireWorks: a dynamic workflow system designed for high-throughput applications. 29 | Concurrency Computat.: Pract. Exper., 27: 5037–5059. (2015) 30 | ``` 31 | -------------------------------------------------------------------------------- /docs/.nojekyll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackingmaterials/rocketsled/294cdc370ad2fbca3475046f2122f0a6e0a33946/docs/.nojekyll -------------------------------------------------------------------------------- /docs/_images/3dmap_mend.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackingmaterials/rocketsled/294cdc370ad2fbca3475046f2122f0a6e0a33946/docs/_images/3dmap_mend.png -------------------------------------------------------------------------------- /docs/_images/WC_structure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackingmaterials/rocketsled/294cdc370ad2fbca3475046f2122f0a6e0a33946/docs/_images/WC_structure.png -------------------------------------------------------------------------------- /docs/_images/basic_viz.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackingmaterials/rocketsled/294cdc370ad2fbca3475046f2122f0a6e0a33946/docs/_images/basic_viz.png -------------------------------------------------------------------------------- /docs/_images/batch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackingmaterials/rocketsled/294cdc370ad2fbca3475046f2122f0a6e0a33946/docs/_images/batch.png -------------------------------------------------------------------------------- /docs/_images/diagram_fireworks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackingmaterials/rocketsled/294cdc370ad2fbca3475046f2122f0a6e0a33946/docs/_images/diagram_fireworks.png -------------------------------------------------------------------------------- /docs/_images/diagram_highthroughput.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackingmaterials/rocketsled/294cdc370ad2fbca3475046f2122f0a6e0a33946/docs/_images/diagram_highthroughput.png -------------------------------------------------------------------------------- /docs/_images/diagram_highthroughput2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackingmaterials/rocketsled/294cdc370ad2fbca3475046f2122f0a6e0a33946/docs/_images/diagram_highthroughput2.png -------------------------------------------------------------------------------- /docs/_images/intro_figure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackingmaterials/rocketsled/294cdc370ad2fbca3475046f2122f0a6e0a33946/docs/_images/intro_figure.png -------------------------------------------------------------------------------- /docs/_images/logo-med.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackingmaterials/rocketsled/294cdc370ad2fbca3475046f2122f0a6e0a33946/docs/_images/logo-med.png -------------------------------------------------------------------------------- /docs/_images/miniwf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackingmaterials/rocketsled/294cdc370ad2fbca3475046f2122f0a6e0a33946/docs/_images/miniwf.png -------------------------------------------------------------------------------- /docs/_images/ml.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackingmaterials/rocketsled/294cdc370ad2fbca3475046f2122f0a6e0a33946/docs/_images/ml.png -------------------------------------------------------------------------------- /docs/_images/multiobj_fws.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackingmaterials/rocketsled/294cdc370ad2fbca3475046f2122f0a6e0a33946/docs/_images/multiobj_fws.png -------------------------------------------------------------------------------- /docs/_images/multiobj_log.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackingmaterials/rocketsled/294cdc370ad2fbca3475046f2122f0a6e0a33946/docs/_images/multiobj_log.png -------------------------------------------------------------------------------- /docs/_images/opt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackingmaterials/rocketsled/294cdc370ad2fbca3475046f2122f0a6e0a33946/docs/_images/opt.png -------------------------------------------------------------------------------- /docs/_images/opt_basic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackingmaterials/rocketsled/294cdc370ad2fbca3475046f2122f0a6e0a33946/docs/_images/opt_basic.png -------------------------------------------------------------------------------- /docs/_images/opttask_overview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackingmaterials/rocketsled/294cdc370ad2fbca3475046f2122f0a6e0a33946/docs/_images/opttask_overview.png -------------------------------------------------------------------------------- /docs/_images/perovskites_zoomin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackingmaterials/rocketsled/294cdc370ad2fbca3475046f2122f0a6e0a33946/docs/_images/perovskites_zoomin.png -------------------------------------------------------------------------------- /docs/_images/progression.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackingmaterials/rocketsled/294cdc370ad2fbca3475046f2122f0a6e0a33946/docs/_images/progression.png -------------------------------------------------------------------------------- /docs/_images/quickstart_lp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackingmaterials/rocketsled/294cdc370ad2fbca3475046f2122f0a6e0a33946/docs/_images/quickstart_lp.png -------------------------------------------------------------------------------- /docs/_images/quickstart_viz1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackingmaterials/rocketsled/294cdc370ad2fbca3475046f2122f0a6e0a33946/docs/_images/quickstart_viz1.png -------------------------------------------------------------------------------- /docs/_images/rsfw.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackingmaterials/rocketsled/294cdc370ad2fbca3475046f2122f0a6e0a33946/docs/_images/rsfw.png -------------------------------------------------------------------------------- /docs/_images/rsfwdiagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackingmaterials/rocketsled/294cdc370ad2fbca3475046f2122f0a6e0a33946/docs/_images/rsfwdiagram.png -------------------------------------------------------------------------------- /docs/_images/server.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackingmaterials/rocketsled/294cdc370ad2fbca3475046f2122f0a6e0a33946/docs/_images/server.png -------------------------------------------------------------------------------- /docs/_images/singlewf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackingmaterials/rocketsled/294cdc370ad2fbca3475046f2122f0a6e0a33946/docs/_images/singlewf.png -------------------------------------------------------------------------------- /docs/_images/singlewf_withrs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackingmaterials/rocketsled/294cdc370ad2fbca3475046f2122f0a6e0a33946/docs/_images/singlewf_withrs.png -------------------------------------------------------------------------------- /docs/_sources/advanced.rst.txt: -------------------------------------------------------------------------------- 1 | *Tutorial 2 requires some knowledge of Fireworks. If you aren't comfortable with Fireworks, please work through the tutorials* `here `_. 2 | 3 | ======================================= 4 | Advanced Tutorial - 15-20 min 5 | ======================================= 6 | 7 | **Real optimization problems are messy**; often, there is a mixture of continuous (floating point), 8 | discrete (integer), and categorical dimensions which specify the search domain. The search space may be discontinuous, where only certain combinations of inputs are allowed. 9 | The objective function might have multiple, competing 10 | objectives to optimize. It may be unclear which predictors - that is, the 11 | algorithms that use previous inputs and outputs to suggest the next guess - will be effective, and whether their 12 | training or prediction itself be computationally prohibitive. Furthermore, the way we label points for human 13 | interpretation might have little use for prediction, but features derived from these labels might be very useful for learning. 14 | 15 | OptTask has optional arguments which address each of these issues. A few are listed here, and the rest are in the comprehensive guide. For the most part, they are designed to work both in combination and independently. 16 | 17 | In this tutorial, we will explore some of the more advanced capabilities of OptTask, including: 18 | 19 | * Multiobjective optimiation 20 | * Changing predictors 21 | + Acquisition functions for improving performance 22 | + Reducing prediction time 23 | + Customizing exploration 24 | * Using z (extra) features 25 | 26 | 27 | Defining the Problem 28 | --------------------- 29 | Let's imagine we are designing a fin for a new rocket. **We have three parameters we can tune**: 30 | 31 | * Fin length - Defined between 16cm - 145cm 32 | * Fin angle - Defined between 0.0 - 90.0 degrees 33 | * Fin type - Either industry standard, dolphin, or shark type. 34 | 35 | **We'll say a good fin has 3 characteristics (objective metrics)**: 36 | 37 | * Low cost 38 | * Low drag 39 | * Low probability of failure 40 | 41 | We evaluate the performance of a candidate design by nondeterministically simulating the aerodynamics and market performance with an expensive simulation. 42 | A mock version of such a simulation is found in :code:`ComplexMultiObjTask` in :code:`/examples/tasks.py`. 43 | 44 | Creating the Workflow 45 | --------------------- 46 | 47 | The workflow we are creating is two Fireworks; one containing the simulation, and one containing OptTask. 48 | 49 | .. image:: _static/multiobj_fws.png 50 | :alt: mutliobj_fws 51 | :width: 800px 52 | :align: center 53 | 54 | 55 | The y written to the spec by the simulation firework is a list, not a scalar as in previous examples. OptTask will automatically consider this a multi-objective optimization. 56 | 57 | Note that **OptTask can go anywhere in your workflow as long as it can read _x and _y from the spec!** 58 | *In this example, the first firework passes the required _x and _y keys to the optimization firework with the FWAction update_spec arg.* 59 | 60 | The code we use to define the workflow creator is similar to that found in the quickstart and basic tutorials: 61 | 62 | 63 | .. code-block:: python 64 | 65 | from fireworks.core.rocket_launcher import rapidfire 66 | from fireworks import Workflow, Firework, LaunchPad 67 | from rocketsled import OptTask 68 | from rocketsled.examples.tasks import ComplexMultiObjTask 69 | 70 | 71 | def wf_creator(x): 72 | X_dim = [(16, 145), (0.0, 90.0), ["industry standard", "shark fin", "dolphin fin"]] 73 | simulation = Firework([ComplexMultiObjTask()], spec={'_x': x}, name="simulation") 74 | optimization = Firework([OptTask(wf_creator='rocketsled.examples.complex.wf_creator', 75 | dimensions=X_dim, 76 | host='localhost', 77 | port=27017, 78 | opt_label="opt_complex", 79 | acq="maximin", 80 | predictor="GaussianProcessRegressor", 81 | get_z='rocketsled.examples.complex.get_z', 82 | name='rsled')], 83 | name="optimization") 84 | return Workflow([simulation, optimization], {simulation: optimization}) 85 | 86 | def get_z(x): 87 | fin_len = x[0] 88 | fin_angle = x[1] 89 | useful_feature1 = fin_len + fin_angle ** 2 90 | useful_feature2 = fin_angle + fin_len 91 | return x + [useful_feature1, useful_feature2] 92 | 93 | The new arguments to OptTask are: 94 | 95 | * :code:`predictor` - A different built in predictor is used for this optimization. A full list of builtin predictors (and guide for using custom predictors) is shown in the comprehensive guide. 96 | * :code:`acq` - Acquisition functions help us get better results during optimization (generally) than pure exploitation, but may be more computationally intensive. The acquisition function used here is specifically for multi-objective optimization; for single objectives, check the comprehensive guide. 97 | * :code:`n_searchpts` - Tuning the number of points for prediction affects optimizer performance and computational efficiency (the two are often inversely correlated). Also use :code:`n_trainpts` to restrict the number of points used for training from completed runs. 98 | * :code:`get_z` - Encapsulate empirical knowledge with get_z. From physical laws, we postulate two useful features, which we put in a vector called "z". When :code:`get_z` is enabled, x is only used as a label (**not for learning**), unless explicitly returned by get_z. In this case, x might be useful for learning, so we'll return it. 99 | 100 | We can launch 250 optimization loop runs with: 101 | 102 | .. code-block:: python 103 | 104 | def run_workflows(): 105 | TESTDB_NAME = 'rsled' 106 | launchpad = LaunchPad(name=TESTDB_NAME) 107 | launchpad.reset(password=None, require_password=False) 108 | launchpad.add_wf(wf_creator([60, 45.0, "industry standard"])) 109 | rapidfire(launchpad, nlaunches=500, sleep_time=0) 110 | 111 | if __name__ == "__main__": 112 | run_workflows() 113 | 114 | 115 | Examining results 116 | ----------------------------- 117 | 118 | .. code-block:: python 119 | 120 | from fireworks import LaunchPad 121 | from rocketsled import visualize 122 | 123 | lpad = LaunchPad(host='localhost', port=27017, name='rsled') 124 | visualize(lpad.db.opt_complex, print_pareto=True, scale='log', showmean=False) 125 | 126 | There is some useful stdout produced by :code:`visualize`, including a complete list of the optimal objective value points (meaning non-dominated in any given objective), also known as the **Pareto Frontier**. 127 | The points on the Pareto frontier need not have the minimum values for any one of the objectives; however, the absolute best found values for each objective are shown as well. 128 | 129 | .. code-block:: bash 130 | 131 | min(f(x)) objective 0 is 2.4716663906 at x = [16, 0.9794468723495431, u'industry standard'] 132 | min(f(x)) objective 1 is 3.74337173135 at x = [16, 0.06040480720271191, u'dolphin fin'] 133 | min(f(x)) objective 2 is 0.0104429576126 at x = [142, 1.2608356066742255, u'industry standard'] 134 | 135 | Problem dimension: 136 | * X dimensions (3): [, , ] 137 | * Z dimensions (5): [, , , , ] 138 | Only Z data is being used for learning. 139 | Number of Optimizations: 250 140 | Optimizers used (by percentage of optimizations): 141 | * 100.00%: GaussianProcessRegressor with acquisition: Maximin Expected Improvement using 3 objectives 142 | Number of reserved guesses: 1 143 | Number of waiting optimizations: 0 144 | DB not locked by any process (no current optimization). 145 | 146 | Pareto Frontier: 30 points 147 | f(x) = [2.471666390596957, 27.48238986848395, 0.4448868032547827] @ x = [16, 0.9794468723495431, u'industry standard'] 148 | f(x) = [93.01859724025691, 1623.9392203207517, 0.11086881838942292] @ x = [116, 13.26932017507497, u'industry standard'] 149 | f(x) = [20.263988323874553, 405.15607152348605, 0.25007134344442905] @ x = [49, 6.227551501995968, u'shark fin'] 150 | f(x) = [12.127316307413249, 226.5705263013419, 0.28016039923073677] @ x = [37, 4.284994178298564, u'shark fin'] 151 | f(x) = [42.32583374856372, 394.0840359770293, 0.23860336541319574] @ x = [76, 3.3002668184681063, u'industry standard'] 152 | f(x) = [19.790663261912012, 700.4097477732201, 0.26463786067587647] @ x = [47, 15.546544052561718, u'shark fin'] 153 | f(x) = [10.2168227961067, 130.60557338489392, 0.2872835850667972] @ x = [34, 2.153086684368809, u'shark fin'] 154 | f(x) = [56.85262300070313, 436.41896887230035, 0.15027333987286837] @ x = [87, 2.429843874399414, u'shark fin'] 155 | f(x) = [72.38543355551161, 191.62631972759323, 0.22769551246826705] @ x = [79, 1.3306954053381337, u'dolphin fin'] 156 | f(x) = [36.08999149122292, 852.5869436000326, 0.2072757141556187] @ x = [67, 10.950527222513989, u'shark fin'] 157 | f(x) = [4.183289647037304, 34.99182801945318, 0.32071198427784786] @ x = [21, 0.6944844687799834, u'shark fin'] 158 | f(x) = [6.228008499929818, 67.91202551642581, 0.30783624358171] @ x = [26, 1.294856929696876, u'shark fin'] 159 | f(x) = [8.973748107281045, 39.19531111781273, 0.29224810030963994] @ x = [32, 0.3810165150936706, u'shark fin'] 160 | f(x) = [2.527642158007039, 15.702700032050892, 0.3336259028104275] @ x = [16, 0.3355654235898753, u'shark fin'] 161 | f(x) = [8.7308090242463, 142.19720382324883, 0.29521862570256696] @ x = [31, 2.906278222483265, u'shark fin'] 162 | f(x) = [126.20031698441441, 3019.484417324195, 0.05251518595418252] @ x = [133, 21.540269010022485, u'shark fin'] 163 | f(x) = [116.07496718360396, 1849.7972768675982, 0.05863417948265865] @ x = [131, 12.953946970009913, u'industry standard'] 164 | f(x) = [46.77918527129666, 1253.2940813234145, 0.186696724157924] @ x = [77, 15.29799176872524, u'shark fin'] 165 | f(x) = [88.88302026836072, 1918.8872308046193, 0.10128441729749994] @ x = [110, 15.250278680499424, u'shark fin'] 166 | f(x) = [7.710723548287516, 118.25680233360677, 0.30028408634821974] @ x = [29, 2.47714858689301, u'shark fin'] 167 | f(x) = [26.685736420234065, 850.9827854258534, 0.2408425996095338] @ x = [56, 15.18143648127198, u'shark fin'] 168 | f(x) = [2.8274978546887954, 18.72563173907369, 0.3310416362821108] @ x = [17, 0.3930853690817204, u'shark fin'] 169 | f(x) = [133.33546429969246, 445.1188547596248, 0.010442957612568495] @ x = [142, 1.2608356066742255, u'industry standard'] 170 | f(x) = [3.8076194945316377, 3.743371731347361, 0.44482781143780603] @ x = [16, 0.06040480720271191, u'dolphin fin'] 171 | f(x) = [76.14424925941366, 483.3414876831859, 0.11141517427055053] @ x = [102, 2.1210371818169915, u'shark fin'] 172 | f(x) = [67.71434523904519, 1284.663645968029, 0.13471025173127132] @ x = [95, 10.799906903283864, u'shark fin'] 173 | f(x) = [102.63207167405578, 874.4375707299264, 0.07717805945487849] @ x = [123, 4.617255237438416, u'industry standard'] 174 | f(x) = [60.94129655936235, 868.258686604232, 0.14422557214075377] @ x = [90, 6.546645334584239, u'shark fin'] 175 | f(x) = [75.7058035188604, 1397.80346543294, 0.11937654419706178] @ x = [101, 10.98190876732162, u'shark fin'] 176 | f(x) = [54.82841730962141, 909.1474088353508, 0.20529359285755197] @ x = [87, 9.260464582964612, u'industry standard'] 177 | 178 | 179 | .. image:: _static/multiobj_log.png 180 | :alt: mutliobj_log 181 | :width: 800px 182 | :align: center 183 | 184 | The parameters :code:`x=[21, 0.6945, 'shark fin']` give a Pareto-optimal output of :code:`f(x)=[4.18, 35.0, 0.32]`, which, while not optimal in any one metric, provide a robust compromise. 185 | 186 | 187 | See the :doc:`comprehensive guide ` for a full list of options and arguments to OptTask! -------------------------------------------------------------------------------- /docs/_sources/basic.rst.txt: -------------------------------------------------------------------------------- 1 | *Tutorial 1 requires some knowledge of Fireworks. If you aren't comfortable with Fireworks, please work through the tutorials* `here `_. 2 | 3 | ======================================= 4 | Basic Tutorial - 5-10 min 5 | ======================================= 6 | 7 | In the quickstart, we use auto_setup to put a Python function in a Firework and create an optimization loop, then launch it, run it, and examine the results. 8 | If evaluating your objective function is more complex, it is useful to put it in a FireWorks workflow, where individual parts of the expensive workflow can be handled more precisely. 9 | In this tutorial, we'll walk through setting up an optimization loop if you already have a workflow that evaluates your objective function. 10 | 11 | This tutorial can be found in :code:`rocketsled/examples/basic.py`. 12 | 13 | 14 | Overview 15 | -------- 16 | **What's the minimum I need to run a workflow?** 17 | 18 | Rocketsled is designed to be a "plug and play" framework, meaning "plug in" your workflow and search space. The requirements are: 19 | 20 | * **Workflow creator function**: takes in a vector of workflow input parameters :code:`x` and returns a Fireworks workflow based on those parameters, including optimization. Specified with the :code:`wf_creator` arg to OptTask. OptTask should be located somewhere in the workflow that :code:`wf_creator` returns. 21 | * **'_x' and '_y' fields in spec**: the parameters the workflow is run with and the output metric, in the spec of the Firework containing :code:`OptTask`. x must be a vector (list), and y can be a vector (list) or scalar (float). 22 | * **Dimensions of the search space**: A list of the spaces dimensions, where each dimension is defined by :code:`(higher, lower)` form (for float/ int) or ["a", "comprehensive", "list"] form for categories. Specified with the :code:`dimensions` argument to OptTask 23 | * **MongoDB collection to store data**: Each optimization problem should have its own collection. Specify with :code:`host`, :code:`port`, and :code:`name` arguments to OptTask, or with a Launchpad object (via :code:`lpad` arg to OptTask). 24 | 25 | 26 | Making a Workflow Function 27 | -------------------------- 28 | The easiest way to get started with rocketsled using your own workflows is to modify one of the examples. 29 | 30 | 31 | We are going to use a workflow containing one Firework and two tasks - a task that takes the sum of the input vector, and OptTask. 32 | Let's create a **workflow creator function**, the most important part. This function takes an input vector, and returns a workflow based on that vector. 33 | 34 | 35 | .. code-block:: python 36 | 37 | from fireworks.core.rocket_launcher import rapidfire 38 | from fireworks import Workflow, Firework, LaunchPad 39 | from rocketsled import OptTask 40 | from rocketsled.examples.tasks import SumTask 41 | 42 | # a workflow creator function which takes x and returns a workflow based on x 43 | def wf_creator(x): 44 | 45 | spec = {'_x':x} 46 | X_dim = [(1, 5), (1, 5), (1, 5)] 47 | 48 | # SumTask writes _y field to the spec internally. 49 | 50 | firework1 = Firework([SumTask(), 51 | OptTask(wf_creator='rocketsled.examples.basic.wf_creator', 52 | dimensions=X_dim, 53 | host='localhost', 54 | port=27017, 55 | name='rsled')], 56 | spec=spec) 57 | return Workflow([firework1]) 58 | 59 | 60 | We define the info OptTask needs by passing it keyword arguments. 61 | _________________________________________________________________ 62 | 63 | The required arguments are: 64 | 65 | * **wf_creator**: The full path to the workflow creator function. Can also be specified in non-module form, e.g., :code:`/my/path/to/module.py` 66 | * **dimensions**: The dimensions of your search space 67 | 68 | The remaining arguments define where we want to store the optimization data. The default optimization collection is :code:`opt_default`; you can change it with the :code:`opt_label` argument to OptTask. 69 | By default, OptTask minimizes your objective function. 70 | 71 | 72 | Launch! 73 | ------- 74 | To start the optimization, we run the code below, and we use the point :code:`[5, 5, 2]` as our initial guess. 75 | 76 | .. code-block:: python 77 | 78 | def run_workflows(): 79 | TESTDB_NAME = 'rsled' 80 | launchpad = LaunchPad(name=TESTDB_NAME) 81 | # launchpad.reset(password=None, require_password=False) 82 | launchpad.add_wf(wf_creator([5, 5, 2])) 83 | rapidfire(launchpad, nlaunches=10, sleep_time=0) 84 | 85 | if __name__ == "__main__": 86 | run_workflows() 87 | 88 | 89 | 90 | Visualize Results 91 | ----------------- 92 | .. code-block:: python 93 | 94 | from fireworks import LaunchPad 95 | from rocketsled import visualize 96 | 97 | lpad = LaunchPad(host='localhost', port=27017, name='rsled') 98 | visualize(lpad.db.opt_default) 99 | 100 | 101 | .. image:: _static/basic_viz.png 102 | :alt: basic_viz 103 | 104 | 105 | Great! We just ran 10 optimization loops using the default optimization procedure, minimizing our objective function workflow (just :code:`SumTask()` in this case). 106 | See the :doc:`guide ` to see the full capabilities of OptTask, the :doc:`advanced tutorial `, or the examples in the :code:`/examples` directory. -------------------------------------------------------------------------------- /docs/_sources/modules.rst.txt: -------------------------------------------------------------------------------- 1 | rocketsled 2 | ========== 3 | 4 | .. toctree:: 5 | :maxdepth: 4 6 | 7 | rocketsled 8 | -------------------------------------------------------------------------------- /docs/_sources/quickstart.rst.txt: -------------------------------------------------------------------------------- 1 | *Note: This quickstart assumes a limited knowledge of FireWorks. If you already have a workflow built, see the examples or the more advanced tutorials.* 2 | 3 | 4 | ===================================================== 5 | Welcome to the :code:`rocketsled` quickstart! - 5 min 6 | ===================================================== 7 | 8 | 9 | If you have a Python function to optimize, the easiest way to get started is to use rocketsled's auto_setup. Auto-configure wraps any Python function in a FireWork - an execution wrapper -, creates a Firework containing an OptTask optimization, and creates a workflow optimization loop linking the two Fireworks which is ready for launch. 10 | 11 | Let's get an optimization running on your local machine. First, make sure a :code:`mongod` instance is running. 12 | 13 | .. code-block:: bash 14 | 15 | $ mongod 16 | 17 | 18 | Define objective function 19 | ------------------------- 20 | 21 | Great! Now lets define a trivial objective function f(x) for this demo. Your actual objective function will be **much** more complex than this. 22 | 23 | .. code-block:: python 24 | 25 | # The objective function must accept a vector and return a scalar/vector. 26 | def f(x): 27 | return x[0] * x[1] / x[2] 28 | 29 | Define constraints 30 | ------------------ 31 | 32 | Let's constrain this function in each of its dimensions. With rocketsled, each bounded dimension is represented as a 2-tuple for (low, high), and is placed in a list. So if we want to constrain x :sub:`0` to integers between 1-100, x :sub:`1` to integers between 200-300, and x :sub:`3` to floats between 5.0-10.0: 33 | 34 | .. code-block:: python 35 | 36 | dimensions = [(1, 100), (200, 300), (5.0, 10.0)] 37 | 38 | 39 | These constraints ensure the function has a maximum value of 6,000. 40 | 41 | 42 | Using auto_setup on a function 43 | -------------------------------- 44 | 45 | Now we can use :code:`auto_setup` to write a file containing 46 | 47 | 1. A workflow creator that can: 48 | 49 | a. Run your function in a FireWork 50 | 51 | b. Run the optimization algorithm in a separate FireWork 52 | 53 | 2. Commands to launch your workflow. 54 | 55 | 56 | Lets' maximize our objective function using rocketsled's default predictor, based on scikit-learn's RandomForestRegressor. 57 | 58 | .. code-block:: python 59 | 60 | from rocketsled import auto_setup 61 | 62 | # Define the db where the LaunchPad and optimization data will be stored 63 | # The 'opt_label' field defines the name of the optimization collection 64 | dbinfo = {"host": "localhost", "name": "my_db", "port": 27017, "opt_label": "quickstart"} 65 | 66 | if __name__ == "__main__": 67 | auto_setup(f, dimensions, wfname="quickstart", maximize=True, **dbinfo) 68 | 69 | .. code-block:: bash 70 | 71 | File successfully created! 72 | Find your auto sled at /Users/home/rocketsled/rocketsled/auto_sleds/quickstart.py 73 | 74 | 75 | Check out and run the auto sled 76 | -------------------------------- 77 | 78 | Let's go to this directory and look at the file, which should look similar to this: 79 | 80 | .. code-block:: python 81 | 82 | from __future__ import unicode_literals 83 | """ 84 | This is an automatically created script from auto_setup. 85 | If you are not comfortable working with FireWorks and PyTask, do NOT move this 86 | file out this directory or rename it if you want to run this workflow! 87 | 88 | If you are comfortable working with FireWorks and PyTask, feel free to edit 89 | and/or move this file to suit your needs. See the OptTask documentation and the 90 | examples for more information on setting up workflow creators. 91 | """ 92 | from fireworks import PyTask, Firework, Workflow, LaunchPad 93 | from fireworks.core.rocket_launcher import rapidfire 94 | from rocketsled.utils import deserialize, random_guess 95 | from rocketsled import OptTask 96 | 97 | 98 | # This is your function, imported to rocketsled to use with PyTask. 99 | f = deserialize('/Users/ardunn/quickstart.f') 100 | 101 | def wf_creator(x): 102 | spec = {'_x':x} 103 | pt = PyTask(func='rocketsled.auto_sleds.quickstart.f', args=[x], outputs=['_y']) 104 | ot = OptTask(opt_label='quickstart', dimensions=[(1, 100), (200, 300), (5.0, 10.0)], wf_creator='rocketsled.auto_sleds.quickstart.wf_creator', maximize=True, host='localhost', port=27017, name='my_db') 105 | fw0 = Firework([pt], spec=spec, name='PyTaskFW') 106 | fw1 = Firework([ot], spec=spec, name='RocketsledFW') 107 | wf = Workflow([fw0, fw1], {fw0: [fw1], fw1: []}, name='quickstart @ ' + str(x)) 108 | return wf 109 | 110 | 111 | if __name__=='__main__': 112 | 113 | # Make sure the launchpad below is correct, and make changes if necessary if 114 | # it does not match the OptTask db ^^^: 115 | lpad = LaunchPad(host='localhost', port=27017, name='my_db') 116 | # lpad.reset(password=None, require_password=False) 117 | 118 | # Define your workflow to start... 119 | wf1 = wf_creator(random_guess([(1, 100), (200, 300), (5.0, 10.0)])) 120 | 121 | # Add it to the launchpad and launch! 122 | lpad.add_wf(wf1) 123 | # rapidfire(lpad, nlaunches=5, sleep_time=0) 124 | 125 | :code:`wf_creator` returns an optimization loop Workflow containing your objective function Firework and the optimization Firework. Then it adds it to the launchpad and launches it! 126 | 127 | Your workflow on the launchpad looks like this: 128 | 129 | .. image:: _static/quickstart_lp.png 130 | :alt: quickstart_viz 131 | :width: 1200px 132 | 133 | Your objective function is contained in PyTaskFW. The optimization is done in RocketsledFW. When both Fireworks have completed, RocketsledFW launches another workflow based on the next best predicted x value. 134 | 135 | Uncomment the :code:`lpad.reset` line if necessary (i.e., if this database is not already a FireWorks db or you don't mind resetting it). Uncomment the last line if you'd like to launch right away! Let's change nlaunches to 100, to run the first 100 Fireworks (50 optimization loops). 136 | 137 | .. code-block:: python 138 | 139 | rapidfire(lpad, nlaunches=100, sleep_time=0) 140 | 141 | 142 | 143 | Visualize the optimization results 144 | ---------------------------------- 145 | 146 | Rocketsled comes with a simple function for creating a matplotlib optimization plot. 147 | 148 | .. code-block:: python 149 | 150 | from rocketsled import visualize 151 | from fireworks import LaunchPad 152 | 153 | lp = LaunchPad(host='localhost', port=27017, name='my_db') 154 | visualize(lp.db.quickstart, maximize=True) 155 | 156 | .. image:: _static/quickstart_viz1.png 157 | :alt: quickstart_viz 158 | :width: 1200px 159 | 160 | The best found value is shown in green. 161 | Although for this basic example we are using relatively few search points (default 1,000) and no acquisition function for the Bayesian optimization (acq=None, default), you should still find that the maximum found is 90-99% of the true maximum, 6,000. 162 | 163 | 164 | Congrats! We've just worked through the deployment and execution of an entire optimized exploration. For a tutorial on using pre-existing workflows with FireWorks, go :doc:`here. ` -------------------------------------------------------------------------------- /docs/_sources/rocketsled.auto_sleds.rst.txt: -------------------------------------------------------------------------------- 1 | rocketsled.auto\_sleds package 2 | ============================== 3 | 4 | Submodules 5 | ---------- 6 | 7 | rocketsled.auto\_sleds.convert module 8 | ------------------------------------- 9 | 10 | .. automodule:: rocketsled.auto_sleds.convert 11 | :members: 12 | :undoc-members: 13 | :show-inheritance: 14 | 15 | rocketsled.auto\_sleds.hardness module 16 | -------------------------------------- 17 | 18 | .. automodule:: rocketsled.auto_sleds.hardness 19 | :members: 20 | :undoc-members: 21 | :show-inheritance: 22 | 23 | rocketsled.auto\_sleds.hardnessgp module 24 | ---------------------------------------- 25 | 26 | .. automodule:: rocketsled.auto_sleds.hardnessgp 27 | :members: 28 | :undoc-members: 29 | :show-inheritance: 30 | 31 | rocketsled.auto\_sleds.pskites\_gp module 32 | ----------------------------------------- 33 | 34 | .. automodule:: rocketsled.auto_sleds.pskites_gp 35 | :members: 36 | :undoc-members: 37 | :show-inheritance: 38 | 39 | rocketsled.auto\_sleds.pskites\_rf module 40 | ----------------------------------------- 41 | 42 | .. automodule:: rocketsled.auto_sleds.pskites_rf 43 | :members: 44 | :undoc-members: 45 | :show-inheritance: 46 | 47 | rocketsled.auto\_sleds.pskites\_rfz module 48 | ------------------------------------------ 49 | 50 | .. automodule:: rocketsled.auto_sleds.pskites_rfz 51 | :members: 52 | :undoc-members: 53 | :show-inheritance: 54 | 55 | rocketsled.auto\_sleds.pskites\_rfz\_ep module 56 | ---------------------------------------------- 57 | 58 | .. automodule:: rocketsled.auto_sleds.pskites_rfz_ep 59 | :members: 60 | :undoc-members: 61 | :show-inheritance: 62 | 63 | rocketsled.auto\_sleds.pskites\_rfzc module 64 | ------------------------------------------- 65 | 66 | .. automodule:: rocketsled.auto_sleds.pskites_rfzc 67 | :members: 68 | :undoc-members: 69 | :show-inheritance: 70 | 71 | rocketsled.auto\_sleds.pskites\_rfzc\_ep module 72 | ----------------------------------------------- 73 | 74 | .. automodule:: rocketsled.auto_sleds.pskites_rfzc_ep 75 | :members: 76 | :undoc-members: 77 | :show-inheritance: 78 | 79 | rocketsled.auto\_sleds.quickstart module 80 | ---------------------------------------- 81 | 82 | .. automodule:: rocketsled.auto_sleds.quickstart 83 | :members: 84 | :undoc-members: 85 | :show-inheritance: 86 | 87 | rocketsled.auto\_sleds.quickstart\_2018\-12\-07\-02\-06\-02\-617273 module 88 | -------------------------------------------------------------------------- 89 | 90 | .. automodule:: rocketsled.auto_sleds.quickstart_2018-12-07-02-06-02-617273 91 | :members: 92 | :undoc-members: 93 | :show-inheritance: 94 | 95 | 96 | Module contents 97 | --------------- 98 | 99 | .. automodule:: rocketsled.auto_sleds 100 | :members: 101 | :undoc-members: 102 | :show-inheritance: 103 | -------------------------------------------------------------------------------- /docs/_sources/rocketsled.benchmarks.rst.txt: -------------------------------------------------------------------------------- 1 | rocketsled.benchmarks package 2 | ============================= 3 | 4 | Submodules 5 | ---------- 6 | 7 | rocketsled.benchmarks.auto\_for\_bench module 8 | --------------------------------------------- 9 | 10 | .. automodule:: rocketsled.benchmarks.auto_for_bench 11 | :members: 12 | :undoc-members: 13 | :show-inheritance: 14 | 15 | rocketsled.benchmarks.benchmarker module 16 | ---------------------------------------- 17 | 18 | .. automodule:: rocketsled.benchmarks.benchmarker 19 | :members: 20 | :undoc-members: 21 | :show-inheritance: 22 | 23 | rocketsled.benchmarks.rastrigin module 24 | -------------------------------------- 25 | 26 | .. automodule:: rocketsled.benchmarks.rastrigin 27 | :members: 28 | :undoc-members: 29 | :show-inheritance: 30 | 31 | rocketsled.benchmarks.rbopttest module 32 | -------------------------------------- 33 | 34 | .. automodule:: rocketsled.benchmarks.rbopttest 35 | :members: 36 | :undoc-members: 37 | :show-inheritance: 38 | 39 | rocketsled.benchmarks.rmcols module 40 | ----------------------------------- 41 | 42 | .. automodule:: rocketsled.benchmarks.rmcols 43 | :members: 44 | :undoc-members: 45 | :show-inheritance: 46 | 47 | rocketsled.benchmarks.skopttest module 48 | -------------------------------------- 49 | 50 | .. automodule:: rocketsled.benchmarks.skopttest 51 | :members: 52 | :undoc-members: 53 | :show-inheritance: 54 | 55 | 56 | Module contents 57 | --------------- 58 | 59 | .. automodule:: rocketsled.benchmarks 60 | :members: 61 | :undoc-members: 62 | :show-inheritance: 63 | -------------------------------------------------------------------------------- /docs/_sources/rocketsled.examples.rst.txt: -------------------------------------------------------------------------------- 1 | rocketsled.examples package 2 | =========================== 3 | 4 | Submodules 5 | ---------- 6 | 7 | rocketsled.examples.basic module 8 | -------------------------------- 9 | 10 | .. automodule:: rocketsled.examples.basic 11 | :members: 12 | :undoc-members: 13 | :show-inheritance: 14 | 15 | rocketsled.examples.batch module 16 | -------------------------------- 17 | 18 | .. automodule:: rocketsled.examples.batch 19 | :members: 20 | :undoc-members: 21 | :show-inheritance: 22 | 23 | rocketsled.examples.complex module 24 | ---------------------------------- 25 | 26 | .. automodule:: rocketsled.examples.complex 27 | :members: 28 | :undoc-members: 29 | :show-inheritance: 30 | 31 | Module contents 32 | --------------- 33 | 34 | .. automodule:: rocketsled.examples 35 | :members: 36 | :undoc-members: 37 | :show-inheritance: 38 | -------------------------------------------------------------------------------- /docs/_sources/rocketsled.rst.txt: -------------------------------------------------------------------------------- 1 | rocketsled package 2 | ================== 3 | 4 | Subpackages 5 | ----------- 6 | 7 | .. toctree:: 8 | :maxdepth: 4 9 | 10 | rocketsled.examples 11 | rocketsled.tests 12 | 13 | Submodules 14 | ---------- 15 | 16 | rocketsled.acq module 17 | --------------------- 18 | 19 | .. automodule:: rocketsled.acq 20 | :members: 21 | :undoc-members: 22 | :show-inheritance: 23 | 24 | rocketsled.control module 25 | ------------------------- 26 | 27 | .. automodule:: rocketsled.control 28 | :members: 29 | :undoc-members: 30 | :show-inheritance: 31 | 32 | rocketsled.task module 33 | ---------------------- 34 | 35 | .. automodule:: rocketsled.task 36 | :members: 37 | :undoc-members: 38 | :show-inheritance: 39 | 40 | rocketsled.utils module 41 | ----------------------- 42 | 43 | .. automodule:: rocketsled.utils 44 | :members: 45 | :undoc-members: 46 | :show-inheritance: 47 | 48 | Module contents 49 | --------------- 50 | 51 | .. automodule:: rocketsled 52 | :members: 53 | :undoc-members: 54 | :show-inheritance: 55 | -------------------------------------------------------------------------------- /docs/_sources/rocketsled.tests.rst.txt: -------------------------------------------------------------------------------- 1 | rocketsled.tests package 2 | ======================== 3 | 4 | Submodules 5 | ---------- 6 | 7 | rocketsled.tests.deserialize\_func module 8 | ----------------------------------------- 9 | 10 | .. automodule:: rocketsled.tests.deserialize_func 11 | :members: 12 | :undoc-members: 13 | :show-inheritance: 14 | 15 | rocketsled.tests.test\_task module 16 | ---------------------------------- 17 | 18 | .. automodule:: rocketsled.tests.test_task 19 | :members: 20 | :undoc-members: 21 | :show-inheritance: 22 | 23 | rocketsled.tests.test\_utils module 24 | ----------------------------------- 25 | 26 | .. automodule:: rocketsled.tests.test_utils 27 | :members: 28 | :undoc-members: 29 | :show-inheritance: 30 | 31 | Module contents 32 | --------------- 33 | 34 | .. automodule:: rocketsled.tests 35 | :members: 36 | :undoc-members: 37 | :show-inheritance: 38 | -------------------------------------------------------------------------------- /docs/_static/3dmap_mend.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackingmaterials/rocketsled/294cdc370ad2fbca3475046f2122f0a6e0a33946/docs/_static/3dmap_mend.png -------------------------------------------------------------------------------- /docs/_static/Comparison.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackingmaterials/rocketsled/294cdc370ad2fbca3475046f2122f0a6e0a33946/docs/_static/Comparison.png -------------------------------------------------------------------------------- /docs/_static/WC_structure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackingmaterials/rocketsled/294cdc370ad2fbca3475046f2122f0a6e0a33946/docs/_static/WC_structure.png -------------------------------------------------------------------------------- /docs/_static/ajax-loader.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackingmaterials/rocketsled/294cdc370ad2fbca3475046f2122f0a6e0a33946/docs/_static/ajax-loader.gif -------------------------------------------------------------------------------- /docs/_static/basic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackingmaterials/rocketsled/294cdc370ad2fbca3475046f2122f0a6e0a33946/docs/_static/basic.png -------------------------------------------------------------------------------- /docs/_static/basic_viz.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackingmaterials/rocketsled/294cdc370ad2fbca3475046f2122f0a6e0a33946/docs/_static/basic_viz.png -------------------------------------------------------------------------------- /docs/_static/batch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackingmaterials/rocketsled/294cdc370ad2fbca3475046f2122f0a6e0a33946/docs/_static/batch.png -------------------------------------------------------------------------------- /docs/_static/comment-bright.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackingmaterials/rocketsled/294cdc370ad2fbca3475046f2122f0a6e0a33946/docs/_static/comment-bright.png -------------------------------------------------------------------------------- /docs/_static/comment-close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackingmaterials/rocketsled/294cdc370ad2fbca3475046f2122f0a6e0a33946/docs/_static/comment-close.png -------------------------------------------------------------------------------- /docs/_static/comment.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackingmaterials/rocketsled/294cdc370ad2fbca3475046f2122f0a6e0a33946/docs/_static/comment.png -------------------------------------------------------------------------------- /docs/_static/diagram_fireworks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackingmaterials/rocketsled/294cdc370ad2fbca3475046f2122f0a6e0a33946/docs/_static/diagram_fireworks.png -------------------------------------------------------------------------------- /docs/_static/diagram_highthroughput.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackingmaterials/rocketsled/294cdc370ad2fbca3475046f2122f0a6e0a33946/docs/_static/diagram_highthroughput.png -------------------------------------------------------------------------------- /docs/_static/diagram_highthroughput2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackingmaterials/rocketsled/294cdc370ad2fbca3475046f2122f0a6e0a33946/docs/_static/diagram_highthroughput2.png -------------------------------------------------------------------------------- /docs/_static/doctools.js: -------------------------------------------------------------------------------- 1 | /* 2 | * doctools.js 3 | * ~~~~~~~~~~~ 4 | * 5 | * Sphinx JavaScript utilities for all documentation. 6 | * 7 | * :copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS. 8 | * :license: BSD, see LICENSE for details. 9 | * 10 | */ 11 | 12 | /** 13 | * select a different prefix for underscore 14 | */ 15 | $u = _.noConflict(); 16 | 17 | /** 18 | * make the code below compatible with browsers without 19 | * an installed firebug like debugger 20 | if (!window.console || !console.firebug) { 21 | var names = ["log", "debug", "info", "warn", "error", "assert", "dir", 22 | "dirxml", "group", "groupEnd", "time", "timeEnd", "count", "trace", 23 | "profile", "profileEnd"]; 24 | window.console = {}; 25 | for (var i = 0; i < names.length; ++i) 26 | window.console[names[i]] = function() {}; 27 | } 28 | */ 29 | 30 | /** 31 | * small helper function to urldecode strings 32 | * 33 | * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/decodeURIComponent#Decoding_query_parameters_from_a_URL 34 | */ 35 | jQuery.urldecode = function(x) { 36 | if (!x) { 37 | return x 38 | } 39 | return decodeURIComponent(x.replace(/\+/g, ' ')); 40 | }; 41 | 42 | /** 43 | * small helper function to urlencode strings 44 | */ 45 | jQuery.urlencode = encodeURIComponent; 46 | 47 | /** 48 | * This function returns the parsed url parameters of the 49 | * current request. Multiple values per key are supported, 50 | * it will always return arrays of strings for the value parts. 51 | */ 52 | jQuery.getQueryParameters = function(s) { 53 | if (typeof s === 'undefined') 54 | s = document.location.search; 55 | var parts = s.substr(s.indexOf('?') + 1).split('&'); 56 | var result = {}; 57 | for (var i = 0; i < parts.length; i++) { 58 | var tmp = parts[i].split('=', 2); 59 | var key = jQuery.urldecode(tmp[0]); 60 | var value = jQuery.urldecode(tmp[1]); 61 | if (key in result) 62 | result[key].push(value); 63 | else 64 | result[key] = [value]; 65 | } 66 | return result; 67 | }; 68 | 69 | /** 70 | * highlight a given string on a jquery object by wrapping it in 71 | * span elements with the given class name. 72 | */ 73 | jQuery.fn.highlightText = function(text, className) { 74 | function highlight(node, addItems) { 75 | if (node.nodeType === 3) { 76 | var val = node.nodeValue; 77 | var pos = val.toLowerCase().indexOf(text); 78 | if (pos >= 0 && 79 | !jQuery(node.parentNode).hasClass(className) && 80 | !jQuery(node.parentNode).hasClass("nohighlight")) { 81 | var span; 82 | var isInSVG = jQuery(node).closest("body, svg, foreignObject").is("svg"); 83 | if (isInSVG) { 84 | span = document.createElementNS("http://www.w3.org/2000/svg", "tspan"); 85 | } else { 86 | span = document.createElement("span"); 87 | span.className = className; 88 | } 89 | span.appendChild(document.createTextNode(val.substr(pos, text.length))); 90 | node.parentNode.insertBefore(span, node.parentNode.insertBefore( 91 | document.createTextNode(val.substr(pos + text.length)), 92 | node.nextSibling)); 93 | node.nodeValue = val.substr(0, pos); 94 | if (isInSVG) { 95 | var rect = document.createElementNS("http://www.w3.org/2000/svg", "rect"); 96 | var bbox = node.parentElement.getBBox(); 97 | rect.x.baseVal.value = bbox.x; 98 | rect.y.baseVal.value = bbox.y; 99 | rect.width.baseVal.value = bbox.width; 100 | rect.height.baseVal.value = bbox.height; 101 | rect.setAttribute('class', className); 102 | addItems.push({ 103 | "parent": node.parentNode, 104 | "target": rect}); 105 | } 106 | } 107 | } 108 | else if (!jQuery(node).is("button, select, textarea")) { 109 | jQuery.each(node.childNodes, function() { 110 | highlight(this, addItems); 111 | }); 112 | } 113 | } 114 | var addItems = []; 115 | var result = this.each(function() { 116 | highlight(this, addItems); 117 | }); 118 | for (var i = 0; i < addItems.length; ++i) { 119 | jQuery(addItems[i].parent).before(addItems[i].target); 120 | } 121 | return result; 122 | }; 123 | 124 | /* 125 | * backward compatibility for jQuery.browser 126 | * This will be supported until firefox bug is fixed. 127 | */ 128 | if (!jQuery.browser) { 129 | jQuery.uaMatch = function(ua) { 130 | ua = ua.toLowerCase(); 131 | 132 | var match = /(chrome)[ \/]([\w.]+)/.exec(ua) || 133 | /(webkit)[ \/]([\w.]+)/.exec(ua) || 134 | /(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ua) || 135 | /(msie) ([\w.]+)/.exec(ua) || 136 | ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua) || 137 | []; 138 | 139 | return { 140 | browser: match[ 1 ] || "", 141 | version: match[ 2 ] || "0" 142 | }; 143 | }; 144 | jQuery.browser = {}; 145 | jQuery.browser[jQuery.uaMatch(navigator.userAgent).browser] = true; 146 | } 147 | 148 | /** 149 | * Small JavaScript module for the documentation. 150 | */ 151 | var Documentation = { 152 | 153 | init : function() { 154 | this.fixFirefoxAnchorBug(); 155 | this.highlightSearchWords(); 156 | this.initIndexTable(); 157 | if (DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS) { 158 | this.initOnKeyListeners(); 159 | } 160 | }, 161 | 162 | /** 163 | * i18n support 164 | */ 165 | TRANSLATIONS : {}, 166 | PLURAL_EXPR : function(n) { return n === 1 ? 0 : 1; }, 167 | LOCALE : 'unknown', 168 | 169 | // gettext and ngettext don't access this so that the functions 170 | // can safely bound to a different name (_ = Documentation.gettext) 171 | gettext : function(string) { 172 | var translated = Documentation.TRANSLATIONS[string]; 173 | if (typeof translated === 'undefined') 174 | return string; 175 | return (typeof translated === 'string') ? translated : translated[0]; 176 | }, 177 | 178 | ngettext : function(singular, plural, n) { 179 | var translated = Documentation.TRANSLATIONS[singular]; 180 | if (typeof translated === 'undefined') 181 | return (n == 1) ? singular : plural; 182 | return translated[Documentation.PLURALEXPR(n)]; 183 | }, 184 | 185 | addTranslations : function(catalog) { 186 | for (var key in catalog.messages) 187 | this.TRANSLATIONS[key] = catalog.messages[key]; 188 | this.PLURAL_EXPR = new Function('n', 'return +(' + catalog.plural_expr + ')'); 189 | this.LOCALE = catalog.locale; 190 | }, 191 | 192 | /** 193 | * add context elements like header anchor links 194 | */ 195 | addContextElements : function() { 196 | $('div[id] > :header:first').each(function() { 197 | $('\u00B6'). 198 | attr('href', '#' + this.id). 199 | attr('title', _('Permalink to this headline')). 200 | appendTo(this); 201 | }); 202 | $('dt[id]').each(function() { 203 | $('\u00B6'). 204 | attr('href', '#' + this.id). 205 | attr('title', _('Permalink to this definition')). 206 | appendTo(this); 207 | }); 208 | }, 209 | 210 | /** 211 | * workaround a firefox stupidity 212 | * see: https://bugzilla.mozilla.org/show_bug.cgi?id=645075 213 | */ 214 | fixFirefoxAnchorBug : function() { 215 | if (document.location.hash && $.browser.mozilla) 216 | window.setTimeout(function() { 217 | document.location.href += ''; 218 | }, 10); 219 | }, 220 | 221 | /** 222 | * highlight the search words provided in the url in the text 223 | */ 224 | highlightSearchWords : function() { 225 | var params = $.getQueryParameters(); 226 | var terms = (params.highlight) ? params.highlight[0].split(/\s+/) : []; 227 | if (terms.length) { 228 | var body = $('div.body'); 229 | if (!body.length) { 230 | body = $('body'); 231 | } 232 | window.setTimeout(function() { 233 | $.each(terms, function() { 234 | body.highlightText(this.toLowerCase(), 'highlighted'); 235 | }); 236 | }, 10); 237 | $('') 239 | .appendTo($('#searchbox')); 240 | } 241 | }, 242 | 243 | /** 244 | * init the domain index toggle buttons 245 | */ 246 | initIndexTable : function() { 247 | var togglers = $('img.toggler').click(function() { 248 | var src = $(this).attr('src'); 249 | var idnum = $(this).attr('id').substr(7); 250 | $('tr.cg-' + idnum).toggle(); 251 | if (src.substr(-9) === 'minus.png') 252 | $(this).attr('src', src.substr(0, src.length-9) + 'plus.png'); 253 | else 254 | $(this).attr('src', src.substr(0, src.length-8) + 'minus.png'); 255 | }).css('display', ''); 256 | if (DOCUMENTATION_OPTIONS.COLLAPSE_INDEX) { 257 | togglers.click(); 258 | } 259 | }, 260 | 261 | /** 262 | * helper function to hide the search marks again 263 | */ 264 | hideSearchWords : function() { 265 | $('#searchbox .highlight-link').fadeOut(300); 266 | $('span.highlighted').removeClass('highlighted'); 267 | }, 268 | 269 | /** 270 | * make the url absolute 271 | */ 272 | makeURL : function(relativeURL) { 273 | return DOCUMENTATION_OPTIONS.URL_ROOT + '/' + relativeURL; 274 | }, 275 | 276 | /** 277 | * get the current relative url 278 | */ 279 | getCurrentURL : function() { 280 | var path = document.location.pathname; 281 | var parts = path.split(/\//); 282 | $.each(DOCUMENTATION_OPTIONS.URL_ROOT.split(/\//), function() { 283 | if (this === '..') 284 | parts.pop(); 285 | }); 286 | var url = parts.join('/'); 287 | return path.substring(url.lastIndexOf('/') + 1, path.length - 1); 288 | }, 289 | 290 | initOnKeyListeners: function() { 291 | $(document).keydown(function(event) { 292 | var activeElementType = document.activeElement.tagName; 293 | // don't navigate when in search box, textarea, dropdown or button 294 | if (activeElementType !== 'TEXTAREA' && activeElementType !== 'INPUT' && activeElementType !== 'SELECT' 295 | && activeElementType !== 'BUTTON' && !event.altKey && !event.ctrlKey && !event.metaKey 296 | && !event.shiftKey) { 297 | switch (event.keyCode) { 298 | case 37: // left 299 | var prevHref = $('link[rel="prev"]').prop('href'); 300 | if (prevHref) { 301 | window.location.href = prevHref; 302 | return false; 303 | } 304 | break; 305 | case 39: // right 306 | var nextHref = $('link[rel="next"]').prop('href'); 307 | if (nextHref) { 308 | window.location.href = nextHref; 309 | return false; 310 | } 311 | break; 312 | } 313 | } 314 | }); 315 | } 316 | }; 317 | 318 | // quick alias for translations 319 | _ = Documentation.gettext; 320 | 321 | $(document).ready(function() { 322 | Documentation.init(); 323 | }); 324 | -------------------------------------------------------------------------------- /docs/_static/documentation_options.js: -------------------------------------------------------------------------------- 1 | var DOCUMENTATION_OPTIONS = { 2 | URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'), 3 | VERSION: '1.1.0.20211129', 4 | LANGUAGE: 'None', 5 | COLLAPSE_INDEX: false, 6 | BUILDER: 'html', 7 | FILE_SUFFIX: '.html', 8 | LINK_SUFFIX: '.html', 9 | HAS_SOURCE: true, 10 | SOURCELINK_SUFFIX: '.txt', 11 | NAVIGATION_WITH_KEYS: false 12 | }; -------------------------------------------------------------------------------- /docs/_static/down-pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackingmaterials/rocketsled/294cdc370ad2fbca3475046f2122f0a6e0a33946/docs/_static/down-pressed.png -------------------------------------------------------------------------------- /docs/_static/down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackingmaterials/rocketsled/294cdc370ad2fbca3475046f2122f0a6e0a33946/docs/_static/down.png -------------------------------------------------------------------------------- /docs/_static/file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackingmaterials/rocketsled/294cdc370ad2fbca3475046f2122f0a6e0a33946/docs/_static/file.png -------------------------------------------------------------------------------- /docs/_static/fw.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackingmaterials/rocketsled/294cdc370ad2fbca3475046f2122f0a6e0a33946/docs/_static/fw.png -------------------------------------------------------------------------------- /docs/_static/intro figure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackingmaterials/rocketsled/294cdc370ad2fbca3475046f2122f0a6e0a33946/docs/_static/intro figure.png -------------------------------------------------------------------------------- /docs/_static/intro_figure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackingmaterials/rocketsled/294cdc370ad2fbca3475046f2122f0a6e0a33946/docs/_static/intro_figure.png -------------------------------------------------------------------------------- /docs/_static/language_data.js: -------------------------------------------------------------------------------- 1 | /* 2 | * language_data.js 3 | * ~~~~~~~~~~~~~~~~ 4 | * 5 | * This script contains the language-specific data used by searchtools.js, 6 | * namely the list of stopwords, stemmer, scorer and splitter. 7 | * 8 | * :copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS. 9 | * :license: BSD, see LICENSE for details. 10 | * 11 | */ 12 | 13 | var stopwords = ["a","and","are","as","at","be","but","by","for","if","in","into","is","it","near","no","not","of","on","or","such","that","the","their","then","there","these","they","this","to","was","will","with"]; 14 | 15 | 16 | /* Non-minified version is copied as a separate JS file, is available */ 17 | 18 | /** 19 | * Porter Stemmer 20 | */ 21 | var Stemmer = function() { 22 | 23 | var step2list = { 24 | ational: 'ate', 25 | tional: 'tion', 26 | enci: 'ence', 27 | anci: 'ance', 28 | izer: 'ize', 29 | bli: 'ble', 30 | alli: 'al', 31 | entli: 'ent', 32 | eli: 'e', 33 | ousli: 'ous', 34 | ization: 'ize', 35 | ation: 'ate', 36 | ator: 'ate', 37 | alism: 'al', 38 | iveness: 'ive', 39 | fulness: 'ful', 40 | ousness: 'ous', 41 | aliti: 'al', 42 | iviti: 'ive', 43 | biliti: 'ble', 44 | logi: 'log' 45 | }; 46 | 47 | var step3list = { 48 | icate: 'ic', 49 | ative: '', 50 | alize: 'al', 51 | iciti: 'ic', 52 | ical: 'ic', 53 | ful: '', 54 | ness: '' 55 | }; 56 | 57 | var c = "[^aeiou]"; // consonant 58 | var v = "[aeiouy]"; // vowel 59 | var C = c + "[^aeiouy]*"; // consonant sequence 60 | var V = v + "[aeiou]*"; // vowel sequence 61 | 62 | var mgr0 = "^(" + C + ")?" + V + C; // [C]VC... is m>0 63 | var meq1 = "^(" + C + ")?" + V + C + "(" + V + ")?$"; // [C]VC[V] is m=1 64 | var mgr1 = "^(" + C + ")?" + V + C + V + C; // [C]VCVC... is m>1 65 | var s_v = "^(" + C + ")?" + v; // vowel in stem 66 | 67 | this.stemWord = function (w) { 68 | var stem; 69 | var suffix; 70 | var firstch; 71 | var origword = w; 72 | 73 | if (w.length < 3) 74 | return w; 75 | 76 | var re; 77 | var re2; 78 | var re3; 79 | var re4; 80 | 81 | firstch = w.substr(0,1); 82 | if (firstch == "y") 83 | w = firstch.toUpperCase() + w.substr(1); 84 | 85 | // Step 1a 86 | re = /^(.+?)(ss|i)es$/; 87 | re2 = /^(.+?)([^s])s$/; 88 | 89 | if (re.test(w)) 90 | w = w.replace(re,"$1$2"); 91 | else if (re2.test(w)) 92 | w = w.replace(re2,"$1$2"); 93 | 94 | // Step 1b 95 | re = /^(.+?)eed$/; 96 | re2 = /^(.+?)(ed|ing)$/; 97 | if (re.test(w)) { 98 | var fp = re.exec(w); 99 | re = new RegExp(mgr0); 100 | if (re.test(fp[1])) { 101 | re = /.$/; 102 | w = w.replace(re,""); 103 | } 104 | } 105 | else if (re2.test(w)) { 106 | var fp = re2.exec(w); 107 | stem = fp[1]; 108 | re2 = new RegExp(s_v); 109 | if (re2.test(stem)) { 110 | w = stem; 111 | re2 = /(at|bl|iz)$/; 112 | re3 = new RegExp("([^aeiouylsz])\\1$"); 113 | re4 = new RegExp("^" + C + v + "[^aeiouwxy]$"); 114 | if (re2.test(w)) 115 | w = w + "e"; 116 | else if (re3.test(w)) { 117 | re = /.$/; 118 | w = w.replace(re,""); 119 | } 120 | else if (re4.test(w)) 121 | w = w + "e"; 122 | } 123 | } 124 | 125 | // Step 1c 126 | re = /^(.+?)y$/; 127 | if (re.test(w)) { 128 | var fp = re.exec(w); 129 | stem = fp[1]; 130 | re = new RegExp(s_v); 131 | if (re.test(stem)) 132 | w = stem + "i"; 133 | } 134 | 135 | // Step 2 136 | re = /^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/; 137 | if (re.test(w)) { 138 | var fp = re.exec(w); 139 | stem = fp[1]; 140 | suffix = fp[2]; 141 | re = new RegExp(mgr0); 142 | if (re.test(stem)) 143 | w = stem + step2list[suffix]; 144 | } 145 | 146 | // Step 3 147 | re = /^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/; 148 | if (re.test(w)) { 149 | var fp = re.exec(w); 150 | stem = fp[1]; 151 | suffix = fp[2]; 152 | re = new RegExp(mgr0); 153 | if (re.test(stem)) 154 | w = stem + step3list[suffix]; 155 | } 156 | 157 | // Step 4 158 | re = /^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/; 159 | re2 = /^(.+?)(s|t)(ion)$/; 160 | if (re.test(w)) { 161 | var fp = re.exec(w); 162 | stem = fp[1]; 163 | re = new RegExp(mgr1); 164 | if (re.test(stem)) 165 | w = stem; 166 | } 167 | else if (re2.test(w)) { 168 | var fp = re2.exec(w); 169 | stem = fp[1] + fp[2]; 170 | re2 = new RegExp(mgr1); 171 | if (re2.test(stem)) 172 | w = stem; 173 | } 174 | 175 | // Step 5 176 | re = /^(.+?)e$/; 177 | if (re.test(w)) { 178 | var fp = re.exec(w); 179 | stem = fp[1]; 180 | re = new RegExp(mgr1); 181 | re2 = new RegExp(meq1); 182 | re3 = new RegExp("^" + C + v + "[^aeiouwxy]$"); 183 | if (re.test(stem) || (re2.test(stem) && !(re3.test(stem)))) 184 | w = stem; 185 | } 186 | re = /ll$/; 187 | re2 = new RegExp(mgr1); 188 | if (re.test(w) && re2.test(w)) { 189 | re = /.$/; 190 | w = w.replace(re,""); 191 | } 192 | 193 | // and turn initial Y back to y 194 | if (firstch == "y") 195 | w = firstch.toLowerCase() + w.substr(1); 196 | return w; 197 | } 198 | } 199 | 200 | 201 | 202 | 203 | var splitChars = (function() { 204 | var result = {}; 205 | var singles = [96, 180, 187, 191, 215, 247, 749, 885, 903, 907, 909, 930, 1014, 1648, 206 | 1748, 1809, 2416, 2473, 2481, 2526, 2601, 2609, 2612, 2615, 2653, 2702, 207 | 2706, 2729, 2737, 2740, 2857, 2865, 2868, 2910, 2928, 2948, 2961, 2971, 208 | 2973, 3085, 3089, 3113, 3124, 3213, 3217, 3241, 3252, 3295, 3341, 3345, 209 | 3369, 3506, 3516, 3633, 3715, 3721, 3736, 3744, 3748, 3750, 3756, 3761, 210 | 3781, 3912, 4239, 4347, 4681, 4695, 4697, 4745, 4785, 4799, 4801, 4823, 211 | 4881, 5760, 5901, 5997, 6313, 7405, 8024, 8026, 8028, 8030, 8117, 8125, 212 | 8133, 8181, 8468, 8485, 8487, 8489, 8494, 8527, 11311, 11359, 11687, 11695, 213 | 11703, 11711, 11719, 11727, 11735, 12448, 12539, 43010, 43014, 43019, 43587, 214 | 43696, 43713, 64286, 64297, 64311, 64317, 64319, 64322, 64325, 65141]; 215 | var i, j, start, end; 216 | for (i = 0; i < singles.length; i++) { 217 | result[singles[i]] = true; 218 | } 219 | var ranges = [[0, 47], [58, 64], [91, 94], [123, 169], [171, 177], [182, 184], [706, 709], 220 | [722, 735], [741, 747], [751, 879], [888, 889], [894, 901], [1154, 1161], 221 | [1318, 1328], [1367, 1368], [1370, 1376], [1416, 1487], [1515, 1519], [1523, 1568], 222 | [1611, 1631], [1642, 1645], [1750, 1764], [1767, 1773], [1789, 1790], [1792, 1807], 223 | [1840, 1868], [1958, 1968], [1970, 1983], [2027, 2035], [2038, 2041], [2043, 2047], 224 | [2070, 2073], [2075, 2083], [2085, 2087], [2089, 2307], [2362, 2364], [2366, 2383], 225 | [2385, 2391], [2402, 2405], [2419, 2424], [2432, 2436], [2445, 2446], [2449, 2450], 226 | [2483, 2485], [2490, 2492], [2494, 2509], [2511, 2523], [2530, 2533], [2546, 2547], 227 | [2554, 2564], [2571, 2574], [2577, 2578], [2618, 2648], [2655, 2661], [2672, 2673], 228 | [2677, 2692], [2746, 2748], [2750, 2767], [2769, 2783], [2786, 2789], [2800, 2820], 229 | [2829, 2830], [2833, 2834], [2874, 2876], [2878, 2907], [2914, 2917], [2930, 2946], 230 | [2955, 2957], [2966, 2968], [2976, 2978], [2981, 2983], [2987, 2989], [3002, 3023], 231 | [3025, 3045], [3059, 3076], [3130, 3132], [3134, 3159], [3162, 3167], [3170, 3173], 232 | [3184, 3191], [3199, 3204], [3258, 3260], [3262, 3293], [3298, 3301], [3312, 3332], 233 | [3386, 3388], [3390, 3423], [3426, 3429], [3446, 3449], [3456, 3460], [3479, 3481], 234 | [3518, 3519], [3527, 3584], [3636, 3647], [3655, 3663], [3674, 3712], [3717, 3718], 235 | [3723, 3724], [3726, 3731], [3752, 3753], [3764, 3772], [3774, 3775], [3783, 3791], 236 | [3802, 3803], [3806, 3839], [3841, 3871], [3892, 3903], [3949, 3975], [3980, 4095], 237 | [4139, 4158], [4170, 4175], [4182, 4185], [4190, 4192], [4194, 4196], [4199, 4205], 238 | [4209, 4212], [4226, 4237], [4250, 4255], [4294, 4303], [4349, 4351], [4686, 4687], 239 | [4702, 4703], [4750, 4751], [4790, 4791], [4806, 4807], [4886, 4887], [4955, 4968], 240 | [4989, 4991], [5008, 5023], [5109, 5120], [5741, 5742], [5787, 5791], [5867, 5869], 241 | [5873, 5887], [5906, 5919], [5938, 5951], [5970, 5983], [6001, 6015], [6068, 6102], 242 | [6104, 6107], [6109, 6111], [6122, 6127], [6138, 6159], [6170, 6175], [6264, 6271], 243 | [6315, 6319], [6390, 6399], [6429, 6469], [6510, 6511], [6517, 6527], [6572, 6592], 244 | [6600, 6607], [6619, 6655], [6679, 6687], [6741, 6783], [6794, 6799], [6810, 6822], 245 | [6824, 6916], [6964, 6980], [6988, 6991], [7002, 7042], [7073, 7085], [7098, 7167], 246 | [7204, 7231], [7242, 7244], [7294, 7400], [7410, 7423], [7616, 7679], [7958, 7959], 247 | [7966, 7967], [8006, 8007], [8014, 8015], [8062, 8063], [8127, 8129], [8141, 8143], 248 | [8148, 8149], [8156, 8159], [8173, 8177], [8189, 8303], [8306, 8307], [8314, 8318], 249 | [8330, 8335], [8341, 8449], [8451, 8454], [8456, 8457], [8470, 8472], [8478, 8483], 250 | [8506, 8507], [8512, 8516], [8522, 8525], [8586, 9311], [9372, 9449], [9472, 10101], 251 | [10132, 11263], [11493, 11498], [11503, 11516], [11518, 11519], [11558, 11567], 252 | [11622, 11630], [11632, 11647], [11671, 11679], [11743, 11822], [11824, 12292], 253 | [12296, 12320], [12330, 12336], [12342, 12343], [12349, 12352], [12439, 12444], 254 | [12544, 12548], [12590, 12592], [12687, 12689], [12694, 12703], [12728, 12783], 255 | [12800, 12831], [12842, 12880], [12896, 12927], [12938, 12976], [12992, 13311], 256 | [19894, 19967], [40908, 40959], [42125, 42191], [42238, 42239], [42509, 42511], 257 | [42540, 42559], [42592, 42593], [42607, 42622], [42648, 42655], [42736, 42774], 258 | [42784, 42785], [42889, 42890], [42893, 43002], [43043, 43055], [43062, 43071], 259 | [43124, 43137], [43188, 43215], [43226, 43249], [43256, 43258], [43260, 43263], 260 | [43302, 43311], [43335, 43359], [43389, 43395], [43443, 43470], [43482, 43519], 261 | [43561, 43583], [43596, 43599], [43610, 43615], [43639, 43641], [43643, 43647], 262 | [43698, 43700], [43703, 43704], [43710, 43711], [43715, 43738], [43742, 43967], 263 | [44003, 44015], [44026, 44031], [55204, 55215], [55239, 55242], [55292, 55295], 264 | [57344, 63743], [64046, 64047], [64110, 64111], [64218, 64255], [64263, 64274], 265 | [64280, 64284], [64434, 64466], [64830, 64847], [64912, 64913], [64968, 65007], 266 | [65020, 65135], [65277, 65295], [65306, 65312], [65339, 65344], [65371, 65381], 267 | [65471, 65473], [65480, 65481], [65488, 65489], [65496, 65497]]; 268 | for (i = 0; i < ranges.length; i++) { 269 | start = ranges[i][0]; 270 | end = ranges[i][1]; 271 | for (j = start; j <= end; j++) { 272 | result[j] = true; 273 | } 274 | } 275 | return result; 276 | })(); 277 | 278 | function splitQuery(query) { 279 | var result = []; 280 | var start = -1; 281 | for (var i = 0; i < query.length; i++) { 282 | if (splitChars[query.charCodeAt(i)]) { 283 | if (start !== -1) { 284 | result.push(query.slice(start, i)); 285 | start = -1; 286 | } 287 | } else if (start === -1) { 288 | start = i; 289 | } 290 | } 291 | if (start !== -1) { 292 | result.push(query.slice(start)); 293 | } 294 | return result; 295 | } 296 | 297 | 298 | -------------------------------------------------------------------------------- /docs/_static/logo-big.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackingmaterials/rocketsled/294cdc370ad2fbca3475046f2122f0a6e0a33946/docs/_static/logo-big.png -------------------------------------------------------------------------------- /docs/_static/logo-med.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackingmaterials/rocketsled/294cdc370ad2fbca3475046f2122f0a6e0a33946/docs/_static/logo-med.png -------------------------------------------------------------------------------- /docs/_static/logo-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackingmaterials/rocketsled/294cdc370ad2fbca3475046f2122f0a6e0a33946/docs/_static/logo-small.png -------------------------------------------------------------------------------- /docs/_static/miniwf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackingmaterials/rocketsled/294cdc370ad2fbca3475046f2122f0a6e0a33946/docs/_static/miniwf.png -------------------------------------------------------------------------------- /docs/_static/minus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackingmaterials/rocketsled/294cdc370ad2fbca3475046f2122f0a6e0a33946/docs/_static/minus.png -------------------------------------------------------------------------------- /docs/_static/ml.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackingmaterials/rocketsled/294cdc370ad2fbca3475046f2122f0a6e0a33946/docs/_static/ml.png -------------------------------------------------------------------------------- /docs/_static/multiobj_fws.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackingmaterials/rocketsled/294cdc370ad2fbca3475046f2122f0a6e0a33946/docs/_static/multiobj_fws.png -------------------------------------------------------------------------------- /docs/_static/multiobj_log.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackingmaterials/rocketsled/294cdc370ad2fbca3475046f2122f0a6e0a33946/docs/_static/multiobj_log.png -------------------------------------------------------------------------------- /docs/_static/multiple_wf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackingmaterials/rocketsled/294cdc370ad2fbca3475046f2122f0a6e0a33946/docs/_static/multiple_wf.png -------------------------------------------------------------------------------- /docs/_static/nature.css: -------------------------------------------------------------------------------- 1 | /* 2 | * nature.css_t 3 | * ~~~~~~~~~~~~ 4 | * 5 | * Sphinx stylesheet -- nature theme. 6 | * 7 | * :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. 8 | * :license: BSD, see LICENSE for details. 9 | * 10 | */ 11 | 12 | @import url("basic.css"); 13 | /* -- page layout ----------------------------------------------------------- */ 14 | 15 | body { 16 | font-family: "Lato", sans-serif; 17 | font-size: 100%; 18 | background-color: #eee; 19 | color: #555; 20 | margin: 0; 21 | padding: 0; 22 | } 23 | 24 | div.documentwrapper { 25 | float: left; 26 | width: 100%; 27 | } 28 | 29 | div.bodywrapper { 30 | margin: 0 0 0 230px; 31 | } 32 | 33 | hr { 34 | border: 1px solid #B1B4B6; 35 | } 36 | 37 | div.document { 38 | /* the light gray behind Show Source and Quick search box*/ 39 | background-color: #eee; 40 | } 41 | 42 | div.body { 43 | /* The background of the main document*/ 44 | background-color: #ffffff; 45 | 46 | /* Color of text in main document*/ 47 | color: #000000; 48 | padding: 0 30px 30px 30px; 49 | font-size: 0.95em; 50 | max-width: 1200px 51 | 52 | } 53 | 54 | div.footer { 55 | background: none repeat scroll 0 0 #eeeeee; 56 | color: #555; 57 | width: 100%; 58 | padding: 13px 0; 59 | text-align: center; 60 | font-size: 75%; 61 | } 62 | 63 | div.footer a { 64 | /* Color of Sphinx logo in footer*/ 65 | color: #F86709; 66 | /*text-decoration: underline;*/ 67 | } 68 | 69 | div.related { 70 | background-color: #E54C00; 71 | line-height: 32px; 72 | color: #fff; 73 | text-shadow: 0px 1px 0 #444; 74 | font-size: 0.9em; 75 | } 76 | 77 | div.related a { 78 | color: #fff; 79 | } 80 | 81 | div.sphinxsidebar { 82 | font-size: 0.9em; 83 | line-height: 1.5em; 84 | max-width: 400px; 85 | 86 | } 87 | 88 | div.sphinxsidebarwrapper{ 89 | padding: 20px 0; 90 | max-width: 400px; 91 | } 92 | 93 | div.sphinxsidebar h3, 94 | div.sphinxsidebar h4 { 95 | font-family: Arial, sans-serif; 96 | color: #222; 97 | font-size: 1.2em; 98 | font-weight: normal; 99 | margin: 0; 100 | padding: 5px 10px; 101 | background-color: #ddd; 102 | text-shadow: 1px 1px 0 white 103 | } 104 | 105 | div.sphinxsidebar h4{ 106 | font-size: 1.1em; 107 | } 108 | 109 | div.sphinxsidebar h3 a { 110 | color: #444; 111 | } 112 | 113 | 114 | div.sphinxsidebar p { 115 | color: #888; 116 | padding: 5px 20px; 117 | } 118 | 119 | div.sphinxsidebar p.topless { 120 | } 121 | 122 | div.sphinxsidebar ul { 123 | margin: 10px 20px; 124 | padding: 0; 125 | color: #000; 126 | } 127 | 128 | div.sphinxsidebar a { 129 | color: #444; 130 | } 131 | 132 | div.sphinxsidebar input { 133 | border: 1px solid #ccc; 134 | font-family: sans-serif; 135 | font-size: 1em; 136 | } 137 | 138 | div.sphinxsidebar input[type=text]{ 139 | margin-left: 20px; 140 | } 141 | 142 | /* -- body styles ----------------------------------------------------------- */ 143 | 144 | a { 145 | color: #E54C00; 146 | text-decoration: none; 147 | } 148 | 149 | a:hover { 150 | color: #E32E00; 151 | text-decoration: underline; 152 | } 153 | 154 | div.body h1, 155 | div.body h4, 156 | div.body h5, 157 | div.body h6 { 158 | font-family: "Lato", sans-serif; 159 | background-color: #E54C00; 160 | font-weight: normal; 161 | color: #fff; 162 | margin: 30px 0px 10px 0px; 163 | padding: 5px 0 5px 10px; 164 | text-shadow: 0px 0px 0 black 165 | } 166 | 167 | div.body h1 { border-top: 20px ; margin-top: 0; font-size: 185%; ; font-family: "Helvetica", serif} 168 | div.body h2 { font-size: 130%; color: #E54C00; font-family: "Helvetica", serif} 169 | div.body h3 { font-size: 130%; color: #446; font-family: "Palatino", serif} 170 | div.body h4 { font-size: 110%; background-color: #E54C00; } 171 | div.body h5 { font-size: 100%; background-color: #E54C00; } 172 | div.body h6 { font-size: 100%; background-color: #E54C00; } 173 | 174 | a.headerlink { 175 | color: #fff; 176 | font-size: 0.8em; 177 | padding: 0 4px 0 4px; 178 | text-decoration: none; 179 | } 180 | 181 | a.headerlink:hover { 182 | background-color: #E54C00; 183 | color: white; 184 | } 185 | 186 | div.body p, div.body dd, div.body li { 187 | line-height: 1.5em; 188 | } 189 | 190 | div.admonition p.admonition-title + p { 191 | display: inline; 192 | } 193 | 194 | div.highlight{ 195 | background-color: white; 196 | } 197 | 198 | div.note { 199 | background-color: #eee; 200 | border: 1px solid #ccc; 201 | } 202 | 203 | div.seealso { 204 | background-color: #ffc; 205 | border: 1px solid #ff6; 206 | } 207 | 208 | div.topic { 209 | background-color: #eee; 210 | } 211 | 212 | div.warning { 213 | background-color: #ffe4e4; 214 | border: 1px solid #f66; 215 | } 216 | 217 | p.admonition-title { 218 | display: inline; 219 | } 220 | 221 | p.admonition-title:after { 222 | content: ":"; 223 | } 224 | 225 | pre { 226 | padding: 10px; 227 | background-color: White; 228 | color: #222; 229 | line-height: 1.2em; 230 | border: 1px solid #C6C9CB; 231 | font-size: 1.1em; 232 | margin: 1.5em 0 1.5em 0; 233 | -webkit-box-shadow: 1px 1px 1px #d8d8d8; 234 | -moz-box-shadow: 1px 1px 1px #d8d8d8; 235 | } 236 | 237 | tt { 238 | background-color: #ecf0f3; 239 | color: #222; 240 | /* padding: 1px 2px; */ 241 | font-size: 1.1em; 242 | font-family: monospace; 243 | } 244 | 245 | h2 tt { 246 | color: #fff 247 | } 248 | 249 | .viewcode-back { 250 | font-family: Arial, sans-serif; 251 | } 252 | 253 | div.viewcode-block:target { 254 | background-color: #f4debf; 255 | border-top: 1px solid #ac9; 256 | border-bottom: 1px solid #ac9; 257 | } 258 | 259 | p.caption { 260 | font-family: Times, serif; 261 | font-weight: bold; 262 | } 263 | 264 | .pull-quote { 265 | color: #555; 266 | font-family: "Palatino", serif; 267 | font-size: 90%; 268 | background-color: #eee; 269 | width: 100%; 270 | padding: 10px 10px; 271 | } -------------------------------------------------------------------------------- /docs/_static/opt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackingmaterials/rocketsled/294cdc370ad2fbca3475046f2122f0a6e0a33946/docs/_static/opt.png -------------------------------------------------------------------------------- /docs/_static/opt_basic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackingmaterials/rocketsled/294cdc370ad2fbca3475046f2122f0a6e0a33946/docs/_static/opt_basic.png -------------------------------------------------------------------------------- /docs/_static/opttask_overview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackingmaterials/rocketsled/294cdc370ad2fbca3475046f2122f0a6e0a33946/docs/_static/opttask_overview.png -------------------------------------------------------------------------------- /docs/_static/perovskites_zoomin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackingmaterials/rocketsled/294cdc370ad2fbca3475046f2122f0a6e0a33946/docs/_static/perovskites_zoomin.png -------------------------------------------------------------------------------- /docs/_static/plus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackingmaterials/rocketsled/294cdc370ad2fbca3475046f2122f0a6e0a33946/docs/_static/plus.png -------------------------------------------------------------------------------- /docs/_static/progression.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackingmaterials/rocketsled/294cdc370ad2fbca3475046f2122f0a6e0a33946/docs/_static/progression.png -------------------------------------------------------------------------------- /docs/_static/pygments.css: -------------------------------------------------------------------------------- 1 | .highlight .hll { background-color: #ffffcc } 2 | .highlight { background: #eeffcc; } 3 | .highlight .c { color: #408090; font-style: italic } /* Comment */ 4 | .highlight .err { border: 1px solid #FF0000 } /* Error */ 5 | .highlight .k { color: #007020; font-weight: bold } /* Keyword */ 6 | .highlight .o { color: #666666 } /* Operator */ 7 | .highlight .ch { color: #408090; font-style: italic } /* Comment.Hashbang */ 8 | .highlight .cm { color: #408090; font-style: italic } /* Comment.Multiline */ 9 | .highlight .cp { color: #007020 } /* Comment.Preproc */ 10 | .highlight .cpf { color: #408090; font-style: italic } /* Comment.PreprocFile */ 11 | .highlight .c1 { color: #408090; font-style: italic } /* Comment.Single */ 12 | .highlight .cs { color: #408090; background-color: #fff0f0 } /* Comment.Special */ 13 | .highlight .gd { color: #A00000 } /* Generic.Deleted */ 14 | .highlight .ge { font-style: italic } /* Generic.Emph */ 15 | .highlight .gr { color: #FF0000 } /* Generic.Error */ 16 | .highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */ 17 | .highlight .gi { color: #00A000 } /* Generic.Inserted */ 18 | .highlight .go { color: #333333 } /* Generic.Output */ 19 | .highlight .gp { color: #c65d09; font-weight: bold } /* Generic.Prompt */ 20 | .highlight .gs { font-weight: bold } /* Generic.Strong */ 21 | .highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */ 22 | .highlight .gt { color: #0044DD } /* Generic.Traceback */ 23 | .highlight .kc { color: #007020; font-weight: bold } /* Keyword.Constant */ 24 | .highlight .kd { color: #007020; font-weight: bold } /* Keyword.Declaration */ 25 | .highlight .kn { color: #007020; font-weight: bold } /* Keyword.Namespace */ 26 | .highlight .kp { color: #007020 } /* Keyword.Pseudo */ 27 | .highlight .kr { color: #007020; font-weight: bold } /* Keyword.Reserved */ 28 | .highlight .kt { color: #902000 } /* Keyword.Type */ 29 | .highlight .m { color: #208050 } /* Literal.Number */ 30 | .highlight .s { color: #4070a0 } /* Literal.String */ 31 | .highlight .na { color: #4070a0 } /* Name.Attribute */ 32 | .highlight .nb { color: #007020 } /* Name.Builtin */ 33 | .highlight .nc { color: #0e84b5; font-weight: bold } /* Name.Class */ 34 | .highlight .no { color: #60add5 } /* Name.Constant */ 35 | .highlight .nd { color: #555555; font-weight: bold } /* Name.Decorator */ 36 | .highlight .ni { color: #d55537; font-weight: bold } /* Name.Entity */ 37 | .highlight .ne { color: #007020 } /* Name.Exception */ 38 | .highlight .nf { color: #06287e } /* Name.Function */ 39 | .highlight .nl { color: #002070; font-weight: bold } /* Name.Label */ 40 | .highlight .nn { color: #0e84b5; font-weight: bold } /* Name.Namespace */ 41 | .highlight .nt { color: #062873; font-weight: bold } /* Name.Tag */ 42 | .highlight .nv { color: #bb60d5 } /* Name.Variable */ 43 | .highlight .ow { color: #007020; font-weight: bold } /* Operator.Word */ 44 | .highlight .w { color: #bbbbbb } /* Text.Whitespace */ 45 | .highlight .mb { color: #208050 } /* Literal.Number.Bin */ 46 | .highlight .mf { color: #208050 } /* Literal.Number.Float */ 47 | .highlight .mh { color: #208050 } /* Literal.Number.Hex */ 48 | .highlight .mi { color: #208050 } /* Literal.Number.Integer */ 49 | .highlight .mo { color: #208050 } /* Literal.Number.Oct */ 50 | .highlight .sa { color: #4070a0 } /* Literal.String.Affix */ 51 | .highlight .sb { color: #4070a0 } /* Literal.String.Backtick */ 52 | .highlight .sc { color: #4070a0 } /* Literal.String.Char */ 53 | .highlight .dl { color: #4070a0 } /* Literal.String.Delimiter */ 54 | .highlight .sd { color: #4070a0; font-style: italic } /* Literal.String.Doc */ 55 | .highlight .s2 { color: #4070a0 } /* Literal.String.Double */ 56 | .highlight .se { color: #4070a0; font-weight: bold } /* Literal.String.Escape */ 57 | .highlight .sh { color: #4070a0 } /* Literal.String.Heredoc */ 58 | .highlight .si { color: #70a0d0; font-style: italic } /* Literal.String.Interpol */ 59 | .highlight .sx { color: #c65d09 } /* Literal.String.Other */ 60 | .highlight .sr { color: #235388 } /* Literal.String.Regex */ 61 | .highlight .s1 { color: #4070a0 } /* Literal.String.Single */ 62 | .highlight .ss { color: #517918 } /* Literal.String.Symbol */ 63 | .highlight .bp { color: #007020 } /* Name.Builtin.Pseudo */ 64 | .highlight .fm { color: #06287e } /* Name.Function.Magic */ 65 | .highlight .vc { color: #bb60d5 } /* Name.Variable.Class */ 66 | .highlight .vg { color: #bb60d5 } /* Name.Variable.Global */ 67 | .highlight .vi { color: #bb60d5 } /* Name.Variable.Instance */ 68 | .highlight .vm { color: #bb60d5 } /* Name.Variable.Magic */ 69 | .highlight .il { color: #208050 } /* Literal.Number.Integer.Long */ -------------------------------------------------------------------------------- /docs/_static/quickstart_lp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackingmaterials/rocketsled/294cdc370ad2fbca3475046f2122f0a6e0a33946/docs/_static/quickstart_lp.png -------------------------------------------------------------------------------- /docs/_static/quickstart_viz1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackingmaterials/rocketsled/294cdc370ad2fbca3475046f2122f0a6e0a33946/docs/_static/quickstart_viz1.png -------------------------------------------------------------------------------- /docs/_static/rsfwdiagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackingmaterials/rocketsled/294cdc370ad2fbca3475046f2122f0a6e0a33946/docs/_static/rsfwdiagram.png -------------------------------------------------------------------------------- /docs/_static/rsfwicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackingmaterials/rocketsled/294cdc370ad2fbca3475046f2122f0a6e0a33946/docs/_static/rsfwicon.png -------------------------------------------------------------------------------- /docs/_static/rslogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackingmaterials/rocketsled/294cdc370ad2fbca3475046f2122f0a6e0a33946/docs/_static/rslogo.png -------------------------------------------------------------------------------- /docs/_static/server.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackingmaterials/rocketsled/294cdc370ad2fbca3475046f2122f0a6e0a33946/docs/_static/server.png -------------------------------------------------------------------------------- /docs/_static/singlewf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackingmaterials/rocketsled/294cdc370ad2fbca3475046f2122f0a6e0a33946/docs/_static/singlewf.png -------------------------------------------------------------------------------- /docs/_static/singlewf_withrs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackingmaterials/rocketsled/294cdc370ad2fbca3475046f2122f0a6e0a33946/docs/_static/singlewf_withrs.png -------------------------------------------------------------------------------- /docs/_static/up-pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackingmaterials/rocketsled/294cdc370ad2fbca3475046f2122f0a6e0a33946/docs/_static/up-pressed.png -------------------------------------------------------------------------------- /docs/_static/up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackingmaterials/rocketsled/294cdc370ad2fbca3475046f2122f0a6e0a33946/docs/_static/up.png -------------------------------------------------------------------------------- /docs/modules.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | rocketsled — rocketsled 1.1.0.20211129 documentation 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 34 | 35 |
36 | 81 | 102 |
103 |
104 | 117 | 118 | 122 | 123 | 124 | -------------------------------------------------------------------------------- /docs/objects.inv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackingmaterials/rocketsled/294cdc370ad2fbca3475046f2122f0a6e0a33946/docs/objects.inv -------------------------------------------------------------------------------- /docs/py-modindex.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Python Module Index — rocketsled 1.1.0.20211129 documentation 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 37 | 38 |
39 |
40 |
41 |
42 | 43 | 44 |

Python Module Index

45 | 46 |
47 | r 48 |
49 | 50 | 51 | 52 | 54 | 55 | 57 | 60 | 61 | 62 | 65 | 66 | 67 | 70 | 71 | 72 | 75 | 76 | 77 | 80 | 81 | 82 | 85 | 86 | 87 | 90 | 91 | 92 | 95 | 96 | 97 | 100 | 101 | 102 | 105 | 106 | 107 | 110 | 111 | 112 | 115 | 116 | 117 | 120 |
 
53 | r
58 | rocketsled 59 |
    63 | rocketsled.acq 64 |
    68 | rocketsled.control 69 |
    73 | rocketsled.examples 74 |
    78 | rocketsled.examples.basic 79 |
    83 | rocketsled.examples.batch 84 |
    88 | rocketsled.examples.complex 89 |
    93 | rocketsled.task 94 |
    98 | rocketsled.tests 99 |
    103 | rocketsled.tests.deserialize_func 104 |
    108 | rocketsled.tests.test_task 109 |
    113 | rocketsled.tests.test_utils 114 |
    118 | rocketsled.utils 119 |
121 | 122 | 123 |
124 |
125 |
126 |
127 | 141 |
142 |
143 | 156 | 157 | 161 | 162 | 163 | -------------------------------------------------------------------------------- /docs/rocketsled.auto_sleds.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | rocketsled.auto_sleds package — rocketsled 1.1 documentation 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 34 | 35 |
36 |
37 |
38 |
39 | 40 |
41 |

rocketsled.auto_sleds package

42 |
43 |

Submodules

44 |
45 |
46 |

rocketsled.auto_sleds.convert module

47 |
48 |
49 |

rocketsled.auto_sleds.hardness module

50 |
51 |
52 |

rocketsled.auto_sleds.hardnessgp module

53 |
54 |
55 |

rocketsled.auto_sleds.pskites_gp module

56 |
57 |
58 |

rocketsled.auto_sleds.pskites_rf module

59 |
60 |
61 |

rocketsled.auto_sleds.pskites_rfz module

62 |
63 |
64 |

rocketsled.auto_sleds.pskites_rfz_ep module

65 |
66 |
67 |

rocketsled.auto_sleds.pskites_rfzc module

68 |
69 |
70 |

rocketsled.auto_sleds.pskites_rfzc_ep module

71 |
72 |
73 |

rocketsled.auto_sleds.quickstart module

74 |
75 |
76 |

rocketsled.auto_sleds.quickstart_2018-12-07-02-06-02-617273 module

77 |
78 |
79 |

Module contents

80 |
81 |
82 | 83 | 84 |
85 |
86 |
87 | 130 |
131 |
132 | 144 | 145 | 149 | 150 | 151 | -------------------------------------------------------------------------------- /docs/rocketsled.benchmarks.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | rocketsled.benchmarks package — rocketsled 1.0 documentation 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 34 | 35 |
36 |
37 |
38 |
39 | 40 |
41 |

rocketsled.benchmarks package

42 |
43 |

Submodules

44 |
45 |
46 |

rocketsled.benchmarks.auto_for_bench module

47 |
48 |
49 |

rocketsled.benchmarks.benchmarker module

50 |
51 |
52 |

rocketsled.benchmarks.rastrigin module

53 |
54 |
55 |

rocketsled.benchmarks.rbopttest module

56 |
57 |
58 |

rocketsled.benchmarks.rmcols module

59 |
60 |
61 |

rocketsled.benchmarks.skopttest module

62 |
63 |
64 |

Module contents

65 |
66 |
67 | 68 | 69 |
70 |
71 |
72 | 110 |
111 |
112 | 124 | 125 | 129 | 130 | 131 | -------------------------------------------------------------------------------- /docs/search.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Search — rocketsled 1.1.0.20211129 documentation 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 40 | 41 |
42 |
43 |
44 |
45 | 46 |

Search

47 | 48 | 56 | 57 | 58 |

59 | Searching for multiple words only shows matches that contain 60 | all words. 61 |

62 | 63 | 64 |
65 | 66 | 67 | 68 |
69 | 70 | 71 | 72 |
73 | 74 |
75 | 76 | 77 |
78 |
79 |
80 |
81 | 85 |
86 |
87 | 100 | 101 | 105 | 106 | 107 | -------------------------------------------------------------------------------- /docs_rst/Makefile: -------------------------------------------------------------------------------- 1 | # Makefile for Sphinx documentation 2 | # 3 | 4 | # You can set these variables from the command line. 5 | SPHINXOPTS = 6 | SPHINXBUILD = sphinx-build 7 | PAPER = 8 | BUILDDIR = ../docs 9 | 10 | # Internal variables. 11 | PAPEROPT_a4 = -D latex_paper_size=a4 12 | PAPEROPT_letter = -D latex_paper_size=letter 13 | ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . 14 | # the i18n builder cannot share the environment and doctrees with the others 15 | I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . 16 | 17 | .PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext 18 | 19 | help: 20 | @echo "Please use \`make ' where is one of" 21 | @echo " html to make standalone HTML files" 22 | @echo " dirhtml to make HTML files named index.html in directories" 23 | @echo " singlehtml to make a single large HTML file" 24 | @echo " pickle to make pickle files" 25 | @echo " json to make JSON files" 26 | @echo " htmlhelp to make HTML files and a HTML help project" 27 | @echo " qthelp to make HTML files and a qthelp project" 28 | @echo " devhelp to make HTML files and a Devhelp project" 29 | @echo " epub to make an epub" 30 | @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" 31 | @echo " latexpdf to make LaTeX files and run them through pdflatex" 32 | @echo " text to make text files" 33 | @echo " man to make manual pages" 34 | @echo " texinfo to make Texinfo files" 35 | @echo " info to make Texinfo files and run them through makeinfo" 36 | @echo " gettext to make PO message catalogs" 37 | @echo " changes to make an overview of all changed/added/deprecated items" 38 | @echo " linkcheck to check all external links for integrity" 39 | @echo " doctest to run all doctests embedded in the documentation (if enabled)" 40 | 41 | clean: 42 | -rm -rf $(BUILDDIR)/* 43 | 44 | html: 45 | $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html 46 | @echo 47 | @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." 48 | 49 | dirhtml: 50 | $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml 51 | @echo 52 | @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." 53 | 54 | singlehtml: 55 | $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml 56 | @echo 57 | @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." 58 | 59 | pickle: 60 | $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle 61 | @echo 62 | @echo "Build finished; now you can process the pickle files." 63 | 64 | json: 65 | $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json 66 | @echo 67 | @echo "Build finished; now you can process the JSON files." 68 | 69 | htmlhelp: 70 | $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp 71 | @echo 72 | @echo "Build finished; now you can run HTML Help Workshop with the" \ 73 | ".hhp project file in $(BUILDDIR)/htmlhelp." 74 | 75 | qthelp: 76 | $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp 77 | @echo 78 | @echo "Build finished; now you can run "qcollectiongenerator" with the" \ 79 | ".qhcp project file in $(BUILDDIR)/qthelp, like this:" 80 | @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/FireWorks.qhcp" 81 | @echo "To view the help file:" 82 | @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/FireWorks.qhc" 83 | 84 | devhelp: 85 | $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp 86 | @echo 87 | @echo "Build finished." 88 | @echo "To view the help file:" 89 | @echo "# mkdir -p $$HOME/.local/share/devhelp/FireWorks" 90 | @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/FireWorks" 91 | @echo "# devhelp" 92 | 93 | epub: 94 | $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub 95 | @echo 96 | @echo "Build finished. The epub file is in $(BUILDDIR)/epub." 97 | 98 | latex: 99 | $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex 100 | @echo 101 | @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." 102 | @echo "Run \`make' in that directory to run these through (pdf)latex" \ 103 | "(use \`make latexpdf' here to do that automatically)." 104 | 105 | latexpdf: 106 | $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex 107 | @echo "Running LaTeX files through pdflatex..." 108 | $(MAKE) -C $(BUILDDIR)/latex all-pdf 109 | @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." 110 | 111 | text: 112 | $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text 113 | @echo 114 | @echo "Build finished. The text files are in $(BUILDDIR)/text." 115 | 116 | man: 117 | $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man 118 | @echo 119 | @echo "Build finished. The manual pages are in $(BUILDDIR)/man." 120 | 121 | texinfo: 122 | $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo 123 | @echo 124 | @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." 125 | @echo "Run \`make' in that directory to run these through makeinfo" \ 126 | "(use \`make info' here to do that automatically)." 127 | 128 | info: 129 | $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo 130 | @echo "Running Texinfo files through makeinfo..." 131 | make -C $(BUILDDIR)/texinfo info 132 | @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo." 133 | 134 | gettext: 135 | $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale 136 | @echo 137 | @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale." 138 | 139 | changes: 140 | $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes 141 | @echo 142 | @echo "The overview file is in $(BUILDDIR)/changes." 143 | 144 | linkcheck: 145 | $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck 146 | @echo 147 | @echo "Link check complete; look for any errors in the above output " \ 148 | "or in $(BUILDDIR)/linkcheck/output.txt." 149 | 150 | doctest: 151 | $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest 152 | @echo "Testing of doctests in the sources finished, look at the " \ 153 | "results in $(BUILDDIR)/doctest/output.txt." 154 | -------------------------------------------------------------------------------- /docs_rst/_static/3dmap_mend.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackingmaterials/rocketsled/294cdc370ad2fbca3475046f2122f0a6e0a33946/docs_rst/_static/3dmap_mend.png -------------------------------------------------------------------------------- /docs_rst/_static/Comparison.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackingmaterials/rocketsled/294cdc370ad2fbca3475046f2122f0a6e0a33946/docs_rst/_static/Comparison.png -------------------------------------------------------------------------------- /docs_rst/_static/WC_structure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackingmaterials/rocketsled/294cdc370ad2fbca3475046f2122f0a6e0a33946/docs_rst/_static/WC_structure.png -------------------------------------------------------------------------------- /docs_rst/_static/basic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackingmaterials/rocketsled/294cdc370ad2fbca3475046f2122f0a6e0a33946/docs_rst/_static/basic.png -------------------------------------------------------------------------------- /docs_rst/_static/basic_viz.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackingmaterials/rocketsled/294cdc370ad2fbca3475046f2122f0a6e0a33946/docs_rst/_static/basic_viz.png -------------------------------------------------------------------------------- /docs_rst/_static/batch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackingmaterials/rocketsled/294cdc370ad2fbca3475046f2122f0a6e0a33946/docs_rst/_static/batch.png -------------------------------------------------------------------------------- /docs_rst/_static/diagram_fireworks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackingmaterials/rocketsled/294cdc370ad2fbca3475046f2122f0a6e0a33946/docs_rst/_static/diagram_fireworks.png -------------------------------------------------------------------------------- /docs_rst/_static/diagram_highthroughput.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackingmaterials/rocketsled/294cdc370ad2fbca3475046f2122f0a6e0a33946/docs_rst/_static/diagram_highthroughput.png -------------------------------------------------------------------------------- /docs_rst/_static/diagram_highthroughput2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackingmaterials/rocketsled/294cdc370ad2fbca3475046f2122f0a6e0a33946/docs_rst/_static/diagram_highthroughput2.png -------------------------------------------------------------------------------- /docs_rst/_static/fw.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackingmaterials/rocketsled/294cdc370ad2fbca3475046f2122f0a6e0a33946/docs_rst/_static/fw.png -------------------------------------------------------------------------------- /docs_rst/_static/intro_figure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackingmaterials/rocketsled/294cdc370ad2fbca3475046f2122f0a6e0a33946/docs_rst/_static/intro_figure.png -------------------------------------------------------------------------------- /docs_rst/_static/logo-big.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackingmaterials/rocketsled/294cdc370ad2fbca3475046f2122f0a6e0a33946/docs_rst/_static/logo-big.png -------------------------------------------------------------------------------- /docs_rst/_static/logo-med.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackingmaterials/rocketsled/294cdc370ad2fbca3475046f2122f0a6e0a33946/docs_rst/_static/logo-med.png -------------------------------------------------------------------------------- /docs_rst/_static/logo-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackingmaterials/rocketsled/294cdc370ad2fbca3475046f2122f0a6e0a33946/docs_rst/_static/logo-small.png -------------------------------------------------------------------------------- /docs_rst/_static/miniwf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackingmaterials/rocketsled/294cdc370ad2fbca3475046f2122f0a6e0a33946/docs_rst/_static/miniwf.png -------------------------------------------------------------------------------- /docs_rst/_static/ml.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackingmaterials/rocketsled/294cdc370ad2fbca3475046f2122f0a6e0a33946/docs_rst/_static/ml.png -------------------------------------------------------------------------------- /docs_rst/_static/multiobj_fws.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackingmaterials/rocketsled/294cdc370ad2fbca3475046f2122f0a6e0a33946/docs_rst/_static/multiobj_fws.png -------------------------------------------------------------------------------- /docs_rst/_static/multiobj_log.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackingmaterials/rocketsled/294cdc370ad2fbca3475046f2122f0a6e0a33946/docs_rst/_static/multiobj_log.png -------------------------------------------------------------------------------- /docs_rst/_static/multiple_wf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackingmaterials/rocketsled/294cdc370ad2fbca3475046f2122f0a6e0a33946/docs_rst/_static/multiple_wf.png -------------------------------------------------------------------------------- /docs_rst/_static/nature.css: -------------------------------------------------------------------------------- 1 | /* 2 | * nature.css_t 3 | * ~~~~~~~~~~~~ 4 | * 5 | * Sphinx stylesheet -- nature theme. 6 | * 7 | * :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. 8 | * :license: BSD, see LICENSE for details. 9 | * 10 | */ 11 | 12 | @import url("basic.css"); 13 | /* -- page layout ----------------------------------------------------------- */ 14 | 15 | body { 16 | font-family: "Lato", sans-serif; 17 | font-size: 100%; 18 | background-color: #eee; 19 | color: #555; 20 | margin: 0; 21 | padding: 0; 22 | } 23 | 24 | div.documentwrapper { 25 | float: left; 26 | width: 100%; 27 | } 28 | 29 | div.bodywrapper { 30 | margin: 0 0 0 230px; 31 | } 32 | 33 | hr { 34 | border: 1px solid #B1B4B6; 35 | } 36 | 37 | div.document { 38 | /* the light gray behind Show Source and Quick search box*/ 39 | background-color: #eee; 40 | } 41 | 42 | div.body { 43 | /* The background of the main document*/ 44 | background-color: #ffffff; 45 | 46 | /* Color of text in main document*/ 47 | color: #000000; 48 | padding: 0 30px 30px 30px; 49 | font-size: 0.95em; 50 | max-width: 1200px 51 | 52 | } 53 | 54 | div.footer { 55 | background: none repeat scroll 0 0 #eeeeee; 56 | color: #555; 57 | width: 100%; 58 | padding: 13px 0; 59 | text-align: center; 60 | font-size: 75%; 61 | } 62 | 63 | div.footer a { 64 | /* Color of Sphinx logo in footer*/ 65 | color: #F86709; 66 | /*text-decoration: underline;*/ 67 | } 68 | 69 | div.related { 70 | background-color: #E54C00; 71 | line-height: 32px; 72 | color: #fff; 73 | text-shadow: 0px 1px 0 #444; 74 | font-size: 0.9em; 75 | } 76 | 77 | div.related a { 78 | color: #fff; 79 | } 80 | 81 | div.sphinxsidebar { 82 | font-size: 0.9em; 83 | line-height: 1.5em; 84 | max-width: 400px; 85 | 86 | } 87 | 88 | div.sphinxsidebarwrapper{ 89 | padding: 20px 0; 90 | max-width: 400px; 91 | } 92 | 93 | div.sphinxsidebar h3, 94 | div.sphinxsidebar h4 { 95 | font-family: Arial, sans-serif; 96 | color: #222; 97 | font-size: 1.2em; 98 | font-weight: normal; 99 | margin: 0; 100 | padding: 5px 10px; 101 | background-color: #ddd; 102 | text-shadow: 1px 1px 0 white 103 | } 104 | 105 | div.sphinxsidebar h4{ 106 | font-size: 1.1em; 107 | } 108 | 109 | div.sphinxsidebar h3 a { 110 | color: #444; 111 | } 112 | 113 | 114 | div.sphinxsidebar p { 115 | color: #888; 116 | padding: 5px 20px; 117 | } 118 | 119 | div.sphinxsidebar p.topless { 120 | } 121 | 122 | div.sphinxsidebar ul { 123 | margin: 10px 20px; 124 | padding: 0; 125 | color: #000; 126 | } 127 | 128 | div.sphinxsidebar a { 129 | color: #444; 130 | } 131 | 132 | div.sphinxsidebar input { 133 | border: 1px solid #ccc; 134 | font-family: sans-serif; 135 | font-size: 1em; 136 | } 137 | 138 | div.sphinxsidebar input[type=text]{ 139 | margin-left: 20px; 140 | } 141 | 142 | /* -- body styles ----------------------------------------------------------- */ 143 | 144 | a { 145 | color: #E54C00; 146 | text-decoration: none; 147 | } 148 | 149 | a:hover { 150 | color: #E32E00; 151 | text-decoration: underline; 152 | } 153 | 154 | div.body h1, 155 | div.body h4, 156 | div.body h5, 157 | div.body h6 { 158 | font-family: "Lato", sans-serif; 159 | background-color: #E54C00; 160 | font-weight: normal; 161 | color: #fff; 162 | margin: 30px 0px 10px 0px; 163 | padding: 5px 0 5px 10px; 164 | text-shadow: 0px 0px 0 black 165 | } 166 | 167 | div.body h1 { border-top: 20px ; margin-top: 0; font-size: 185%; ; font-family: "Helvetica", serif} 168 | div.body h2 { font-size: 130%; color: #E54C00; font-family: "Helvetica", serif} 169 | div.body h3 { font-size: 130%; color: #446; font-family: "Palatino", serif} 170 | div.body h4 { font-size: 110%; background-color: #E54C00; } 171 | div.body h5 { font-size: 100%; background-color: #E54C00; } 172 | div.body h6 { font-size: 100%; background-color: #E54C00; } 173 | 174 | a.headerlink { 175 | color: #fff; 176 | font-size: 0.8em; 177 | padding: 0 4px 0 4px; 178 | text-decoration: none; 179 | } 180 | 181 | a.headerlink:hover { 182 | background-color: #E54C00; 183 | color: white; 184 | } 185 | 186 | div.body p, div.body dd, div.body li { 187 | line-height: 1.5em; 188 | } 189 | 190 | div.admonition p.admonition-title + p { 191 | display: inline; 192 | } 193 | 194 | div.highlight{ 195 | background-color: white; 196 | } 197 | 198 | div.note { 199 | background-color: #eee; 200 | border: 1px solid #ccc; 201 | } 202 | 203 | div.seealso { 204 | background-color: #ffc; 205 | border: 1px solid #ff6; 206 | } 207 | 208 | div.topic { 209 | background-color: #eee; 210 | } 211 | 212 | div.warning { 213 | background-color: #ffe4e4; 214 | border: 1px solid #f66; 215 | } 216 | 217 | p.admonition-title { 218 | display: inline; 219 | } 220 | 221 | p.admonition-title:after { 222 | content: ":"; 223 | } 224 | 225 | pre { 226 | padding: 10px; 227 | background-color: White; 228 | color: #222; 229 | line-height: 1.2em; 230 | border: 1px solid #C6C9CB; 231 | font-size: 1.1em; 232 | margin: 1.5em 0 1.5em 0; 233 | -webkit-box-shadow: 1px 1px 1px #d8d8d8; 234 | -moz-box-shadow: 1px 1px 1px #d8d8d8; 235 | } 236 | 237 | tt { 238 | background-color: #ecf0f3; 239 | color: #222; 240 | /* padding: 1px 2px; */ 241 | font-size: 1.1em; 242 | font-family: monospace; 243 | } 244 | 245 | h2 tt { 246 | color: #fff 247 | } 248 | 249 | .viewcode-back { 250 | font-family: Arial, sans-serif; 251 | } 252 | 253 | div.viewcode-block:target { 254 | background-color: #f4debf; 255 | border-top: 1px solid #ac9; 256 | border-bottom: 1px solid #ac9; 257 | } 258 | 259 | p.caption { 260 | font-family: Times, serif; 261 | font-weight: bold; 262 | } 263 | 264 | .pull-quote { 265 | color: #555; 266 | font-family: "Palatino", serif; 267 | font-size: 90%; 268 | background-color: #eee; 269 | width: 100%; 270 | padding: 10px 10px; 271 | } -------------------------------------------------------------------------------- /docs_rst/_static/opt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackingmaterials/rocketsled/294cdc370ad2fbca3475046f2122f0a6e0a33946/docs_rst/_static/opt.png -------------------------------------------------------------------------------- /docs_rst/_static/opt_basic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackingmaterials/rocketsled/294cdc370ad2fbca3475046f2122f0a6e0a33946/docs_rst/_static/opt_basic.png -------------------------------------------------------------------------------- /docs_rst/_static/opttask_overview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackingmaterials/rocketsled/294cdc370ad2fbca3475046f2122f0a6e0a33946/docs_rst/_static/opttask_overview.png -------------------------------------------------------------------------------- /docs_rst/_static/perovskites_zoomin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackingmaterials/rocketsled/294cdc370ad2fbca3475046f2122f0a6e0a33946/docs_rst/_static/perovskites_zoomin.png -------------------------------------------------------------------------------- /docs_rst/_static/progression.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackingmaterials/rocketsled/294cdc370ad2fbca3475046f2122f0a6e0a33946/docs_rst/_static/progression.png -------------------------------------------------------------------------------- /docs_rst/_static/quickstart_lp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackingmaterials/rocketsled/294cdc370ad2fbca3475046f2122f0a6e0a33946/docs_rst/_static/quickstart_lp.png -------------------------------------------------------------------------------- /docs_rst/_static/quickstart_viz1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackingmaterials/rocketsled/294cdc370ad2fbca3475046f2122f0a6e0a33946/docs_rst/_static/quickstart_viz1.png -------------------------------------------------------------------------------- /docs_rst/_static/rsfwdiagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackingmaterials/rocketsled/294cdc370ad2fbca3475046f2122f0a6e0a33946/docs_rst/_static/rsfwdiagram.png -------------------------------------------------------------------------------- /docs_rst/_static/rsfwicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackingmaterials/rocketsled/294cdc370ad2fbca3475046f2122f0a6e0a33946/docs_rst/_static/rsfwicon.png -------------------------------------------------------------------------------- /docs_rst/_static/rslogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackingmaterials/rocketsled/294cdc370ad2fbca3475046f2122f0a6e0a33946/docs_rst/_static/rslogo.png -------------------------------------------------------------------------------- /docs_rst/_static/server.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackingmaterials/rocketsled/294cdc370ad2fbca3475046f2122f0a6e0a33946/docs_rst/_static/server.png -------------------------------------------------------------------------------- /docs_rst/_templates/layout.html: -------------------------------------------------------------------------------- 1 | {% extends "!layout.html" %} 2 | 3 | {%- block extrahead %} 4 | {{ super() }} 5 | 6 | {% endblock %} 7 | 8 | {% block footer %} 9 | {{ super() }} 10 | {% endblock %} -------------------------------------------------------------------------------- /docs_rst/advanced.rst: -------------------------------------------------------------------------------- 1 | *Tutorial 2 requires some knowledge of Fireworks. If you aren't comfortable with Fireworks, please work through the tutorials* `here `_. 2 | 3 | ======================================= 4 | Advanced Tutorial - 15-20 min 5 | ======================================= 6 | 7 | **Real optimization problems are messy**; often, there is a mixture of continuous (floating point), 8 | discrete (integer), and categorical dimensions which specify the search domain. The search space may be discontinuous, where only certain combinations of inputs are allowed. 9 | The objective function might have multiple, competing 10 | objectives to optimize. It may be unclear which predictors - that is, the 11 | algorithms that use previous inputs and outputs to suggest the next guess - will be effective, and whether their 12 | training or prediction itself be computationally prohibitive. Furthermore, the way we label points for human 13 | interpretation might have little use for prediction, but features derived from these labels might be very useful for learning. 14 | 15 | OptTask has optional arguments which address each of these issues. A few are listed here, and the rest are in the comprehensive guide. For the most part, they are designed to work both in combination and independently. 16 | 17 | In this tutorial, we will explore some of the more advanced capabilities of OptTask, including: 18 | 19 | * Multiobjective optimiation 20 | * Changing predictors 21 | + Acquisition functions for improving performance 22 | + Reducing prediction time 23 | + Customizing exploration 24 | * Using z (extra) features 25 | 26 | 27 | Defining the Problem 28 | --------------------- 29 | Let's imagine we are designing a fin for a new rocket. **We have three parameters we can tune**: 30 | 31 | * Fin length - Defined between 16cm - 145cm 32 | * Fin angle - Defined between 0.0 - 90.0 degrees 33 | * Fin type - Either industry standard, dolphin, or shark type. 34 | 35 | **We'll say a good fin has 3 characteristics (objective metrics)**: 36 | 37 | * Low cost 38 | * Low drag 39 | * Low probability of failure 40 | 41 | We evaluate the performance of a candidate design by nondeterministically simulating the aerodynamics and market performance with an expensive simulation. 42 | A mock version of such a simulation is found in :code:`ComplexMultiObjTask` in :code:`/examples/tasks.py`. 43 | 44 | Creating the Workflow 45 | --------------------- 46 | 47 | The workflow we are creating is two Fireworks; one containing the simulation, and one containing OptTask. 48 | 49 | .. image:: _static/multiobj_fws.png 50 | :alt: mutliobj_fws 51 | :width: 800px 52 | :align: center 53 | 54 | 55 | The y written to the spec by the simulation firework is a list, not a scalar as in previous examples. OptTask will automatically consider this a multi-objective optimization. 56 | 57 | Note that **OptTask can go anywhere in your workflow as long as it can read _x and _y from the spec!** 58 | *In this example, the first firework passes the required _x and _y keys to the optimization firework with the FWAction update_spec arg.* 59 | 60 | The code we use to define the workflow creator is similar to that found in the quickstart and basic tutorials: 61 | 62 | 63 | .. code-block:: python 64 | 65 | from fireworks.core.rocket_launcher import rapidfire 66 | from fireworks import Workflow, Firework, LaunchPad 67 | from rocketsled import OptTask 68 | from rocketsled.examples.tasks import ComplexMultiObjTask 69 | 70 | 71 | def wf_creator(x): 72 | X_dim = [(16, 145), (0.0, 90.0), ["industry standard", "shark fin", "dolphin fin"]] 73 | simulation = Firework([ComplexMultiObjTask()], spec={'_x': x}, name="simulation") 74 | optimization = Firework([OptTask(wf_creator='rocketsled.examples.complex.wf_creator', 75 | dimensions=X_dim, 76 | host='localhost', 77 | port=27017, 78 | opt_label="opt_complex", 79 | acq="maximin", 80 | predictor="GaussianProcessRegressor", 81 | get_z='rocketsled.examples.complex.get_z', 82 | name='rsled')], 83 | name="optimization") 84 | return Workflow([simulation, optimization], {simulation: optimization}) 85 | 86 | def get_z(x): 87 | fin_len = x[0] 88 | fin_angle = x[1] 89 | useful_feature1 = fin_len + fin_angle ** 2 90 | useful_feature2 = fin_angle + fin_len 91 | return x + [useful_feature1, useful_feature2] 92 | 93 | The new arguments to OptTask are: 94 | 95 | * :code:`predictor` - A different built in predictor is used for this optimization. A full list of builtin predictors (and guide for using custom predictors) is shown in the comprehensive guide. 96 | * :code:`acq` - Acquisition functions help us get better results during optimization (generally) than pure exploitation, but may be more computationally intensive. The acquisition function used here is specifically for multi-objective optimization; for single objectives, check the comprehensive guide. 97 | * :code:`n_searchpts` - Tuning the number of points for prediction affects optimizer performance and computational efficiency (the two are often inversely correlated). Also use :code:`n_trainpts` to restrict the number of points used for training from completed runs. 98 | * :code:`get_z` - Encapsulate empirical knowledge with get_z. From physical laws, we postulate two useful features, which we put in a vector called "z". When :code:`get_z` is enabled, x is only used as a label (**not for learning**), unless explicitly returned by get_z. In this case, x might be useful for learning, so we'll return it. 99 | 100 | We can launch 250 optimization loop runs with: 101 | 102 | .. code-block:: python 103 | 104 | def run_workflows(): 105 | TESTDB_NAME = 'rsled' 106 | launchpad = LaunchPad(name=TESTDB_NAME) 107 | launchpad.reset(password=None, require_password=False) 108 | launchpad.add_wf(wf_creator([60, 45.0, "industry standard"])) 109 | rapidfire(launchpad, nlaunches=500, sleep_time=0) 110 | 111 | if __name__ == "__main__": 112 | run_workflows() 113 | 114 | 115 | Examining results 116 | ----------------------------- 117 | 118 | .. code-block:: python 119 | 120 | from fireworks import LaunchPad 121 | from rocketsled import visualize 122 | 123 | lpad = LaunchPad(host='localhost', port=27017, name='rsled') 124 | visualize(lpad.db.opt_complex, print_pareto=True, scale='log', showmean=False) 125 | 126 | There is some useful stdout produced by :code:`visualize`, including a complete list of the optimal objective value points (meaning non-dominated in any given objective), also known as the **Pareto Frontier**. 127 | The points on the Pareto frontier need not have the minimum values for any one of the objectives; however, the absolute best found values for each objective are shown as well. 128 | 129 | .. code-block:: bash 130 | 131 | min(f(x)) objective 0 is 2.4716663906 at x = [16, 0.9794468723495431, u'industry standard'] 132 | min(f(x)) objective 1 is 3.74337173135 at x = [16, 0.06040480720271191, u'dolphin fin'] 133 | min(f(x)) objective 2 is 0.0104429576126 at x = [142, 1.2608356066742255, u'industry standard'] 134 | 135 | Problem dimension: 136 | * X dimensions (3): [, , ] 137 | * Z dimensions (5): [, , , , ] 138 | Only Z data is being used for learning. 139 | Number of Optimizations: 250 140 | Optimizers used (by percentage of optimizations): 141 | * 100.00%: GaussianProcessRegressor with acquisition: Maximin Expected Improvement using 3 objectives 142 | Number of reserved guesses: 1 143 | Number of waiting optimizations: 0 144 | DB not locked by any process (no current optimization). 145 | 146 | Pareto Frontier: 30 points 147 | f(x) = [2.471666390596957, 27.48238986848395, 0.4448868032547827] @ x = [16, 0.9794468723495431, u'industry standard'] 148 | f(x) = [93.01859724025691, 1623.9392203207517, 0.11086881838942292] @ x = [116, 13.26932017507497, u'industry standard'] 149 | f(x) = [20.263988323874553, 405.15607152348605, 0.25007134344442905] @ x = [49, 6.227551501995968, u'shark fin'] 150 | f(x) = [12.127316307413249, 226.5705263013419, 0.28016039923073677] @ x = [37, 4.284994178298564, u'shark fin'] 151 | f(x) = [42.32583374856372, 394.0840359770293, 0.23860336541319574] @ x = [76, 3.3002668184681063, u'industry standard'] 152 | f(x) = [19.790663261912012, 700.4097477732201, 0.26463786067587647] @ x = [47, 15.546544052561718, u'shark fin'] 153 | f(x) = [10.2168227961067, 130.60557338489392, 0.2872835850667972] @ x = [34, 2.153086684368809, u'shark fin'] 154 | f(x) = [56.85262300070313, 436.41896887230035, 0.15027333987286837] @ x = [87, 2.429843874399414, u'shark fin'] 155 | f(x) = [72.38543355551161, 191.62631972759323, 0.22769551246826705] @ x = [79, 1.3306954053381337, u'dolphin fin'] 156 | f(x) = [36.08999149122292, 852.5869436000326, 0.2072757141556187] @ x = [67, 10.950527222513989, u'shark fin'] 157 | f(x) = [4.183289647037304, 34.99182801945318, 0.32071198427784786] @ x = [21, 0.6944844687799834, u'shark fin'] 158 | f(x) = [6.228008499929818, 67.91202551642581, 0.30783624358171] @ x = [26, 1.294856929696876, u'shark fin'] 159 | f(x) = [8.973748107281045, 39.19531111781273, 0.29224810030963994] @ x = [32, 0.3810165150936706, u'shark fin'] 160 | f(x) = [2.527642158007039, 15.702700032050892, 0.3336259028104275] @ x = [16, 0.3355654235898753, u'shark fin'] 161 | f(x) = [8.7308090242463, 142.19720382324883, 0.29521862570256696] @ x = [31, 2.906278222483265, u'shark fin'] 162 | f(x) = [126.20031698441441, 3019.484417324195, 0.05251518595418252] @ x = [133, 21.540269010022485, u'shark fin'] 163 | f(x) = [116.07496718360396, 1849.7972768675982, 0.05863417948265865] @ x = [131, 12.953946970009913, u'industry standard'] 164 | f(x) = [46.77918527129666, 1253.2940813234145, 0.186696724157924] @ x = [77, 15.29799176872524, u'shark fin'] 165 | f(x) = [88.88302026836072, 1918.8872308046193, 0.10128441729749994] @ x = [110, 15.250278680499424, u'shark fin'] 166 | f(x) = [7.710723548287516, 118.25680233360677, 0.30028408634821974] @ x = [29, 2.47714858689301, u'shark fin'] 167 | f(x) = [26.685736420234065, 850.9827854258534, 0.2408425996095338] @ x = [56, 15.18143648127198, u'shark fin'] 168 | f(x) = [2.8274978546887954, 18.72563173907369, 0.3310416362821108] @ x = [17, 0.3930853690817204, u'shark fin'] 169 | f(x) = [133.33546429969246, 445.1188547596248, 0.010442957612568495] @ x = [142, 1.2608356066742255, u'industry standard'] 170 | f(x) = [3.8076194945316377, 3.743371731347361, 0.44482781143780603] @ x = [16, 0.06040480720271191, u'dolphin fin'] 171 | f(x) = [76.14424925941366, 483.3414876831859, 0.11141517427055053] @ x = [102, 2.1210371818169915, u'shark fin'] 172 | f(x) = [67.71434523904519, 1284.663645968029, 0.13471025173127132] @ x = [95, 10.799906903283864, u'shark fin'] 173 | f(x) = [102.63207167405578, 874.4375707299264, 0.07717805945487849] @ x = [123, 4.617255237438416, u'industry standard'] 174 | f(x) = [60.94129655936235, 868.258686604232, 0.14422557214075377] @ x = [90, 6.546645334584239, u'shark fin'] 175 | f(x) = [75.7058035188604, 1397.80346543294, 0.11937654419706178] @ x = [101, 10.98190876732162, u'shark fin'] 176 | f(x) = [54.82841730962141, 909.1474088353508, 0.20529359285755197] @ x = [87, 9.260464582964612, u'industry standard'] 177 | 178 | 179 | .. image:: _static/multiobj_log.png 180 | :alt: mutliobj_log 181 | :width: 800px 182 | :align: center 183 | 184 | The parameters :code:`x=[21, 0.6945, 'shark fin']` give a Pareto-optimal output of :code:`f(x)=[4.18, 35.0, 0.32]`, which, while not optimal in any one metric, provide a robust compromise. 185 | 186 | 187 | See the :doc:`comprehensive guide ` for a full list of options and arguments to OptTask! -------------------------------------------------------------------------------- /docs_rst/basic.rst: -------------------------------------------------------------------------------- 1 | *Tutorial 1 requires some knowledge of Fireworks. If you aren't comfortable with Fireworks, please work through the tutorials* `here `_. 2 | 3 | ======================================= 4 | Basic Tutorial - 5-10 min 5 | ======================================= 6 | 7 | In the quickstart, we use auto_setup to put a Python function in a Firework and create an optimization loop, then launch it, run it, and examine the results. 8 | If evaluating your objective function is more complex, it is useful to put it in a FireWorks workflow, where individual parts of the expensive workflow can be handled more precisely. 9 | In this tutorial, we'll walk through setting up an optimization loop if you already have a workflow that evaluates your objective function. 10 | 11 | This tutorial can be found in :code:`rocketsled/examples/basic.py`. 12 | 13 | 14 | Overview 15 | -------- 16 | **What's the minimum I need to run a workflow?** 17 | 18 | Rocketsled is designed to be a "plug and play" framework, meaning "plug in" your workflow and search space. The requirements are: 19 | 20 | * **Workflow creator function**: takes in a vector of workflow input parameters :code:`x` and returns a Fireworks workflow based on those parameters, including optimization. Specified with the :code:`wf_creator` arg to OptTask. OptTask should be located somewhere in the workflow that :code:`wf_creator` returns. 21 | * **'_x' and '_y' fields in spec**: the parameters the workflow is run with and the output metric, in the spec of the Firework containing :code:`OptTask`. x must be a vector (list), and y can be a vector (list) or scalar (float). 22 | * **Dimensions of the search space**: A list of the spaces dimensions, where each dimension is defined by :code:`(higher, lower)` form (for float/ int) or ["a", "comprehensive", "list"] form for categories. Specified with the :code:`dimensions` argument to OptTask 23 | * **MongoDB collection to store data**: Each optimization problem should have its own collection. Specify with :code:`host`, :code:`port`, and :code:`name` arguments to OptTask, or with a Launchpad object (via :code:`lpad` arg to OptTask). 24 | 25 | 26 | Making a Workflow Function 27 | -------------------------- 28 | The easiest way to get started with rocketsled using your own workflows is to modify one of the examples. 29 | 30 | 31 | We are going to use a workflow containing one Firework and two tasks - a task that takes the sum of the input vector, and OptTask. 32 | Let's create a **workflow creator function**, the most important part. This function takes an input vector, and returns a workflow based on that vector. 33 | 34 | 35 | .. code-block:: python 36 | 37 | from fireworks.core.rocket_launcher import rapidfire 38 | from fireworks import Workflow, Firework, LaunchPad 39 | from rocketsled import OptTask 40 | from rocketsled.examples.tasks import SumTask 41 | 42 | # a workflow creator function which takes x and returns a workflow based on x 43 | def wf_creator(x): 44 | 45 | spec = {'_x':x} 46 | X_dim = [(1, 5), (1, 5), (1, 5)] 47 | 48 | # SumTask writes _y field to the spec internally. 49 | 50 | firework1 = Firework([SumTask(), 51 | OptTask(wf_creator='rocketsled.examples.basic.wf_creator', 52 | dimensions=X_dim, 53 | host='localhost', 54 | port=27017, 55 | name='rsled')], 56 | spec=spec) 57 | return Workflow([firework1]) 58 | 59 | 60 | We define the info OptTask needs by passing it keyword arguments. 61 | _________________________________________________________________ 62 | 63 | The required arguments are: 64 | 65 | * **wf_creator**: The full path to the workflow creator function. Can also be specified in non-module form, e.g., :code:`/my/path/to/module.py` 66 | * **dimensions**: The dimensions of your search space 67 | 68 | The remaining arguments define where we want to store the optimization data. The default optimization collection is :code:`opt_default`; you can change it with the :code:`opt_label` argument to OptTask. 69 | By default, OptTask minimizes your objective function. 70 | 71 | 72 | Launch! 73 | ------- 74 | To start the optimization, we run the code below, and we use the point :code:`[5, 5, 2]` as our initial guess. 75 | 76 | .. code-block:: python 77 | 78 | def run_workflows(): 79 | TESTDB_NAME = 'rsled' 80 | launchpad = LaunchPad(name=TESTDB_NAME) 81 | # launchpad.reset(password=None, require_password=False) 82 | launchpad.add_wf(wf_creator([5, 5, 2])) 83 | rapidfire(launchpad, nlaunches=10, sleep_time=0) 84 | 85 | if __name__ == "__main__": 86 | run_workflows() 87 | 88 | 89 | 90 | Visualize Results 91 | ----------------- 92 | .. code-block:: python 93 | 94 | from fireworks import LaunchPad 95 | from rocketsled import visualize 96 | 97 | lpad = LaunchPad(host='localhost', port=27017, name='rsled') 98 | visualize(lpad.db.opt_default) 99 | 100 | 101 | .. image:: _static/basic_viz.png 102 | :alt: basic_viz 103 | 104 | 105 | Great! We just ran 10 optimization loops using the default optimization procedure, minimizing our objective function workflow (just :code:`SumTask()` in this case). 106 | See the :doc:`guide ` to see the full capabilities of OptTask, the :doc:`advanced tutorial `, or the examples in the :code:`/examples` directory. -------------------------------------------------------------------------------- /docs_rst/conf.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # 3 | # Documentation build configuration file, created by 4 | # sphinx-quickstart on Fri Jan 11 16:36:11 2013. 5 | # 6 | # This file is execfile()d with the current directory set to its containing dir. 7 | # 8 | # Note that not all possible configuration values are present in this 9 | # autogenerated file. 10 | # 11 | # All configuration values have a default; values that are commented out 12 | # serve to show the default. 13 | 14 | import os 15 | import sys 16 | 17 | from rocketsled import __version__ 18 | 19 | # If extensions (or modules to document with autodoc) are in another directory, 20 | # add these directories to sys.path here. If the directory is relative to the 21 | # documentation root, use os.path.abspath to make it absolute, like shown here. 22 | sys.path.append(os.path.abspath('..')) 23 | # print sys.path 24 | 25 | # -- General configuration ----------------------------------------------------- 26 | 27 | # If your documentation needs a minimal Sphinx version, state it here. 28 | # needs_sphinx = '1.0' 29 | 30 | # Add any Sphinx extension module names here, as strings. They can be extensions 31 | # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. 32 | extensions = ['sphinx.ext.autodoc', 'sphinx.ext.doctest', 33 | 'sphinx.ext.intersphinx', 'sphinx.ext.todo', 34 | 'sphinx.ext.coverage', 'sphinx.ext.imgmath', 35 | 'sphinx.ext.ifconfig'] 36 | 37 | # Add any paths that contain templates here, relative to this directory. 38 | templates_path = ['_templates'] 39 | 40 | # The suffix of source filenames. 41 | source_suffix = '.rst' 42 | 43 | # The encoding of source files. 44 | # source_encoding = 'utf-8-sig' 45 | 46 | # The master toctree document. 47 | master_doc = 'index' 48 | 49 | # General information about the project. 50 | project = u'rocketsled' 51 | copyright = u'2018, HackingMaterials' 52 | 53 | # The version info for the project you're documenting, acts as replacement for 54 | # |version| and |release|, also used in various other places throughout the 55 | # built documents. 56 | # 57 | # The short X.Y version. 58 | version = __version__ 59 | # The full version, including alpha/beta/rc tags. 60 | release = __version__ 61 | 62 | # The language for content autogenerated by Sphinx. Refer to documentation 63 | # for a list of supported languages. 64 | # language = None 65 | 66 | # There are two options for replacing |today|: either, you set today to some 67 | # non-false value, then it is used: 68 | # today = '' 69 | # Else, today_fmt is used as the format for a strftime call. 70 | # today_fmt = '%B %d, %Y' 71 | 72 | # List of patterns, relative to source directory, that match files and 73 | # directories to ignore when looking for source files. 74 | exclude_patterns = ['_build'] 75 | 76 | # The reST default role (used for this markup: `text`) to use for all documents. 77 | # default_role = None 78 | 79 | # If true, '()' will be appended to :func: etc. cross-reference text. 80 | # add_function_parentheses = True 81 | 82 | # If true, the current module name will be prepended to all description 83 | # unit titles (such as .. function::). 84 | # add_module_names = True 85 | 86 | # If true, sectionauthor and moduleauthor directives will be shown in the 87 | # output. They are ignored by default. 88 | # show_authors = False 89 | 90 | # The name of the Pygments (syntax highlighting) style to use. 91 | pygments_style = 'sphinx' 92 | 93 | # A list of ignored prefixes for module index sorting. 94 | # modindex_common_prefix = [] 95 | 96 | 97 | # -- Options for HTML output --------------------------------------------------- 98 | 99 | # The theme to use for HTML and HTML Help pages. See the documentation for 100 | # a list of builtin themes. 101 | html_theme = 'nature' 102 | 103 | # Theme options are theme-specific and customize the look and feel of a theme 104 | # further. For a list of options available for each theme, see the 105 | # documentation. 106 | # html_theme_options = {'headerbordercolor': 'red', 'subheadlinecolor': 'white', 107 | # 'linkcolor': 'blue', 'visitedlinkcolor': 'purple', 'admonitioncolor': 'green'} 108 | 109 | # Add any paths that contain custom themes here, relative to this directory. 110 | # html_theme_path = [] 111 | 112 | # The name for this set of Sphinx documents. If None, it defaults to 113 | # " v documentation". 114 | # html_title = None 115 | 116 | # A shorter title for the navigation bar. Default is the same as html_title. 117 | # html_short_title = None 118 | 119 | # The name of an image file (relative to this directory) to place at the top 120 | # of the sidebar. 121 | # html_logo = None 122 | 123 | # The name of an image file (within the static path) to use as favicon of the 124 | # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 125 | # pixels large. 126 | # html_favicon = None 127 | 128 | # Add any paths that contain custom static files (such as style sheets) here, 129 | # relative to this directory. They are copied after the builtin static files, 130 | # so a file named "default.css" will overwrite the builtin "default.css". 131 | html_static_path = ['_static'] 132 | 133 | # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, 134 | # using the given strftime format. 135 | # html_last_updated_fmt = '%b %d, %Y' 136 | 137 | # If true, SmartyPants will be used to convert quotes and dashes to 138 | # typographically correct entities. 139 | # html_use_smartypants = True 140 | 141 | # Custom sidebar templates, maps document names to template names. 142 | # html_sidebars = {} 143 | 144 | # Additional templates that should be rendered to pages, maps page names to 145 | # template names. 146 | # html_additional_pages = {} 147 | 148 | # If false, no module index is generated. 149 | # html_domain_indices = True 150 | 151 | # If false, no index is generated. 152 | # html_use_index = True 153 | 154 | # If true, the index is split into individual pages for each letter. 155 | # html_split_index = False 156 | 157 | # If true, links to the reST sources are added to the pages. 158 | # html_show_sourcelink = True 159 | 160 | # If true, "Created using Sphinx" is shown in the HTML footer. Default is True. 161 | # html_show_sphinx = True 162 | 163 | # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. 164 | # html_show_copyright = True 165 | 166 | # If true, an OpenSearch description file will be output, and all pages will 167 | # contain a tag referring to it. The value of this option must be the 168 | # base URL from which the finished HTML is served. 169 | # html_use_opensearch = '' 170 | 171 | # This is the file name suffix for HTML files (e.g. ".xhtml"). 172 | # html_file_suffix = None 173 | 174 | # Output file base name for HTML help builder. 175 | htmlhelp_basename = 'FireWorksdoc' 176 | 177 | # -- Options for LaTeX output -------------------------------------------------- 178 | 179 | latex_elements = { 180 | # The paper size ('letterpaper' or 'a4paper'). 181 | # 'papersize': 'letterpaper', 182 | 183 | # The font size ('10pt', '11pt' or '12pt'). 184 | # 'pointsize': '10pt', 185 | 186 | # Additional stuff for the LaTeX preamble. 187 | # 'preamble': '', 188 | } 189 | 190 | # Grouping the document tree into LaTeX files. List of tuples 191 | # (source start file, target name, title, author, documentclass [howto/manual]). 192 | latex_documents = [ 193 | ('index', 'FireWorks.tex', u'FireWorks Documentation', 194 | u'Anubhav Jain', 'manual'), 195 | ] 196 | 197 | # The name of an image file (relative to this directory) to place at the top of 198 | # the title page. 199 | # latex_logo = None 200 | 201 | # For "manual" documents, if this is true, then toplevel headings are parts, 202 | # not chapters. 203 | # latex_use_parts = False 204 | 205 | # If true, show page references after internal links. 206 | # latex_show_pagerefs = False 207 | 208 | # If true, show URL addresses after external links. 209 | # latex_show_urls = False 210 | 211 | # Documents to append as an appendix to all manuals. 212 | # latex_appendices = [] 213 | 214 | # If false, no module index is generated. 215 | # latex_domain_indices = True 216 | 217 | 218 | # -- Options for manual page output -------------------------------------------- 219 | 220 | # One entry per manual page. List of tuples 221 | # (source start file, name, description, authors, manual section). 222 | man_pages = [ 223 | ('index', 'fireworks', u'FireWorks Documentation', 224 | [u'Anubhav Jain'], 1) 225 | ] 226 | 227 | # If true, show URL addresses after external links. 228 | # man_show_urls = False 229 | 230 | 231 | # -- Options for Texinfo output ------------------------------------------------ 232 | 233 | # Grouping the document tree into Texinfo files. List of tuples 234 | # (source start file, target name, title, author, 235 | # dir menu entry, description, category) 236 | texinfo_documents = [ 237 | ('index', 'rocketsled', u'rocketsled Documentation', 238 | u'HackingMaterials', 239 | 'rocketsled is a black box optimization framework for FireWorks workflow' 240 | ' software', 241 | 'Miscellaneous'), 242 | ] 243 | 244 | # Documents to append as an appendix to all manuals. 245 | # texinfo_appendices = [] 246 | 247 | # If false, no module index is generated. 248 | # texinfo_domain_indices = True 249 | 250 | # How to display URL addresses: 'footnote', 'no', or 'inline'. 251 | # texinfo_show_urls = 'footnote' 252 | 253 | 254 | # -- Options for Epub output --------------------------------------------------- 255 | 256 | # Bibliographic Dublin Core info. 257 | epub_title = u'rocketsled' 258 | epub_author = u'Alex Dunn' 259 | epub_publisher = u'HackingMaterials' 260 | epub_copyright = u'2018, HackingMaterials' 261 | 262 | # The language of the text. It defaults to the language option 263 | # or en if the language is not set. 264 | # epub_language = '' 265 | 266 | # The scheme of the identifier. Typical schemes are ISBN or URL. 267 | # epub_scheme = '' 268 | 269 | # The unique identifier of the text. This can be a ISBN number 270 | # or the project homepage. 271 | # epub_identifier = '' 272 | 273 | # A unique identification for the text. 274 | # epub_uid = '' 275 | 276 | # A tuple containing the cover image and cover page html template filenames. 277 | # epub_cover = () 278 | 279 | # HTML files that should be inserted before the pages created by sphinx. 280 | # The format is a list of tuples containing the path and title. 281 | # epub_pre_files = [] 282 | 283 | # HTML files shat should be inserted after the pages created by sphinx. 284 | # The format is a list of tuples containing the path and title. 285 | # epub_post_files = [] 286 | 287 | # A list of files that should not be packed into the epub file. 288 | # epub_exclude_files = [] 289 | 290 | # The depth of the table of contents in toc.ncx. 291 | # epub_tocdepth = 3 292 | 293 | # Allow duplicate toc entries. 294 | # epub_tocdup = True 295 | 296 | 297 | # Example configuration for intersphinx: refer to the Python standard library. 298 | intersphinx_mapping = {'http://docs.python.org/': None} 299 | 300 | 301 | # AJ: a hack found online to get __init__ to show up in docs 302 | def skip(app, what, name, obj, skip, options): 303 | if name == "__init__": 304 | return False 305 | return skip 306 | 307 | 308 | # AJ: a hack found online to get __init__ to show up in docs 309 | def setup(app): 310 | app.connect("autodoc-skip-member", skip) 311 | -------------------------------------------------------------------------------- /docs_rst/modules.rst: -------------------------------------------------------------------------------- 1 | rocketsled 2 | ========== 3 | 4 | .. toctree:: 5 | :maxdepth: 4 6 | 7 | rocketsled 8 | -------------------------------------------------------------------------------- /docs_rst/rocketsled.examples.rst: -------------------------------------------------------------------------------- 1 | rocketsled.examples package 2 | =========================== 3 | 4 | Submodules 5 | ---------- 6 | 7 | rocketsled.examples.basic module 8 | -------------------------------- 9 | 10 | .. automodule:: rocketsled.examples.basic 11 | :members: 12 | :undoc-members: 13 | :show-inheritance: 14 | 15 | rocketsled.examples.batch module 16 | -------------------------------- 17 | 18 | .. automodule:: rocketsled.examples.batch 19 | :members: 20 | :undoc-members: 21 | :show-inheritance: 22 | 23 | rocketsled.examples.complex module 24 | ---------------------------------- 25 | 26 | .. automodule:: rocketsled.examples.complex 27 | :members: 28 | :undoc-members: 29 | :show-inheritance: 30 | 31 | Module contents 32 | --------------- 33 | 34 | .. automodule:: rocketsled.examples 35 | :members: 36 | :undoc-members: 37 | :show-inheritance: 38 | -------------------------------------------------------------------------------- /docs_rst/rocketsled.rst: -------------------------------------------------------------------------------- 1 | rocketsled package 2 | ================== 3 | 4 | Subpackages 5 | ----------- 6 | 7 | .. toctree:: 8 | :maxdepth: 4 9 | 10 | rocketsled.examples 11 | rocketsled.tests 12 | 13 | Submodules 14 | ---------- 15 | 16 | rocketsled.acq module 17 | --------------------- 18 | 19 | .. automodule:: rocketsled.acq 20 | :members: 21 | :undoc-members: 22 | :show-inheritance: 23 | 24 | rocketsled.control module 25 | ------------------------- 26 | 27 | .. automodule:: rocketsled.control 28 | :members: 29 | :undoc-members: 30 | :show-inheritance: 31 | 32 | rocketsled.task module 33 | ---------------------- 34 | 35 | .. automodule:: rocketsled.task 36 | :members: 37 | :undoc-members: 38 | :show-inheritance: 39 | 40 | rocketsled.utils module 41 | ----------------------- 42 | 43 | .. automodule:: rocketsled.utils 44 | :members: 45 | :undoc-members: 46 | :show-inheritance: 47 | 48 | Module contents 49 | --------------- 50 | 51 | .. automodule:: rocketsled 52 | :members: 53 | :undoc-members: 54 | :show-inheritance: 55 | -------------------------------------------------------------------------------- /docs_rst/rocketsled.tests.rst: -------------------------------------------------------------------------------- 1 | rocketsled.tests package 2 | ======================== 3 | 4 | Submodules 5 | ---------- 6 | 7 | rocketsled.tests.deserialize\_func module 8 | ----------------------------------------- 9 | 10 | .. automodule:: rocketsled.tests.deserialize_func 11 | :members: 12 | :undoc-members: 13 | :show-inheritance: 14 | 15 | rocketsled.tests.test\_task module 16 | ---------------------------------- 17 | 18 | .. automodule:: rocketsled.tests.test_task 19 | :members: 20 | :undoc-members: 21 | :show-inheritance: 22 | 23 | rocketsled.tests.test\_utils module 24 | ----------------------------------- 25 | 26 | .. automodule:: rocketsled.tests.test_utils 27 | :members: 28 | :undoc-members: 29 | :show-inheritance: 30 | 31 | Module contents 32 | --------------- 33 | 34 | .. automodule:: rocketsled.tests 35 | :members: 36 | :undoc-members: 37 | :show-inheritance: 38 | -------------------------------------------------------------------------------- /pyproject.toml: -------------------------------------------------------------------------------- 1 | [tool.black] 2 | # Ensure this is the same value as max-line-length 3 | # under [flake8] in setup.cfg. 4 | line-length = 85 -------------------------------------------------------------------------------- /requirements-dev.txt: -------------------------------------------------------------------------------- 1 | invoke==1.4.1 2 | requests==2.23.0 3 | monty==2021.12.1 4 | black==21.11b1 5 | flake8==3.8.2 6 | isort==4.3.21 7 | pytest==6.2.5 8 | pytest-cov==3.0.0 9 | pylint==2.12.1 10 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | numpy==1.17.2 2 | scikit-learn==1.0.1 3 | scipy==1.7.1 4 | pymongo==3.10.1 5 | fireworks==1.9.7 6 | matplotlib==3.2.1 7 | joblib==1.0.1 -------------------------------------------------------------------------------- /rocketsled/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | Rocketsled is an optimization suite "on rails" based on Scikit-learn and 3 | FireWorks workflows. 4 | """ 5 | import os 6 | 7 | from rocketsled.control import MissionControl 8 | from rocketsled.task import OptTask 9 | 10 | __author__ = "Alexander Dunn" 11 | __email__ = "ardunn@lbl.gov" 12 | __version__ = "1.1.0.20211129" 13 | -------------------------------------------------------------------------------- /rocketsled/acq.py: -------------------------------------------------------------------------------- 1 | """ 2 | Acquisition functions and utilities. 3 | """ 4 | 5 | from copy import deepcopy 6 | from multiprocessing import cpu_count 7 | 8 | import numpy as np 9 | from joblib import Parallel, delayed 10 | from scipy.stats import norm 11 | from sklearn.model_selection import train_test_split 12 | 13 | __author__ = "Alexander Dunn" 14 | __email__ = "ardunn@lbl.gov" 15 | 16 | 17 | # def acquire(acq, X, Y, space, model, nstraps, return_means=False): 18 | # """ 19 | # A high level function for calculating acquisition values. Includes a 20 | # strategy for estimating mean values and uncertainty with bootstrapping; 21 | # Independently train with different sets of data, and predict over the same 22 | # space of unknown points. Assumes minimization! 23 | # 24 | # Args: 25 | # acq (str): The acquisition function ('ei', 'pi', or 'lcb') 26 | # X ([list]): A list of x vectors (inputs), for training. 27 | # Y (list): A list of scalars (outputs), for training. 28 | # space ([list]): A list of possible X vectors, yet to be explored. This 29 | # is the 'test' set. 30 | # model (BaseEstimator object): sklearn estimator object. Must have .fit 31 | # and .predict methods. 32 | # nstraps (int): The number of bootstrap samplings, with replacement, 33 | # which will be performed. This is also the number of regressor 34 | # fittings and predictions which will be performed. 35 | # return_means (bool): If True, also return the mean of the acquisition 36 | # function alongside the acquisition fucntion values. 37 | # 38 | # Returns: 39 | # (list) acquisition values for space. Higher acquisition values 40 | # correspond to better guesses. 41 | # """ 42 | # 43 | # if model.__class__.__name__ == "GaussianProcessRegressor": 44 | # model.fit(X, Y) 45 | # mu, std = model.predict(space, return_std=True) 46 | # else: 47 | # predicted = Parallel(n_jobs=cpu_count())( 48 | # delayed(ppredict)(X, Y, space, model) for _ in np.zeros(nstraps) 49 | # ) 50 | # mu = np.mean(predicted, axis=0) 51 | # std = np.std(predicted, axis=0) 52 | # 53 | # if acq == "ei": 54 | # acqf = ei 55 | # elif acq == "pi": 56 | # acqf = pi 57 | # elif acq == "lcb": 58 | # acqf = lcb 59 | # else: 60 | # raise ValueError("Unknown acquisition function: {}!".format(acq)) 61 | # 62 | # if return_means: 63 | # return acqf(min(Y), mu, std).tolist(), mu 64 | # else: 65 | # return acqf(min(Y), mu, std).tolist() 66 | 67 | 68 | def acquire(acq, Y, mu, std, return_means=False): 69 | if acq == "ei": 70 | acqf = ei 71 | elif acq == "pi": 72 | acqf = pi 73 | elif acq == "lcb": 74 | acqf = lcb 75 | else: 76 | raise ValueError("Unknown acquisition function: {}!".format(acq)) 77 | 78 | if return_means: 79 | return acqf(min(Y), mu, std).tolist(), mu 80 | else: 81 | return acqf(min(Y), mu, std).tolist() 82 | 83 | 84 | def predict(X, Y, space, model, nstraps): 85 | if model.__class__.__name__ == "GaussianProcessRegressor": 86 | model.fit(X, Y) 87 | mu, std = model.predict(space, return_std=True) 88 | else: 89 | predicted = Parallel(n_jobs=cpu_count())( 90 | delayed(ppredict)(X, Y, space, model) for _ in np.zeros(nstraps) 91 | ) 92 | mu = np.mean(predicted, axis=0) 93 | std = np.std(predicted, axis=0) 94 | 95 | return mu, std 96 | 97 | 98 | def ppredict(X, Y, space, model): 99 | """ 100 | Run a split and fit on a random subsample of the entire explored X. Use this 101 | fitted model to predict the remaining space. Meant to be run in parallel in 102 | combination with joblib's delayed and Parallel utilities. 103 | 104 | Args: 105 | X ([list]): A list of x vectors, for training. 106 | Y (list): A list of scalars, for training. 107 | space ([list]): A list of possible X vectors, yet to be explored. This 108 | is the 'test' set. 109 | model (BaseEstimator object): sklearn estimator object. Must have .fit 110 | and .predict methods. 111 | 112 | Returns: 113 | (numpy array): The 1-D array of predicted points for the entire 114 | remaining space. 115 | 116 | """ 117 | X_train, _, y_train, _ = train_test_split(X, Y, test_size=0.25) 118 | pmodel = deepcopy(model) 119 | pmodel.fit(X_train, y_train) 120 | return pmodel.predict(space) 121 | 122 | 123 | def ei(fmin, mu, std, xi=0.01): 124 | """ 125 | Returns expected improvement values. 126 | 127 | Args: 128 | fmin (float): Minimum value of the objective function known thus far. 129 | mu (numpy array): Mean value of bootstrapped predictions for each y. 130 | std (numpy array): Standard deviation of bootstrapped predictions for 131 | each y. 132 | xi (float): Amount of expected improvement, optional hyper-parameter. 133 | Default value taken from "Practical bayesian optimization" by Daniel 134 | Lizotte (2008). 135 | 136 | Returns: 137 | vals (numpy array): Acquisition values. 138 | 139 | """ 140 | vals = np.zeros_like(mu) 141 | mask = std > 0 142 | stdm = std[mask] 143 | improve = fmin - mu[mask] - xi 144 | vals[mask] = improve * norm.cdf(improve / stdm) + stdm * norm.pdf(improve / stdm) 145 | # improve = fmin - mu 146 | # vals = improve * norm.cdf(improve/std) + std * norm.pdf(improve/std) 147 | return vals 148 | 149 | 150 | def pi(fmin, mu, std, xi=0.01): 151 | """ 152 | Returns probability of improvement values. 153 | 154 | Args: 155 | fmin (float): Minimum value of the objective function known thus far. 156 | mu (numpy array): Mean value of bootstrapped predictions for each y. 157 | std (numpy array): Standard deviation of bootstrapped predictions for 158 | each y. 159 | xi (float): Amount of expected improvement, optional hyper-parameter. 160 | Default value taken from "Practical bayesian optimization" by Daniel 161 | Lizotte (2008). 162 | 163 | Returns: 164 | vals (numpy array): Acquisition values. 165 | 166 | """ 167 | vals = np.zeros_like(mu) 168 | mask = std > 0 169 | vals[mask] = norm.cdf((fmin - mu[mask] - xi) / std[mask]) 170 | return vals 171 | 172 | 173 | def lcb(fmin, mu, std, kappa=1.96): 174 | """ 175 | Returns lower confidence bound estimates. 176 | fmin (float): (not used): Minimum value of the objective function known 177 | thus far. 178 | mu (numpy array): Mean value of bootstrapped predictions for each y. 179 | std (numpy array): Standard deviation of bootstrapped predictions for 180 | each y. 181 | kappa (float): Controls the variance in the prediction, 182 | affecting exploration/exploitation. 183 | 184 | Returns: 185 | vals (numpy array): Acquisition values. 186 | """ 187 | return mu - kappa * std 188 | -------------------------------------------------------------------------------- /rocketsled/defaults.yaml: -------------------------------------------------------------------------------- 1 | # optimization data location 2 | launchpad: null 3 | opt_label: "opt_default" # name of the collection to use for storing opt data 4 | 5 | # wf_creator configuration 6 | wf_creator_args: null 7 | wf_creator_kwargs: null 8 | 9 | # predictor configuration 10 | predictor: "RandomForestRegressor" # builtin predictor name or full path to custom predictor 11 | predictor_args: null 12 | predictor_kwargs: null 13 | maximize: False # search for maxima instead of minima 14 | n_search_pts: 1000 # number of search points 15 | n_train_pts: null # number of train points (null is all) 16 | n_bootstraps: 500 # number of bootstraps for tree-based builtin predictors 17 | acq: "ei" # acquisition function 18 | space_file: null # define search space with a filepath 19 | onehot_categorical: False # for custom predictors only 20 | duplicate_check: False # for custom predictors only 21 | 22 | # z-vector parameters 23 | get_z: null # full path of the get_z function (e.g. my_pkg.my_module.my_get_z) 24 | get_z_args: null 25 | get_z_kwargs: null 26 | z_file: null # filepath to use to store the z_guesses, if evaluating z repeatedly is not inexpensive 27 | 28 | # parallelism 29 | enforce_sequential: True # handling parallelism of the optimization operations (not objective function execution) 30 | tolerances: null # for advanced duplicate checking 31 | batch_size: 1 # number of new workflows to launch in one batch 32 | timeout: 500 # seconds before resetting the manager 33 | 34 | 35 | -------------------------------------------------------------------------------- /rocketsled/examples/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | Examples for Rocketsled. 3 | """ 4 | 5 | __author__ = "Alexander Dunn" 6 | __email__ = "ardunn@lbl.gov" 7 | -------------------------------------------------------------------------------- /rocketsled/examples/basic.py: -------------------------------------------------------------------------------- 1 | """ 2 | An example of the most basic rocketsled implementation. 3 | This file creates and executes a workflow containing one Firework. 4 | 5 | The Firework contains 2 Tasks. 6 | 1. ObjectiveFuncTask - a task that reads x from the spec and 7 | updates y in the spec, according to a simple known function. 8 | 2. OptTask - a task that stores optimiztion data in the db and optimizes 9 | the next guess. 10 | 11 | -------------------------------------------------------------------------- 12 | The following workflow is only one Firework (one job), for example purposes. 13 | However, FireWorks and rocketsled are capable of handling more complex 14 | workflows including multiple jobs and advanced dependencies. Please see the 15 | complex example, or the Fireworks and rocketsled documentation pages for more 16 | information: 17 | 18 | https://hackingmaterials.github.io/rocketsled/ 19 | https://materialsproject.github.io/fireworks/ 20 | """ 21 | from fireworks import FireTaskBase, Firework, FWAction, LaunchPad, Workflow 22 | from fireworks.core.rocket_launcher import rapidfire 23 | from fireworks.utilities.fw_utilities import explicit_serialize 24 | 25 | from rocketsled import MissionControl, OptTask 26 | 27 | # Setting up the FireWorks LaunchPad 28 | launchpad = LaunchPad(name="rsled") 29 | opt_label = "opt_default" 30 | db_info = {"launchpad": launchpad, "opt_label": opt_label} 31 | 32 | # We constrain our dimensions to 3 integers, each between 1 and 5 33 | x_dim = [(1, 5), (1, 5), (1, 5)] 34 | 35 | 36 | @explicit_serialize 37 | class ObjectiveFuncTask(FireTaskBase): 38 | """ 39 | An example task which just evaluates the following simple function: 40 | 41 | f(x) = x[0] * x[1] / x[2] 42 | 43 | Replace this code with your objective function if your objective function 44 | is relatively simple (i.e., only needs one Firework). 45 | """ 46 | 47 | _fw_name = "ObjectiveFuncTask" 48 | 49 | def run_task(self, fw_spec): 50 | x = fw_spec["_x"] 51 | y = x[0] * x[1] / x[2] 52 | return FWAction(update_spec={"_y": y}) 53 | 54 | 55 | def wf_creator(x): 56 | """ 57 | The workflow creator function required by rocketsled. 58 | 59 | This wf_creator takes in an input vector x and returns a workflow which 60 | calculates y, the output. The requirements for using this wf_creator 61 | with rocketsled are: 62 | 63 | 1. OptTask is passed into a FireWork in the workflow 64 | 2. The fields "_x" and "_y" are written to the spec of the FireWork 65 | containing OptTask. 66 | 3. You use MissionControl's "configure" method to set up the optimization, 67 | and pass in wf_creator as it's first argument. 68 | 69 | Args: 70 | x (list): The wf_creator input vector. In this example, it is just 3 71 | integers between 1 and 5 (inclusive). 72 | 73 | Returns: 74 | (Workflow): A workflow containing one FireWork (two FireTasks) which 75 | is automatically set up to run the optimization loop. 76 | 77 | """ 78 | spec = {"_x": x} 79 | # ObjectiveFuncTask writes _y field to the spec internally. 80 | firework1 = Firework([ObjectiveFuncTask(), OptTask(**db_info)], spec=spec) 81 | return Workflow([firework1]) 82 | 83 | 84 | if __name__ == "__main__": 85 | # Make a MissionControl object 86 | mc = MissionControl(**db_info) 87 | 88 | # Reset the launchpad and optimization db for this example 89 | launchpad.reset(password=None, require_password=False) 90 | mc.reset(hard=True) 91 | 92 | # Configure the optimization db with MissionControl 93 | mc.configure(wf_creator=wf_creator, dimensions=x_dim) 94 | 95 | # Run the optimization loop 10 times. 96 | launchpad.add_wf(wf_creator([5, 5, 2])) 97 | rapidfire(launchpad, nlaunches=10, sleep_time=0) 98 | 99 | # Examine results 100 | plt = mc.plot() 101 | plt.show() 102 | -------------------------------------------------------------------------------- /rocketsled/examples/batch.py: -------------------------------------------------------------------------------- 1 | """ 2 | Running a batch optimization with a custom predictor. 3 | 4 | Optimizing the 2D Rosenbrock function, which is a 2D 5 | function with one objective to be minimized. There 6 | are no Z descriptors so we use only the X coordinates 7 | for learning. 8 | 9 | We show two examples here: 10 | 1. Using your own custom predictor while still using 11 | batch optimization. 12 | 2. Running a batch optimization with a builtin predictor. 13 | 14 | Change the USE_CUSTOM_PREDICTOR variable False 15 | to use the builtin predictor. 16 | 17 | See the documentation for more information on batch 18 | optimization and how it runs. 19 | """ 20 | 21 | import random 22 | 23 | import numpy as np 24 | from fireworks.core.firework import FireTaskBase, Firework, FWAction, Workflow 25 | from fireworks.core.launchpad import LaunchPad 26 | from fireworks.core.rocket_launcher import rapidfire 27 | from fireworks.utilities.fw_utilities import explicit_serialize 28 | 29 | from rocketsled.control import MissionControl 30 | from rocketsled.task import OptTask 31 | from rocketsled.utils import split_xz 32 | 33 | # Choose whether to use the custom_batch_predictor 34 | # function or the inbuilt GaussianProcessRegressor 35 | USE_CUSTOM_PREDICTOR = False 36 | 37 | 38 | # Setting up the FireWorks LaunchPad 39 | launchpad = LaunchPad(name="rsled") 40 | opt_label = "opt_default" 41 | db_info = {"launchpad": launchpad, "opt_label": opt_label} 42 | x_dim = [(-5.0, 5.0), (-5.0, 5.0)] 43 | batch_size = 5 44 | 45 | 46 | @explicit_serialize 47 | class RosenbrockTask(FireTaskBase): 48 | _fw_name = "RosenbrockTask" 49 | 50 | def run_task(self, fw_spec): 51 | x = fw_spec["_x"] 52 | y = (1 - x[0]) ** 2 + 100 * (x[1] - x[0] ** 2) ** 2 53 | return FWAction(update_spec={"_y": y}) 54 | 55 | 56 | def custom_batch_predictor(XZ_explored, Y, x_dims, XZ_unexplored, batch_size=1): 57 | """ 58 | Returns a prediction for the next best guess. The returned guess will 59 | be used to construct a new workflow with the workflow creator function. 60 | 61 | The argument names need not be the same shown here, although their 62 | position must remain the same. 63 | 64 | This particular implementation just returns a series of random 65 | guesses in the unexplored space. 66 | 67 | Args: 68 | XZ_explored ([list]): A list of lists; 2D array of samples (rows) 69 | by features (columns) of points already evaluated in the search 70 | space. This is training data. 71 | Y (list): A vector of samples; this is the training output. 72 | x_dims (list): The dimensions of the search space 73 | XZ_unexplored([list[): A list of lists; 2D array of samples (rows) 74 | by features (columns) of points to be predicted. This is the 'test' 75 | or prediction dataset. 76 | 77 | Returns: 78 | x (list): A vector representing the set of parameters for the next best 79 | guess, or for batches, a list of best next x guesses. Number of 80 | guesses must match batch_size. 81 | """ 82 | 83 | # Here is an example custom predictor which is just random 84 | best_xz_batch = random.sample(XZ_unexplored, k=batch_size) 85 | 86 | # If your guesses return separate descriptors (z), separate them 87 | best_x_batch = [split_xz(xz, x_dims, x_only=True) for xz in best_xz_batch] 88 | 89 | # Custom predictor should return a list or tuple of choices if possible 90 | # i.e., all native python types if possible 91 | # Return only a list of batch_size best X guesses (or single X guess 92 | # for non-batch) 93 | # For example, if batch_size is 5, return 5 best guesses. 94 | return best_x_batch 95 | 96 | 97 | def wf_creator_rosenbrock(x): 98 | spec = {"_x": x} 99 | # ObjectiveFuncTask writes _y field to the spec internally. 100 | firework1 = Firework([RosenbrockTask(), OptTask(**db_info)], spec=spec) 101 | return Workflow([firework1]) 102 | 103 | 104 | if __name__ == "__main__": 105 | mc = MissionControl(**db_info) 106 | launchpad.reset(password="2021-11-29", require_password=True) 107 | mc.reset(hard=True) 108 | 109 | if USE_CUSTOM_PREDICTOR: 110 | # 1. Running a batch optimization with a customm predictor. 111 | mc.configure( 112 | wf_creator=wf_creator_rosenbrock, 113 | dimensions=x_dim, 114 | predictor=custom_batch_predictor, 115 | batch_size=batch_size, 116 | predictor_kwargs={"batch_size": batch_size}, 117 | ) 118 | else: 119 | # 2. Using a builtin predictor 120 | mc.configure( 121 | wf_creator=wf_creator_rosenbrock, 122 | dimensions=x_dim, 123 | predictor="GaussianProcessRegressor", 124 | batch_size=batch_size, 125 | ) 126 | 127 | # A batch will only run once rocketsled has seen at 128 | # least batch_size samples. Every batch_size new 129 | # evaluations will lead to another batch optimization. 130 | for _ in range(batch_size): 131 | launchpad.add_wf( 132 | wf_creator_rosenbrock( 133 | [np.random.uniform(-5, 5), np.random.uniform(-5, 5)] 134 | ) 135 | ) 136 | 137 | rapidfire(launchpad, nlaunches=30, sleep_time=0) 138 | 139 | plt = mc.plot() 140 | plt.show() 141 | -------------------------------------------------------------------------------- /rocketsled/examples/complex.py: -------------------------------------------------------------------------------- 1 | """ 2 | Running a rocketsled optimization with a multi-part workflow, multi-objective 3 | objective function, z-features, as well as more advanced configuration. 4 | 5 | Our workflow to optimize now has two Fireworks, each with one FireTask. The 6 | first firework runs the 'expensive' objective function, and the second firework 7 | runs only the optimization. This two-firework setup allows us to run the 8 | objective function and optimization on different computing resources, if 9 | desired. 10 | 11 | We also use an objective function with more than one objective. Note that 12 | as long as we pass in the output vector to the spec (in the key "_y", as in the 13 | basic example), we don't need to make any other changes to tell rocketsled the 14 | objective function is multi-objective. Additionally, the objective function 15 | has dimensions of differing data types (int, float, categorical), which is 16 | automatically handled by rocketsled as long as the dimensions are passed into 17 | MissionControl.configure(...). 18 | 19 | Finally, we add some arguments to the MissionControl configuration before 20 | launching. 21 | """ 22 | 23 | from fireworks import FireTaskBase, Firework, FWAction, LaunchPad, Workflow 24 | from fireworks.core.rocket_launcher import rapidfire 25 | from fireworks.utilities.fw_utilities import explicit_serialize 26 | 27 | from rocketsled import MissionControl, OptTask 28 | 29 | launchpad = LaunchPad(name="rsled") 30 | opt_label = "opt_complex" 31 | db_info = {"launchpad": launchpad, "opt_label": opt_label} 32 | x_dim = [(16, 145), (0.0, 90.0), ["industry standard", "shark fin", "dolphin fin"]] 33 | 34 | 35 | @explicit_serialize 36 | class ComplexMultiObjTask(FireTaskBase): 37 | """ 38 | An example of a complex, multiobjective task with directly competing 39 | objectives. The input vector is defined on a search space with numerical 40 | and categorical inputs. 41 | 42 | This task accepts a 3-vector of the form [int, float, str]. 43 | """ 44 | 45 | _fw_name = "ComplexMultiObjectiveTask" 46 | 47 | def run_task(self, fw_spec): 48 | x = fw_spec["_x"] 49 | fin_len = x[0] 50 | fin_angle = x[1] 51 | fin_type = x[2] 52 | cost = (14.1 * fin_len ** 1.847 + 12.0 + fin_angle * 100.0) / 1000.0 53 | drag = fin_angle ** 0.653 * float(fin_len) ** 1.2 54 | failure_prob = 0.5 - fin_len / 290 + (fin_angle ** 2.0) / 16200 55 | if fin_type == "shark fin": 56 | cost = cost * 1.05 57 | drag = drag * 1.15 58 | failure_prob = failure_prob * 0.75 59 | elif fin_type == "dolphin fin": 60 | cost = cost * 1.6 61 | drag = drag * 0.84 62 | failure_prob = failure_prob * 1.75 63 | return FWAction(update_spec={"_y": [cost, drag, failure_prob], "_x": x}) 64 | 65 | 66 | def wf_creator(x): 67 | """ 68 | A workflow creator function returning a workflow of the following form: 69 | 70 | simulation (fw1) 71 | | 72 | optimization (fw2) 73 | 74 | Args: 75 | x ([list]): A 3 vector of the form [int, float, str], where the elements 76 | are constrained to the search space given in x_dim above. 77 | 78 | Returns: 79 | (Workflow): The workflow which will run the simulation and optimization 80 | fireworks. 81 | 82 | """ 83 | simulation = Firework([ComplexMultiObjTask()], spec={"_x": x}, name="simulation") 84 | optimization = Firework([OptTask(**db_info)], name="optimization") 85 | return Workflow([simulation, optimization], {simulation: optimization}) 86 | 87 | 88 | def get_z(x): 89 | """ 90 | An example function demonstrating how to use z_features. 91 | 92 | The get_z function should accept the same vector as the wf_creator (the x 93 | vector), and return all information that should be used for learning. If 94 | you want to use x for learning, make sure to include x in the returned 95 | z vector. 96 | 97 | Args: 98 | x ([list]): A 3 vector of the form [int, float, str], where the elements 99 | are constrained to the search space given in x_dim above. 100 | 101 | Returns: 102 | (list): The z vector, to be used for learning. 103 | 104 | """ 105 | fin_len = x[0] 106 | fin_angle = x[1] 107 | useful_feature1 = fin_len + fin_angle ** 2 108 | useful_feature2 = fin_angle + fin_len 109 | return x + [useful_feature1, useful_feature2] 110 | 111 | 112 | if __name__ == "__main__": 113 | # Make a MissionControl object 114 | mc = MissionControl(**db_info) 115 | 116 | # Reset the launchpad and optimization db for this example 117 | launchpad.reset(password=None, require_password=False) 118 | mc.reset(hard=True) 119 | 120 | # Configure the optimization db with MissionControl 121 | mc.configure( 122 | wf_creator=wf_creator, 123 | dimensions=x_dim, 124 | acq="maximin", 125 | predictor="GaussianProcessRegressor", 126 | get_z=get_z, 127 | ) 128 | 129 | # Run 30 workflows + optimization 130 | launchpad.add_wf(wf_creator([100, 45.0, "dolphin fin"])) 131 | rapidfire(launchpad, nlaunches=30) 132 | 133 | # Examine and plot the optimization 134 | plt = mc.plot(print_pareto=True) 135 | plt.show() 136 | -------------------------------------------------------------------------------- /rocketsled/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackingmaterials/rocketsled/294cdc370ad2fbca3475046f2122f0a6e0a33946/rocketsled/tests/__init__.py -------------------------------------------------------------------------------- /rocketsled/tests/deserialize_func.py: -------------------------------------------------------------------------------- 1 | """ 2 | Auxiliary file for testing utils. 3 | """ 4 | 5 | 6 | def obj_func(x): 7 | """ 8 | Objective function which sums the elements in x. 9 | 10 | Args: 11 | x ([float] or [int]): List of numbers to sum. 12 | 13 | Returns: 14 | y (float or int): The sum of x. 15 | 16 | """ 17 | return sum(x) 18 | -------------------------------------------------------------------------------- /rocketsled/tests/missioncontrol_plot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackingmaterials/rocketsled/294cdc370ad2fbca3475046f2122f0a6e0a33946/rocketsled/tests/missioncontrol_plot.png -------------------------------------------------------------------------------- /rocketsled/tests/test_utils.py: -------------------------------------------------------------------------------- 1 | """ 2 | Testing utility functions in rocketsled 3 | """ 4 | import os 5 | import unittest 6 | 7 | import numpy as np 8 | 9 | from rocketsled.utils import ( 10 | check_dims, 11 | convert_native, 12 | convert_value_to_native, 13 | deserialize, 14 | dtypes, 15 | get_default_opttask_kwargs, 16 | get_len, 17 | is_discrete, 18 | is_duplicate_by_tolerance, 19 | latex_float, 20 | pareto, 21 | random_guess, 22 | serialize, 23 | split_xz, 24 | ) 25 | 26 | 27 | class TestUtilities(unittest.TestCase): 28 | def test_Dtypes(self): 29 | dt = dtypes 30 | self.assertTrue(int in dt.ints) 31 | self.assertTrue(np.int in dt.ints) 32 | self.assertTrue(float in dt.floats) 33 | self.assertTrue(np.float in dt.floats) 34 | self.assertTrue(type("somestr") in dt.all) 35 | self.assertTrue(type("somestr") in dt.others) 36 | self.assertTrue(bool in dt.all) 37 | self.assertTrue(bool in dt.bool) 38 | self.assertTrue(np.bool in dt.bool) 39 | 40 | def test_random_guess(self): 41 | d1 = tuple([1, 5]) 42 | d2 = ["red", "green", "blue"] 43 | dims = [d1, d2] 44 | rg = random_guess(dims) 45 | self.assertTrue(rg[0] in [1, 2, 3, 4, 5]) 46 | self.assertTrue(rg[1] in d2) 47 | 48 | def test_pareto(self): 49 | test_arr = np.asarray([[5, 5], [2, 2], [1, 4], [3, 2]]) 50 | mins = test_arr[pareto(test_arr, maximize=False)] 51 | maxes = test_arr[pareto(test_arr, maximize=True)] 52 | self.assertTrue([2, 2] in mins) 53 | self.assertTrue([1, 4] in mins) 54 | self.assertFalse(([3, 2] in maxes)) 55 | self.assertTrue([5, 5] in maxes) 56 | 57 | def test_convert_value_to_native(self): 58 | a = np.int(5) 59 | b = np.float(1.4) 60 | c = np.str("somestr") 61 | a_native = convert_value_to_native(a) 62 | b_native = convert_value_to_native(b) 63 | c_native = convert_value_to_native(c) 64 | self.assertTrue(isinstance(a_native, int)) 65 | self.assertTrue(isinstance(b_native, float)) 66 | self.assertTrue(isinstance(c_native, str)) 67 | 68 | def test_convert_native(self): 69 | a = [np.int(10), np.float(12.2), np.str("a str"), 12.3, 100, "ok"] 70 | native = convert_native(a) 71 | self.assertListEqual( 72 | [type(i) for i in native], [int, float, str, float, int, str] 73 | ) 74 | 75 | def test_latex_float(self): 76 | f1 = 3.494388373744 77 | f2 = 3.223421e-16 78 | self.assertTrue(latex_float(f1), "3.49") 79 | self.assertTrue(latex_float(f2), "3.22 \times 10^{-16}") 80 | 81 | def test_serialize(self): 82 | fstr = "rocketsled.tests.deserialize_func.obj_func" 83 | from rocketsled.tests.deserialize_func import obj_func 84 | 85 | self.assertEqual(serialize(obj_func), fstr) 86 | self.assertEqual(serialize(obj_func), fstr) 87 | 88 | def test_deserialize(self): 89 | cwd = os.path.dirname(os.path.realpath(__file__)) 90 | funcstr = cwd + "/deserialize_func.obj_func" 91 | f = deserialize(funcstr) 92 | self.assertEqual(f([1, 2, 3]), 6) 93 | self.assertAlmostEqual(f([1.0, 2.0, 3.0]), 6.0) 94 | 95 | def test_split_xz(self): 96 | x_dims = [(1, 10), (1, 10), (1, 10)] 97 | x = [1, 2, 3] 98 | z = ["red", "monkey"] 99 | xz = x + z 100 | x_split, z_split = split_xz(xz, x_dims) 101 | self.assertListEqual(x, x_split) 102 | self.assertListEqual(z, z_split) 103 | 104 | def test_get_default_opttask_kwargs(self): 105 | kwargs = get_default_opttask_kwargs() 106 | self.assertTrue(isinstance(kwargs, dict)) 107 | 108 | def test_check_dims(self): 109 | good_dims = [(1, 50), (100.0, 200.0), ["orange", "blue"]] 110 | good_dims_2 = [ 111 | [1.45, 1.43, 1.78, 1.98], 112 | ["orange", "blue"], 113 | [1, 12, 1400, 1975], 114 | ] 115 | bad_dims_1 = {"dim1": 12, "dim2": (100, 200)} 116 | bad_dims_2 = [{1.5: 200}, ["red", "green", "blue"]] 117 | bad_dims_3 = [("red", 12, 15), ["red", "greeen"]] 118 | bad_dims_4 = [(1.5, 200), (1.4, 1.7, 2.9)] 119 | self.assertListEqual( 120 | check_dims(good_dims), ["int_range", "float_range", "categorical 2"] 121 | ) 122 | self.assertListEqual( 123 | check_dims(good_dims_2), ["float_set", "categorical 2", "int_set"] 124 | ) 125 | with self.assertRaises(TypeError): 126 | check_dims(bad_dims_1) 127 | with self.assertRaises(TypeError): 128 | check_dims(bad_dims_2) 129 | with self.assertRaises(TypeError): 130 | check_dims(bad_dims_3) 131 | with self.assertRaises(TypeError): 132 | check_dims(bad_dims_4) 133 | 134 | def test_is_discrete(self): 135 | dims1 = [(1.0, 200.0), ["red", "green"], (1, 10)] 136 | dims2 = [(1, 10), (2, 20), [1, 2, 3, 4, 5], ["orange", "red"]] 137 | dims3 = [(1.00, 200.0), [1.5, 1.8, 1.9]] 138 | self.assertFalse(is_discrete(dims1, "all")) 139 | self.assertTrue(is_discrete(dims1, "any")) 140 | self.assertTrue(is_discrete(dims2, "all")) 141 | self.assertTrue(is_discrete(dims2, "any")) 142 | self.assertFalse(is_discrete(dims3, "all")) 143 | self.assertFalse(is_discrete(dims3, "any")) 144 | 145 | def test_tolerance_check(self): 146 | tolerances = [1e-6, None, 2] 147 | all_x_explored = [[1.45, "red", 201], [1.48, "green", 209]] 148 | x_dup = [1.4500001, "red", 203] 149 | x_clear = [1.45, "green", 220] 150 | self.assertFalse( 151 | is_duplicate_by_tolerance(x_clear, all_x_explored, tolerances) 152 | ) 153 | self.assertTrue(is_duplicate_by_tolerance(x_dup, all_x_explored, tolerances)) 154 | 155 | def test_get_len(self): 156 | self.assertEqual(get_len([1, 2, 3]), 3) 157 | self.assertEqual(get_len(4), 1) 158 | self.assertEqual(get_len("abc"), 1) 159 | -------------------------------------------------------------------------------- /rocketsled/tests/tests_launchpad.yaml: -------------------------------------------------------------------------------- 1 | host: localhost 2 | port: 27017 3 | logdir: null 4 | name: rsled_tests 5 | username: 6 | password: 7 | #ssl_ca_file: null 8 | strm_lvl: INFO 9 | user_indices: [] 10 | wf_user_indices: [] -------------------------------------------------------------------------------- /setup.cfg: -------------------------------------------------------------------------------- 1 | [build_sphinx] 2 | source-dir = docs/ 3 | build-dir = docs/_build 4 | all_files = 1 5 | 6 | [upload_sphinx] 7 | upload-dir = docs/_build/html 8 | 9 | [aliases] 10 | upload_docs = upload_docs --upload-dir=docs/_build/html 11 | 12 | [flake8] 13 | # Ensure this is the same value as line-length under [tool.black] in pyproject.toml. 14 | max-line-length = 85 15 | max-complexity = 12 16 | exclude = .git 17 | # E731: do not assign a lambda expression, use a def 18 | # W503: line break before binary operator 19 | # C901: function is too complex 20 | ignore = E731, W503, C901 21 | 22 | # Make isort play nicely with black's import formatting. 23 | # https://github.com/microsoft/vscode-python/issues/5840 24 | 25 | 26 | [isort] 27 | multi_line_output = 3 28 | include_trailing_comma = True -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | import os 2 | from setuptools import setup, find_packages 3 | 4 | # Version is MAJOR.MINOR.PATCH.YYYYMMDD 5 | version = "1.1.0.20211129" 6 | 7 | module_dir = os.path.dirname(os.path.abspath(__file__)) 8 | with open(os.path.join(module_dir, "requirements.txt"), "r") as f: 9 | requirements = f.read().replace(" ", "").split("\n") 10 | 11 | long_description = \ 12 | """ 13 | rocketsled is a black-box optimization framework "on rails" for high-throughput computation with FireWorks. 14 | 15 | - **Website (including documentation):** https://hackingmaterials.github.io/rocketsled/ 16 | - **Help/Support:** https://groups.google.com/forum/#!forum/fireworkflows 17 | - **Source:** https://github.com/hackingmaterials/rocketsled 18 | - **FireWorks website:** https://materialsproject.github.io/fireworks 19 | 20 | If you find rocketsled useful, please encourage its development by citing the [following paper](http://doi.org//10.1088/2515-7639/ab0c3d) in your research: 21 | 22 | ``` 23 | Dunn, A., Brenneck, J., Jain, A., Rocketsled: a software library for optimizing 24 | high-throughput computational searches. J. Phys. Mater. 2, 034002 (2019). 25 | ``` 26 | 27 | If you find FireWorks useful, please consider citing [its paper](http://dx.doi.org/10.1002/cpe.3505) as well: 28 | 29 | ``` 30 | Jain, A., Ong, S. P., Chen, W., Medasani, B., Qu, X., Kocher, M., Brafman, M., 31 | Petretto, G., Rignanese, G.-M., Hautier, G., Gunter, D., and Persson, K. A. 32 | FireWorks: a dynamic workflow system designed for high-throughput applications. 33 | Concurrency Computat.: Pract. Exper., 27: 5037–5059. (2015) 34 | ``` 35 | """ 36 | 37 | setup( 38 | name='rocketsled', 39 | version=str(version), 40 | description='Black box optimization with Fireworks workflows, on rails', 41 | url='https://github.com/hackingmaterials/rocktsled', 42 | author='Alex Dunn', 43 | author_email='ardunn@lbl.gov', 44 | long_description=long_description, 45 | long_description_content_type="text/markdown", 46 | license='modified BSD', 47 | classifiers=[ 48 | 'Development Status :: 3 - Alpha', 49 | 'Intended Audience :: Science/Research', 50 | 'Intended Audience :: Information Technology', 51 | 'License :: OSI Approved :: MIT License', 52 | 'Natural Language :: English', 53 | 'Programming Language :: Python :: 3 :: Only', 54 | 'Topic :: Scientific/Engineering :: Chemistry', 55 | 'Topic :: Scientific/Engineering :: Physics', 56 | 'Topic :: Scientific/Engineering', 57 | 'Topic :: Other/Nonlisted Topic', 58 | 'Operating System :: OS Independent', 59 | ], 60 | keywords='black-box-optimization optimization workflows', 61 | test_suite='rocketsled', 62 | tests_require='tests', 63 | packages=find_packages(), 64 | # package_data={'rocketsled': ['defaults.yaml']}, 65 | install_requires=requirements, 66 | # data_files=['LICENSE', 'README.md', 'VERSION'], 67 | include_package_data=True 68 | ) 69 | -------------------------------------------------------------------------------- /tasks.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | # Copyright (c) Pymatgen Development Team. 3 | # Distributed under the terms of the MIT License. 4 | 5 | import os 6 | import json 7 | import webbrowser 8 | import requests 9 | import datetime 10 | from invoke import task 11 | 12 | from rocketsled import __version__ 13 | from monty.os import cd 14 | 15 | """ 16 | Deployment file to facilitate releases. 17 | """ 18 | 19 | 20 | @task 21 | def make_doc(ctx): 22 | with cd("docs_rst"): 23 | ctx.run("sphinx-apidoc -o . -f ../rocketsled") 24 | ctx.run("make html") 25 | ctx.run("cp _static/* ../docs/html/_static") 26 | 27 | with cd("docs"): 28 | ctx.run("cp -r html/* .") 29 | ctx.run("rm -r html") 30 | ctx.run("rm -r doctrees") 31 | 32 | # Avoid the use of jekyll so that _dir works as intended. 33 | ctx.run("touch .nojekyll") 34 | 35 | 36 | @task 37 | def open_doc(ctx): 38 | pth = os.path.abspath("docs/index.html") 39 | webbrowser.open("file://" + pth) 40 | 41 | 42 | @task 43 | def version_check(ctx): 44 | with open("setup.py", "r") as f: 45 | setup_version = None 46 | for l in f.readlines(): 47 | if "version = " in l: 48 | setup_version = l.split(" ")[-1] 49 | setup_version = setup_version.replace('"', "").replace("\n", "") 50 | 51 | if setup_version is None: 52 | raise IOError("Could not parse setup.py for version.") 53 | 54 | if __version__ == setup_version: 55 | print("Setup and init versions match eachother.") 56 | today = datetime.date.today().strftime("%Y%m%d") 57 | if today not in __version__: 58 | raise ValueError(f"The version {__version__} does not contain " 59 | f"the date!") 60 | else: 61 | print("Version matches the date.") 62 | else: 63 | raise ValueError(f"There is a mismatch in the date between the " 64 | f"rocketsled __init__ and the setup. Please " 65 | f"make sure they are the same." 66 | f"\n DIFF: {__version__}, {setup_version}") 67 | 68 | 69 | @task 70 | def format_project(ctx): 71 | ctx.run("isort --recursive rocketsled") 72 | ctx.run("black rocketsled") 73 | ctx.run("flake8 rocketsled") 74 | 75 | 76 | @task 77 | def update_changelog(ctx): 78 | version_check(ctx) 79 | ctx.run('github_changelog_generator --user hackingmaterials --project rocketsled') 80 | 81 | 82 | @task 83 | def publish(ctx): 84 | version_check(ctx) 85 | ctx.run("rm -r dist build", warn=True) 86 | ctx.run("python3 setup.py sdist bdist_wheel") 87 | ctx.run("twine upload dist/*") 88 | 89 | 90 | @task 91 | def release(ctx): 92 | version_check(ctx) 93 | payload = { 94 | "tag_name": "v" + __version__, 95 | "target_commitish": "master", 96 | "name": "v" + __version__, 97 | "body": "", 98 | "draft": False, 99 | "prerelease": False 100 | } 101 | response = requests.post( 102 | "https://api.github.com/repos/hackingmaterials/rocketsled/releases", 103 | data=json.dumps(payload), 104 | headers={ 105 | "Authorization": "token " + os.environ["GITHUB_RELEASES_TOKEN"]}) 106 | print(response.text) 107 | --------------------------------------------------------------------------------