From f65ca6d5f9474e0fa723287c6ff36d930fe81395 Mon Sep 17 00:00:00 2001 From: lucianopaz Date: Tue, 19 May 2020 23:39:31 +0200 Subject: [PATCH 1/2] Drop support for float128 outside of linux and mac --- RELEASE-NOTES.md | 1 + pymc3/distributions/dist_math.py | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index 490f905deab..6022ddcc385 100644 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -28,6 +28,7 @@ pointwise log likelihood (see [#3883](https://github.com/pymc-devs/pymc3/pull/3883)). - The multiprocessing start method on MacOS is now set to "forkserver", to avoid crashes (see issue [#3849](https://github.com/pymc-devs/pymc3/issues/3849), solved by [#3919](https://github.com/pymc-devs/pymc3/pull/3919)). - Forced the `Beta` distribution's `random` method to generate samples that are in the open interval $(0, 1)$, i.e. no value can be equal to zero or equal to one (issue [#3898](https://github.com/pymc-devs/pymc3/issues/3898) fixed by [#3924](https://github.com/pymc-devs/pymc3/pull/3924)). +- Fixed issue with clipped beta distribution rvs dtype. Removed support for `float128` on platforms that aren't Linux or Darwin (see issue [#3929](https://github.com/pymc-devs/pymc3/issues/3849) fixed by [#3930](https://github.com/pymc-devs/pymc3/pull/3930)) ### Deprecations - Remove `sample_ppc` and `sample_ppc_w` that were deprecated in 3.6. diff --git a/pymc3/distributions/dist_math.py b/pymc3/distributions/dist_math.py index 2a7e5c1bb9c..b7e5c5b4cd6 100644 --- a/pymc3/distributions/dist_math.py +++ b/pymc3/distributions/dist_math.py @@ -17,6 +17,7 @@ @author: johnsalvatier ''' +import platform import numpy as np import scipy.linalg import scipy.stats @@ -36,8 +37,13 @@ c = - .5 * np.log(2. * np.pi) _beta_clip_values = { dtype: (np.nextafter(0, 1, dtype=dtype), np.nextafter(1, 0, dtype=dtype)) - for dtype in ["float16", "float32", "float64", "float128"] + for dtype in ["float16", "float32", "float64"] } +if platform.system() in ["Linux", "Darwin"]: + _beta_clip_values["float128"] = ( + np.nextafter(0, 1, dtype="float128"), + np.nextafter(1, 0, dtype="float128") + ) From a80a0acfd8941606e29c7aae321489e8615543eb Mon Sep 17 00:00:00 2001 From: lucianopaz Date: Wed, 20 May 2020 10:44:52 +0200 Subject: [PATCH 2/2] Improve release notes --- RELEASE-NOTES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index 6022ddcc385..5b2824d8827 100644 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -28,7 +28,7 @@ pointwise log likelihood (see [#3883](https://github.com/pymc-devs/pymc3/pull/3883)). - The multiprocessing start method on MacOS is now set to "forkserver", to avoid crashes (see issue [#3849](https://github.com/pymc-devs/pymc3/issues/3849), solved by [#3919](https://github.com/pymc-devs/pymc3/pull/3919)). - Forced the `Beta` distribution's `random` method to generate samples that are in the open interval $(0, 1)$, i.e. no value can be equal to zero or equal to one (issue [#3898](https://github.com/pymc-devs/pymc3/issues/3898) fixed by [#3924](https://github.com/pymc-devs/pymc3/pull/3924)). -- Fixed issue with clipped beta distribution rvs dtype. Removed support for `float128` on platforms that aren't Linux or Darwin (see issue [#3929](https://github.com/pymc-devs/pymc3/issues/3849) fixed by [#3930](https://github.com/pymc-devs/pymc3/pull/3930)) +- Fixed an issue that happened on Windows, that was introduced by the clipped beta distribution rvs function ([#3924](https://github.com/pymc-devs/pymc3/pull/3924)). Windows does not support the `float128` dtype, but we had assumed that it had to be available. The solution was to only support `float128` on Linux and Darwin systems (see issue [#3929](https://github.com/pymc-devs/pymc3/issues/3849) fixed by [#3930](https://github.com/pymc-devs/pymc3/pull/3930)). ### Deprecations - Remove `sample_ppc` and `sample_ppc_w` that were deprecated in 3.6.