EmuKit / emukit

A Python-based toolbox of various methods in decision making, uncertainty quantification and statistical emulation: multi-fidelity, experimental design, Bayesian optimisation, Bayesian quadrature, etc.
https://emukit.github.io/emukit/
Apache License 2.0
605 stars 128 forks source link

Boolean operations for stopping conditions #275

Closed apaleyes closed 4 years ago

apaleyes commented 4 years ago

Issue #, if available: #273

Description of changes: This implements logical operations on stopping conditions. Namely, we can now combine them with & (and) and | (or). Sadly, Python's and and or cannot be overloaded.

This also makes ability to accept a list of conditions in the loop redundant, so this option is removed.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

review-notebook-app[bot] commented 4 years ago

Check out this pull request on  ReviewNB

You'll be able to see Jupyter notebook diff and discuss changes. Powered by ReviewNB.

apaleyes commented 4 years ago

@henrymoss this PR partially undoes your changes introduced in #272 . But it makes the API more flexible overall, so please don't be mad!

codecov-io commented 4 years ago

Codecov Report

Merging #275 into master will increase coverage by 0.08%. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #275      +/-   ##
==========================================
+ Coverage   89.69%   89.77%   +0.08%     
==========================================
  Files         117      117              
  Lines        3793     3806      +13     
  Branches      428      426       -2     
==========================================
+ Hits         3402     3417      +15     
- Misses        307      309       +2     
+ Partials       84       80       -4
Impacted Files Coverage Δ
emukit/core/loop/outer_loop.py 92.3% <100%> (+3.21%) :arrow_up:
emukit/core/loop/stopping_conditions.py 97.72% <100%> (+1.29%) :arrow_up:
emukit/test_functions/forrester.py 77.27% <0%> (ø) :arrow_up:
emukit/test_functions/non_linear_sin.py 72.72% <0%> (ø) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 9a22d12...3d61658. Read the comment docs.