From 9f41adce1d5b7dbab048aa68e62b4a39a5e7abbb Mon Sep 17 00:00:00 2001 From: Waldir Leoncio Date: Wed, 12 Feb 2020 11:12:20 +0100 Subject: [PATCH 1/5] Minor improvements to documentation (#320) * Fixed DeprecationWarning on Python 3.7 (W605) * Replaced legacy calls to py.test with pytest * Resolved lint warnings E226 and W504 * Solved E303 flake8 violation * Updates and conforming to doc8 * Improved step-by-step * Improved step-by-step * Added pydocstyle requirement * Solved D414 (thanks to @hpesonen) * Removed one unused variable (n_imp) * Restricted pydocstyle to < 5.0.0 * Added make test-notslow option * Fixed link formatting * Added paragraph linking CONTRIBUTING to Wiki * Added link to CHANGELOG. * Improved code formatting * Improved code formatting --- CHANGELOG.rst | 2 ++ CONTRIBUTING.rst | 2 +- README.md | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 17a550c3..de97cea4 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,6 +1,8 @@ Changelog ========= +- Minor improvements to documentation + 0.7.5 (2019-12-18) ------------------ - Improved the appearance of figures produced by `plot_gp` and added the option diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index 374418bd..b48cc59e 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -96,7 +96,7 @@ Ready to contribute? Here's how to set up `ELFI` for local development. $ make lint $ make test - You may run `make test-notslow` instead of `make test` *as long as your proposed changes are unrelated to BOLFI*. + You may run ``make test-notslow`` instead of ``make test`` *as long as your proposed changes are unrelated to BOLFI*. Also make sure that the docstrings of your code are formatted properly:: diff --git a/README.md b/README.md index 598b2c78..33440a09 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -**Version 0.7.5 released!** See the CHANGELOG and [notebooks](https://github.com/elfi-dev/notebooks). +**Version 0.7.5 released!** See the [CHANGELOG](CHANGELOG.rst) and [notebooks](https://github.com/elfi-dev/notebooks). **NOTE:** For the time being NetworkX 2 is incompatible with ELFI. From d818d1baf78b271cecf875da3bad54abf8fdfeae Mon Sep 17 00:00:00 2001 From: Henri Pesonen Date: Mon, 17 Feb 2020 11:15:22 +0100 Subject: [PATCH 2/5] add notation to clarify how threshold param is interpreteted docstring (#324) --- elfi/methods/parameter_inference.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/elfi/methods/parameter_inference.py b/elfi/methods/parameter_inference.py index 47d99ee4..ad67678a 100644 --- a/elfi/methods/parameter_inference.py +++ b/elfi/methods/parameter_inference.py @@ -463,7 +463,7 @@ def set_objective(self, n_samples, threshold=None, quantile=None, n_sim=None): In between (0,1). Define the threshold as the p-quantile of all the simulations. n_sim = n_samples/quantile. n_sim : int - Total number of simulations. The threshold will be the n_samples smallest + Total number of simulations. The threshold will be the n_samples-th smallest discrepancy among n_sim simulations. """ From 2f049aaa8adb86df9281bb10f17270fe4580bdb5 Mon Sep 17 00:00:00 2001 From: Mehti Musayev Date: Mon, 17 Feb 2020 12:57:15 +0200 Subject: [PATCH 3/5] Fix bug related to acquisition batch variable (#293) * Fix bug related to acquisition batch variable * Pruned unnecessary lines of code Co-authored-by: Henri Pesonen Co-authored-by: Waldir Leoncio --- elfi/methods/bo/acquisition.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/elfi/methods/bo/acquisition.py b/elfi/methods/bo/acquisition.py index 16ece33a..10d55c90 100644 --- a/elfi/methods/bo/acquisition.py +++ b/elfi/methods/bo/acquisition.py @@ -511,9 +511,11 @@ def _evaluate_logpdf(theta): return -np.inf return np.log(val_pdf) + batch_theta = np.zeros(shape=len(gp.bounds)) + # Obtaining the RandMaxVar acquisition. for i in range(self._limit_faulty_init + 1): - if i > self._limit_faulty_init: + if i == self._limit_faulty_init: raise SystemExit("Unable to find a suitable initial point.") # Proposing the initial point. From ec1418e8ac82d0c9fa745369fd8a0f973eb9b3ec Mon Sep 17 00:00:00 2001 From: Henri Pesonen Date: Wed, 29 Jul 2020 12:03:52 +0200 Subject: [PATCH 4/5] Fix stochastic optimization (#328) * Fix incompatibility with scipy>1.5 * Modified CHANGELOG --- CHANGELOG.rst | 1 + elfi/methods/bo/utils.py | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index de97cea4..343bbb7c 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,6 +1,7 @@ Changelog ========= +- Fix incompatibility with scipy>1.5 in bo.utils.stochastic_optimization - Minor improvements to documentation 0.7.5 (2019-12-18) diff --git a/elfi/methods/bo/utils.py b/elfi/methods/bo/utils.py index 9aa32653..d695f137 100644 --- a/elfi/methods/bo/utils.py +++ b/elfi/methods/bo/utils.py @@ -28,8 +28,12 @@ def stochastic_optimization(fun, bounds, maxiter=1000, polish=True, seed=0): tuple of the found coordinates of minimum and the corresponding value. """ + def fun_1d(x): + return fun(x).ravel() + result = differential_evolution( - func=fun, bounds=bounds, maxiter=maxiter, polish=polish, init='latinhypercube', seed=seed) + func=fun_1d, bounds=bounds, maxiter=maxiter, + polish=polish, init='latinhypercube', seed=seed) return result.x, result.fun From 5c799dd7f42552d4235ed1ecf61be82ff2bd7ace Mon Sep 17 00:00:00 2001 From: hpesonen Date: Wed, 29 Jul 2020 14:34:40 +0200 Subject: [PATCH 5/5] Bump version --- CHANGELOG.rst | 2 ++ README.md | 2 +- elfi/__init__.py | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 343bbb7c..a612ff0d 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,6 +1,8 @@ Changelog ========= +0.7.6 (2020-08-29) +------------------ - Fix incompatibility with scipy>1.5 in bo.utils.stochastic_optimization - Minor improvements to documentation diff --git a/README.md b/README.md index 33440a09..15eac0bd 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -**Version 0.7.5 released!** See the [CHANGELOG](CHANGELOG.rst) and [notebooks](https://github.com/elfi-dev/notebooks). +**Version 0.7.6 released!** See the [CHANGELOG](CHANGELOG.rst) and [notebooks](https://github.com/elfi-dev/notebooks). **NOTE:** For the time being NetworkX 2 is incompatible with ELFI. diff --git a/elfi/__init__.py b/elfi/__init__.py index f081f276..6a5c7a15 100644 --- a/elfi/__init__.py +++ b/elfi/__init__.py @@ -26,4 +26,4 @@ __email__ = 'elfi-support@hiit.fi' # make sure __version_ is on the last non-empty line (read by setup.py) -__version__ = '0.7.5' +__version__ = '0.7.6'