From e5aef095540ecbdfad28924341356af502ac3596 Mon Sep 17 00:00:00 2001 From: Thomas Wiecki Date: Tue, 9 Mar 2021 09:48:13 +0100 Subject: [PATCH 1/4] Remove float128 dtype which does not exist on Windows and newer OSX versions and furthermore does not to be properly supported even if it does exist. --- pymc3/distributions/dist_math.py | 5 ----- pymc3/tests/test_dist_math.py | 4 +--- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/pymc3/distributions/dist_math.py b/pymc3/distributions/dist_math.py index 7f5aeb40f5..3ed3f1f151 100644 --- a/pymc3/distributions/dist_math.py +++ b/pymc3/distributions/dist_math.py @@ -45,11 +45,6 @@ dtype: (np.nextafter(0, 1, dtype=dtype), np.nextafter(1, 0, dtype=dtype)) 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"), - ) def bound(logp, *conditions, **kwargs): diff --git a/pymc3/tests/test_dist_math.py b/pymc3/tests/test_dist_math.py index f3b193b8a1..297f3de0c5 100644 --- a/pymc3/tests/test_dist_math.py +++ b/pymc3/tests/test_dist_math.py @@ -239,9 +239,7 @@ def test_grad(self): @pytest.mark.parametrize( "dtype", - ["float16", "float32", "float64", "float128"] - if sys.platform != "win32" - else ["float16", "float32", "float64"], + ["float16", "float32", "float64"] ) def test_clipped_beta_rvs(dtype): # Verify that the samples drawn from the beta distribution are never From dd90cb371eebeb1f4813b617c5d8d3471a8afeca Mon Sep 17 00:00:00 2001 From: Thomas Wiecki Date: Tue, 9 Mar 2021 09:48:13 +0100 Subject: [PATCH 2/4] Add float128 to release-notes. Add link to memoization PR. --- RELEASE-NOTES.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index cd12e84f2d..0ae7724278 100644 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -9,7 +9,8 @@ + ... ### Maintenance -- The `pymc3.memoize` module was removed and replaced with `cachetools`. The `hashable` function and `WithMemoization` class were moved to `pymc3.util`. +- The `pymc3.memoize` module was removed and replaced with `cachetools`. The `hashable` function and `WithMemoization` class were moved to `pymc3.util` (see [#4509](https://github.com/pymc-devs/pymc3/pull/4509)). +- Remove float128 dtype support (see [#4514](https://github.com/pymc-devs/pymc3/pull/4514)). ## PyMC3 3.11.1 (12 February 2021) From 89e28a317eb33f8f31b9d301a73eafdefed20815 Mon Sep 17 00:00:00 2001 From: Thomas Wiecki Date: Tue, 9 Mar 2021 09:54:27 +0100 Subject: [PATCH 3/4] Fix linting problem --- pymc3/tests/test_dist_math.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/pymc3/tests/test_dist_math.py b/pymc3/tests/test_dist_math.py index 297f3de0c5..ccf5f0865c 100644 --- a/pymc3/tests/test_dist_math.py +++ b/pymc3/tests/test_dist_math.py @@ -237,10 +237,7 @@ def test_grad(self): verify_grad(i0e, [[[0.5, -2.0]]]) -@pytest.mark.parametrize( - "dtype", - ["float16", "float32", "float64"] -) +@pytest.mark.parametrize("dtype", ["float16", "float32", "float64"]) def test_clipped_beta_rvs(dtype): # Verify that the samples drawn from the beta distribution are never # equal to zero or one (issue #3898) From a8d79505afd55476903c895c2b05257fd8c0004e Mon Sep 17 00:00:00 2001 From: Thomas Wiecki Date: Tue, 9 Mar 2021 10:00:36 +0100 Subject: [PATCH 4/4] Remove unused imports. --- pymc3/distributions/dist_math.py | 4 +--- pymc3/tests/test_dist_math.py | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/pymc3/distributions/dist_math.py b/pymc3/distributions/dist_math.py index 3ed3f1f151..90ff0c1908 100644 --- a/pymc3/distributions/dist_math.py +++ b/pymc3/distributions/dist_math.py @@ -1,4 +1,4 @@ -# Copyright 2020 The PyMC Developers +# Copyright 2021 The PyMC Developers # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -17,8 +17,6 @@ @author: johnsalvatier """ -import platform - import aesara import aesara.tensor as aet import numpy as np diff --git a/pymc3/tests/test_dist_math.py b/pymc3/tests/test_dist_math.py index ccf5f0865c..df9c5ddb68 100644 --- a/pymc3/tests/test_dist_math.py +++ b/pymc3/tests/test_dist_math.py @@ -1,4 +1,4 @@ -# Copyright 2020 The PyMC Developers +# Copyright 2021 The PyMC Developers # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -11,8 +11,6 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -import sys - import aesara import aesara.tensor as aet import numpy as np