copulas 0.12.2__py3-none-any.whl → 0.12.3__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of copulas might be problematic. Click here for more details.

copulas/__init__.py CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  __author__ = 'DataCebo, Inc.'
4
4
  __email__ = 'info@sdv.dev'
5
- __version__ = '0.12.2'
5
+ __version__ = '0.12.3'
6
6
 
7
7
  import sys
8
8
  import warnings
@@ -4,6 +4,7 @@ import numpy as np
4
4
  from scipy.stats import beta
5
5
 
6
6
  from copulas.univariate.base import BoundedType, ParametricType, ScipyModel
7
+ from copulas.utils import EPSILON
7
8
 
8
9
 
9
10
  class BetaUnivariate(ScipyModel):
@@ -25,9 +26,19 @@ class BetaUnivariate(ScipyModel):
25
26
  }
26
27
 
27
28
  def _fit(self, X):
28
- loc = np.min(X)
29
- scale = np.max(X) - loc
30
- a, b, loc, scale = beta.fit(X, loc=loc, scale=scale)
29
+ min_x = np.min(X)
30
+ max_x = np.max(X)
31
+ a, b, loc, scale = beta.fit(X, loc=min_x, scale=max_x - min_x)
32
+
33
+ if loc > max_x or scale + loc < min_x:
34
+ raise ValueError(
35
+ 'Converged parameters for beta distribution are '
36
+ 'outside the min/max range of the data.'
37
+ )
38
+
39
+ if scale < EPSILON:
40
+ raise ValueError('Converged parameters for beta distribution have a near-zero range.')
41
+
31
42
  self._params = {'loc': loc, 'scale': scale, 'a': a, 'b': b}
32
43
 
33
44
  def _is_constant(self):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: copulas
3
- Version: 0.12.2
3
+ Version: 0.12.3
4
4
  Summary: Create tabular synthetic data using copulas-based modeling.
5
5
  Author-email: "DataCebo, Inc." <info@sdv.dev>
6
6
  License: BSL-1.1
@@ -49,7 +49,6 @@ Requires-Dist: copulas[tutorials]; extra == "test"
49
49
  Requires-Dist: pytest>=6.2.5; extra == "test"
50
50
  Requires-Dist: pytest-cov>=2.6.0; extra == "test"
51
51
  Requires-Dist: pytest-rerunfailures>=10.3; extra == "test"
52
- Requires-Dist: rundoc>=0.4.3; extra == "test"
53
52
  Requires-Dist: tomli>=2.0.0; extra == "test"
54
53
  Provides-Extra: dev
55
54
  Requires-Dist: copulas[test,tutorials]; extra == "dev"
@@ -70,7 +69,7 @@ Requires-Dist: lxml-html-clean<0.5,>=0.4.1; extra == "dev"
70
69
  Requires-Dist: Jinja2<3.2,>=3.1.6; extra == "dev"
71
70
  Requires-Dist: myst_parser<4.1,>=3.0.1; extra == "dev"
72
71
  Requires-Dist: ruff<1,>=0.3.2; extra == "dev"
73
- Requires-Dist: twine<4,>=1.10.0; extra == "dev"
72
+ Requires-Dist: twine>=1.10.0; extra == "dev"
74
73
  Requires-Dist: wheel>=0.30.0; extra == "dev"
75
74
  Requires-Dist: coverage<7.8,>=7.7.1; extra == "dev"
76
75
  Requires-Dist: tox<4,>=2.9.1; extra == "dev"
@@ -79,6 +78,8 @@ Requires-Dist: urllib3<2.4,>=1.26.20; extra == "dev"
79
78
  Requires-Dist: tabulate<0.10,>=0.9.0; extra == "dev"
80
79
  Requires-Dist: boto3<1.38,>=1.37.18; extra == "dev"
81
80
  Requires-Dist: docutils<0.22,>=0.21.2; extra == "dev"
81
+ Provides-Extra: readme
82
+ Requires-Dist: rundoc<0.5,>=0.4.3; extra == "readme"
82
83
  Dynamic: license-file
83
84
 
84
85
  <p style="text-align:center">
