Skip to content

Commit

Permalink
Fix some layout glitches and improve doc
Browse files Browse the repository at this point in the history
  • Loading branch information
holgern committed Jan 29, 2020
1 parent 68005bf commit 5dff068
Show file tree
Hide file tree
Showing 5 changed files with 66 additions and 21 deletions.
41 changes: 37 additions & 4 deletions doc/development.rst
Original file line number Diff line number Diff line change
@@ -1,14 +1,47 @@
===========
Development
===========
The library is still experimental and under heavy development.

The library is still experimental and under heavy development. Checkout
the `next
milestone <https://github.com/scikit-optimize/scikit-optimize/milestone/6>`__
for the plans for the next release or look at some `easy
issues <https://github.com/scikit-optimize/scikit-optimize/issues?q=is%3Aissue+is%3Aopen+label%3AEasy>`__
to get started contributing.

The development version can be installed through:

.. code-block:: bash
git clone https://github.com/scikit-optimize/scikit-optimize.git
cd scikit-optimize
pip install -r requirements.txt
python setup.py develop
pip install -e.
Run all tests by executing ``pytest`` in the top level directory.

To only run the subset of tests with short run time, you can use ``pytest -m 'fast_test'`` (``pytest -m 'slow_test'`` is also possible). To exclude all slow running tests try ``pytest -m 'not slow_test'``.

This is implemented using pytest `attributes <https://docs.pytest.org/en/latest/mark.html>`__. If a tests runs longer than 1 second, it is marked as slow, else as fast.

All contributors are welcome!


Making a Release
~~~~~~~~~~~~~~~~

The release procedure is almost completely automated. By tagging a new release
travis will build all required packages and push them to PyPI. To make a release
create a new issue and work through the following checklist:

* update the version tag in ``__init__.py``
* update the version tag mentioned in the README
* check if the dependencies in ``setup.py`` are valid or need unpinning
* check that the ``CHANGELOG.md`` is up to date
* did the last build of master succeed?
* create a `new release <https://github.com/scikit-optimize/scikit-optimize/releases>`__
* ping `conda-forge <https://github.com/conda-forge/scikit-optimize-feedstock>`__

Run the tests by executing `pytest` in the top level directory.
Before making a release we usually create a release candidate. If the next
release is v0.X then the release candidate should be tagged v0.Xrc1 in
``__init__.py``. Mark a release candidate as a "pre-release"
on GitHub when you tag it.
15 changes: 15 additions & 0 deletions doc/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,18 @@ The newest development version of scikit-optimize can be installed by:
.. code-block:: bash
$ pip install git+https://github.com/scikit-optimize/scikit-optimize.git
Development version
~~~~~~~~~~~~~~~~~~~

The library is still experimental and under heavy development.
The development version can be installed through:

.. code-block:: bash
git clone https://github.com/scikit-optimize/scikit-optimize.git
cd scikit-optimize
pip install -r requirements.txt
python setup.py develop
Run the tests by executing `pytest` in the top level directory.
1 change: 1 addition & 0 deletions doc/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ <h4 class="sk-landing-call-header">News</h4>
<li><strong>On-going development:</strong>
<a href="whats_new.html"><strong>What's new</strong> (Changelog)</a>
</li>
<li><strong>Jan 2020.</strong> scikit-optimize 0.7 (<a href="whats_new/v0.7.html">Changelog</a>).
<li><strong>April 2018.</strong> scikit-optimize 0.6 (<a href="whats_new/v0.6.html">Changelog</a>).
<li><strong>Mar 2018.</strong> scikit-optimize 0.5 (<a href="whats_new/v0.5.html">Changelog</a>).
<li><strong>Aug 2017.</strong> scikit-optimize 0.4 (<a href="whats_new/v0.4.html">Changelog</a>).
Expand Down
20 changes: 9 additions & 11 deletions examples/interruptible-optimization.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,9 @@
This is useful, for example,
* if you don't know how long the process will take and cannot hog
computational resources forever
* if there might be system failures due to shaky infrastructure
(or colleagues...)
* if you want to adjust some parameters and continue with the already obtained
results
* if you don't know how long the process will take and cannot hog computational resources forever
* if there might be system failures due to shaky infrastructure (or colleagues...)
* if you want to adjust some parameters and continue with the already obtained results
"""
print(__doc__)
Expand Down Expand Up @@ -123,10 +120,11 @@ def obj_fun(x, noise_level=noise_level):
# =================
#
# * **changes in search space:** You can use this technique to interrupt
# the search, tune the search space and continue the optimization. Note
# that the optimizers will complain if `x0` contains parameter values not
# covered by the dimension definitions, so in many cases shrinking the
# search space will not work without deleting the offending runs from
# `x0` and `y0`.
# the search, tune the search space and continue the optimization. Note
# that the optimizers will complain if `x0` contains parameter values not
# covered by the dimension definitions, so in many cases shrinking the
# search space will not work without deleting the offending runs from
# `x0` and `y0`.
# * see :ref:`sphx_glr_auto_examples_store-and-load-results.py`
#
# for more information on how the results get saved and possible caveats
10 changes: 4 additions & 6 deletions examples/parallel-optimization.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,9 @@
interface is as follows:
1. Initialize instance of the `Optimizer` class from skopt
2. Obtain n points for evaluation in parallel by calling the `ask` method of
an optimizer instance with the `n_points` argument set to n > 0
2. Obtain n points for evaluation in parallel by calling the `ask` method of an optimizer instance with the `n_points` argument set to n > 0
3. Evaluate points
4. Provide points and corresponding objectives using the `tell` method of
an optimizer instance
4. Provide points and corresponding objectives using the `tell` method of an optimizer instance
5. Continue from step 2 until eg maximum number of evaluations reached
"""

Expand Down Expand Up @@ -72,14 +70,14 @@

#############################################################################
# Note that if `n_points` is set to some integer > 0 for the `ask` method, the
# result will be a list of points, even for `n_points`=1. If the argument is
# result will be a list of points, even for `n_points` = 1. If the argument is
# set to `None` (default value) then a single point (but not a list of points)
# will be returned.
#
# The default "minimum constant liar" [1] parallelization strategy is used in
# the example, which allows to obtain multiple points for evaluation with a
# single call to the `ask` method with any surrogate or acquisition function.
# Paralellization strategy can be set using the "strategy" argument of `ask`.
# Parallelization strategy can be set using the "strategy" argument of `ask`.
# For supported parallelization strategies see the documentation of
# scikit-optimize.
#
Expand Down

0 comments on commit 5dff068

Please sign in to comment.