@@ -1,4 +1,4 @@
1
- copulas/__init__.py,sha256=7qN4tEX3M3RIJDHAZQvQ3OIqM-JIm9Xm8mV_9a6j764,2924
1
+ copulas/__init__.py,sha256=5OzvqQ1zZM0ZeDpPzgx92SE5QaHOqSmQvYjc-OOUcN4,2924
2
2
  copulas/datasets.py,sha256=uyiiEV2E_vztiIEIFR71yzMYXu_ZAlnP04Mhcv-me_0,6769
3
3
  copulas/errors.py,sha256=YDb1uhFOsht_9ynu4MYyZJgdUQWoI_WoWzG1JfGdvzU,93
4
4
  copulas/utils.py,sha256=2wWVVx-FMOhjPDt58ZgfFHQzVdLsMo44IPh7ccaIALE,6789
@@ -18,7 +18,7 @@ copulas/multivariate/vine.py,sha256=DXEaKJ14mWkpUFAapV6cPjZs_7qQRyFfUqDZ5EX5rjs,
18
18
  copulas/optimize/__init__.py,sha256=x3KLFTF3CoO3-7vCxAK8PRAkVKpVHhcoJW0oDwGkPvg,4941
19
19
  copulas/univariate/__init__.py,sha256=5j1pTKG1hVEn9wmAumLnVghR7eKI_Wv5sceXTr-aOUY,826
20
20
  copulas/univariate/base.py,sha256=Gz4dry15fI8yxB6tGLFkP8KSILizQCVeWDz2lS5_TYQ,20060
21
- copulas/univariate/beta.py,sha256=l_aTwzDfmZmDwMdBZL6vye8SoOTGWNy9akNFN0DMhOU,958
21
+ copulas/univariate/beta.py,sha256=8i1L7gmAdovEtd7X64SO2ujTTvEaZJIOVwzj6ylrqgE,1342
22
22
  copulas/univariate/gamma.py,sha256=az8-3sMbp1-K16SxtW6qJ4fRKxoXg0XSyKNxH_x86tM,906
23
23
  copulas/univariate/gaussian.py,sha256=ZRxwg-YNr8QHDGA0locVBYLKEi0dyOzoMZthRh3P0SA,660
24
24
  copulas/univariate/gaussian_kde.py,sha256=vF7RY9KmOrnGlBUWBu34iubsJ9iLNAnJRgZTcbo7aIs,6077
@@ -27,8 +27,8 @@ copulas/univariate/selection.py,sha256=nETHnLB89lTf5CPSEX28Xu2cNySQU7yhW2gZRu4Ot
27
27
  copulas/univariate/student_t.py,sha256=r4_sHdEX4C74byC5_i60e8f2DT-J8RqGyjzeCtZkwbM,777
28
28
  copulas/univariate/truncated_gaussian.py,sha256=ugr3Lm-rzadRIwsi1FTYpziNoNiP7t2iBQNGbfrFrKs,1999
29
29
  copulas/univariate/uniform.py,sha256=BkGaEZkitKpDAEkMscvLVLJ4U-j6gZuZqnZiBtCVr8Y,686
30
- copulas-0.12.2.dist-info/licenses/LICENSE,sha256=cORU2kpIo9Qyy7Kv2ZpYDIIcksrjqlNEL9c9Ic1ayo0,4822
31
- copulas-0.12.2.dist-info/METADATA,sha256=1V8W3bjanIs61q_9zfWgmfRRNA3JdF68iwf3EojE3nc,9446
32
- copulas-0.12.2.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
33
- copulas-0.12.2.dist-info/top_level.txt,sha256=xNXWuWoZ-U3Gb734WqQxkF5RIeGDVU3IstjD-RnWsk8,8
34
- copulas-0.12.2.dist-info/RECORD,,
30
+ copulas-0.12.3.dist-info/licenses/LICENSE,sha256=cORU2kpIo9Qyy7Kv2ZpYDIIcksrjqlNEL9c9Ic1ayo0,4822
31
+ copulas-0.12.3.dist-info/METADATA,sha256=cJtFKGmdJFMuUkIDrdGf0SpQJJ9CXGt-XKFQ_PhsDnY,9473
32
+ copulas-0.12.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
33
+ copulas-0.12.3.dist-info/top_level.txt,sha256=xNXWuWoZ-U3Gb734WqQxkF5RIeGDVU3IstjD-RnWsk8,8
34
+ copulas-0.12.3.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (78.1.0)
2
+ Generator: setuptools (80.9.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5