copulas 0.12.4.dev2__tar.gz → 0.12.4.dev3__tar.gz

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.
Files changed (40) hide show
  1. {copulas-0.12.4.dev2 → copulas-0.12.4.dev3}/PKG-INFO +2 -4
  2. {copulas-0.12.4.dev2 → copulas-0.12.4.dev3}/copulas/__init__.py +1 -1
  3. {copulas-0.12.4.dev2 → copulas-0.12.4.dev3}/copulas/bivariate/base.py +1 -1
  4. {copulas-0.12.4.dev2 → copulas-0.12.4.dev3}/copulas/bivariate/frank.py +1 -1
  5. {copulas-0.12.4.dev2 → copulas-0.12.4.dev3}/copulas/multivariate/tree.py +2 -2
  6. {copulas-0.12.4.dev2 → copulas-0.12.4.dev3}/copulas/multivariate/vine.py +4 -6
  7. {copulas-0.12.4.dev2 → copulas-0.12.4.dev3}/copulas/univariate/beta.py +14 -3
  8. {copulas-0.12.4.dev2 → copulas-0.12.4.dev3}/copulas.egg-info/PKG-INFO +2 -4
  9. {copulas-0.12.4.dev2 → copulas-0.12.4.dev3}/copulas.egg-info/requires.txt +0 -1
  10. {copulas-0.12.4.dev2 → copulas-0.12.4.dev3}/pyproject.toml +2 -5
  11. {copulas-0.12.4.dev2 → copulas-0.12.4.dev3}/LICENSE +0 -0
  12. {copulas-0.12.4.dev2 → copulas-0.12.4.dev3}/README.md +0 -0
  13. {copulas-0.12.4.dev2 → copulas-0.12.4.dev3}/copulas/bivariate/__init__.py +0 -0
  14. {copulas-0.12.4.dev2 → copulas-0.12.4.dev3}/copulas/bivariate/clayton.py +0 -0
  15. {copulas-0.12.4.dev2 → copulas-0.12.4.dev3}/copulas/bivariate/gumbel.py +0 -0
  16. {copulas-0.12.4.dev2 → copulas-0.12.4.dev3}/copulas/bivariate/independence.py +0 -0
  17. {copulas-0.12.4.dev2 → copulas-0.12.4.dev3}/copulas/bivariate/utils.py +0 -0
  18. {copulas-0.12.4.dev2 → copulas-0.12.4.dev3}/copulas/datasets.py +0 -0
  19. {copulas-0.12.4.dev2 → copulas-0.12.4.dev3}/copulas/errors.py +0 -0
  20. {copulas-0.12.4.dev2 → copulas-0.12.4.dev3}/copulas/multivariate/__init__.py +0 -0
  21. {copulas-0.12.4.dev2 → copulas-0.12.4.dev3}/copulas/multivariate/base.py +0 -0
  22. {copulas-0.12.4.dev2 → copulas-0.12.4.dev3}/copulas/multivariate/gaussian.py +0 -0
  23. {copulas-0.12.4.dev2 → copulas-0.12.4.dev3}/copulas/optimize/__init__.py +0 -0
  24. {copulas-0.12.4.dev2 → copulas-0.12.4.dev3}/copulas/univariate/__init__.py +0 -0
  25. {copulas-0.12.4.dev2 → copulas-0.12.4.dev3}/copulas/univariate/base.py +0 -0
  26. {copulas-0.12.4.dev2 → copulas-0.12.4.dev3}/copulas/univariate/gamma.py +0 -0
  27. {copulas-0.12.4.dev2 → copulas-0.12.4.dev3}/copulas/univariate/gaussian.py +0 -0
  28. {copulas-0.12.4.dev2 → copulas-0.12.4.dev3}/copulas/univariate/gaussian_kde.py +0 -0
  29. {copulas-0.12.4.dev2 → copulas-0.12.4.dev3}/copulas/univariate/log_laplace.py +0 -0
  30. {copulas-0.12.4.dev2 → copulas-0.12.4.dev3}/copulas/univariate/selection.py +0 -0
  31. {copulas-0.12.4.dev2 → copulas-0.12.4.dev3}/copulas/univariate/student_t.py +0 -0
  32. {copulas-0.12.4.dev2 → copulas-0.12.4.dev3}/copulas/univariate/truncated_gaussian.py +0 -0
  33. {copulas-0.12.4.dev2 → copulas-0.12.4.dev3}/copulas/univariate/uniform.py +0 -0
  34. {copulas-0.12.4.dev2 → copulas-0.12.4.dev3}/copulas/utils.py +0 -0
  35. {copulas-0.12.4.dev2 → copulas-0.12.4.dev3}/copulas/visualization.py +0 -0
  36. {copulas-0.12.4.dev2 → copulas-0.12.4.dev3}/copulas.egg-info/SOURCES.txt +0 -0
  37. {copulas-0.12.4.dev2 → copulas-0.12.4.dev3}/copulas.egg-info/dependency_links.txt +0 -0
  38. {copulas-0.12.4.dev2 → copulas-0.12.4.dev3}/copulas.egg-info/top_level.txt +0 -0
  39. {copulas-0.12.4.dev2 → copulas-0.12.4.dev3}/setup.cfg +0 -0
  40. {copulas-0.12.4.dev2 → copulas-0.12.4.dev3}/tests/test_tasks.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: copulas
3
- Version: 0.12.4.dev2
3
+ Version: 0.12.4.dev3
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
@@ -15,14 +15,13 @@ Classifier: Intended Audience :: Developers
15
15
  Classifier: License :: Free for non-commercial use
16
16
  Classifier: Natural Language :: English
17
17
  Classifier: Programming Language :: Python :: 3
18
- Classifier: Programming Language :: Python :: 3.8
19
18
  Classifier: Programming Language :: Python :: 3.9
20
19
  Classifier: Programming Language :: Python :: 3.10
21
20
  Classifier: Programming Language :: Python :: 3.11
22
21
  Classifier: Programming Language :: Python :: 3.12
23
22
  Classifier: Programming Language :: Python :: 3.13
24
23
  Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
25
- Requires-Python: <3.14,>=3.8
24
+ Requires-Python: <3.14,>=3.9
26
25
  Description-Content-Type: text/markdown
27
26
  License-File: LICENSE
28
27
  Requires-Dist: numpy>=1.21.0; python_version < "3.10"
@@ -72,7 +71,6 @@ Requires-Dist: ruff<1,>=0.3.2; extra == "dev"
72
71
  Requires-Dist: twine>=1.10.0; extra == "dev"
73
72
  Requires-Dist: wheel>=0.30.0; extra == "dev"
74
73
  Requires-Dist: coverage<7.8,>=7.7.1; extra == "dev"
75
- Requires-Dist: tox<4,>=2.9.1; extra == "dev"
76
74
  Requires-Dist: invoke; extra == "dev"
77
75
  Requires-Dist: urllib3<2.4,>=1.26.20; extra == "dev"
78
76
  Requires-Dist: tabulate<0.10,>=0.9.0; extra == "dev"
@@ -2,7 +2,7 @@
2
2
 
3
3
  __author__ = 'DataCebo, Inc.'
4
4
  __email__ = 'info@sdv.dev'
5
- __version__ = '0.12.4.dev2'
5
+ __version__ = '0.12.4.dev3'
6
6
 
7
7
  import sys
8
8
  import warnings
@@ -341,7 +341,7 @@ class Bivariate(object):
341
341
  self.check_fit()
342
342
 
343
343
  X = np.column_stack((U, V))
344
- return self.partial_derivative(X)
344
+ return self.partial_derivative(X).item()
345
345
 
346
346
  def set_random_state(self, random_state):
347
347
  """Set the random state.
@@ -166,5 +166,5 @@ class Frank(Bivariate):
166
166
  def debye(t):
167
167
  return t / (np.exp(t) - 1)
168
168
 
169
- debye_value = integrate.quad(debye, EPSILON, alpha)[0] / alpha
169
+ debye_value = integrate.quad(debye, EPSILON, alpha.item())[0] / alpha
170
170
  return 4 * (debye_value - 1) / alpha + 1 - self.tau
@@ -202,8 +202,8 @@ class Tree(Multivariate):
202
202
  for i in range(num_edge):
203
203
  edge = self.edges[i]
204
204
  value, left_u, right_u = edge.get_likelihood(uni_matrix)
205
- new_uni_matrix[edge.L, edge.R] = left_u
206
- new_uni_matrix[edge.R, edge.L] = right_u
205
+ new_uni_matrix[edge.L, edge.R] = left_u.item()
206
+ new_uni_matrix[edge.R, edge.L] = right_u.item()
207
207
  values[0, i] = np.log(value)
208
208
 
209
209
  return np.sum(values), new_uni_matrix
@@ -1,7 +1,6 @@
1
1
  """VineCopula module."""
2
2
 
3
3
  import logging
4
- import sys
5
4
  import warnings
6
5
 
7
6
  import numpy as np
@@ -74,10 +73,9 @@ class VineCopula(Multivariate):
74
73
 
75
74
  @store_args
76
75
  def __init__(self, vine_type, random_state=None):
77
- if sys.version_info > (3, 8):
78
- warnings.warn(
79
- 'Vines have not been fully tested on Python >= 3.8 and might produce wrong results.'
80
- )
76
+ warnings.warn(
77
+ 'Vines have not been fully tested on Python >= 3.8 and might produce wrong results.'
78
+ )
81
79
 
82
80
  self.random_state = validate_random_state(random_state)
83
81
  self.vine_type = vine_type
@@ -331,7 +329,7 @@ class VineCopula(Multivariate):
331
329
 
332
330
  new_x = self.ppfs[current](np.array([tmp]))
333
331
 
334
- sampled[current] = new_x
332
+ sampled[current] = new_x.item()
335
333
 
336
334
  for s in neighbors:
337
335
  if s not in visited:
@@ -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.4.dev2
3
+ Version: 0.12.4.dev3
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
@@ -15,14 +15,13 @@ Classifier: Intended Audience :: Developers
15
15
  Classifier: License :: Free for non-commercial use
16
16
  Classifier: Natural Language :: English
17
17
  Classifier: Programming Language :: Python :: 3
18
- Classifier: Programming Language :: Python :: 3.8
19
18
  Classifier: Programming Language :: Python :: 3.9
20
19
  Classifier: Programming Language :: Python :: 3.10
21
20
  Classifier: Programming Language :: Python :: 3.11
22
21
  Classifier: Programming Language :: Python :: 3.12
23
22
  Classifier: Programming Language :: Python :: 3.13
24
23
  Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
25
- Requires-Python: <3.14,>=3.8
24
+ Requires-Python: <3.14,>=3.9
26
25
  Description-Content-Type: text/markdown
27
26
  License-File: LICENSE
28
27
  Requires-Dist: numpy>=1.21.0; python_version < "3.10"
@@ -72,7 +71,6 @@ Requires-Dist: ruff<1,>=0.3.2; extra == "dev"
72
71
  Requires-Dist: twine>=1.10.0; extra == "dev"
73
72
  Requires-Dist: wheel>=0.30.0; extra == "dev"
74
73
  Requires-Dist: coverage<7.8,>=7.7.1; extra == "dev"
75
- Requires-Dist: tox<4,>=2.9.1; extra == "dev"
76
74
  Requires-Dist: invoke; extra == "dev"
77
75
  Requires-Dist: urllib3<2.4,>=1.26.20; extra == "dev"
78
76
  Requires-Dist: tabulate<0.10,>=0.9.0; extra == "dev"
@@ -49,7 +49,6 @@ ruff<1,>=0.3.2
49
49
  twine>=1.10.0
50
50
  wheel>=0.30.0
51
51
  coverage<7.8,>=7.7.1
52
- tox<4,>=2.9.1
53
52
  invoke
54
53
  urllib3<2.4,>=1.26.20
55
54
  tabulate<0.10,>=0.9.0
@@ -8,7 +8,6 @@ classifiers = [
8
8
  'License :: Free for non-commercial use',
9
9
  'Natural Language :: English',
10
10
  'Programming Language :: Python :: 3',
11
- 'Programming Language :: Python :: 3.8',
12
11
  'Programming Language :: Python :: 3.9',
13
12
  'Programming Language :: Python :: 3.10',
14
13
  'Programming Language :: Python :: 3.11',
@@ -19,7 +18,7 @@ classifiers = [
19
18
  keywords = [ 'copulas' ]
20
19
  dynamic = ["version"]
21
20
  license = { text = 'BSL-1.1' }
22
- requires-python = '>=3.8,<3.14'
21
+ requires-python = '>=3.9,<3.14'
23
22
  readme = 'README.md'
24
23
  dependencies = [
25
24
  "numpy>=1.21.0;python_version<'3.10'",
@@ -98,7 +97,6 @@ dev = [
98
97
 
99
98
  # Advanced testing
100
99
  'coverage >= 7.7.1, <7.8',
101
- 'tox >= 2.9.1,<4',
102
100
  'invoke',
103
101
 
104
102
  # Large scale evaluation
@@ -152,7 +150,7 @@ namespaces = false
152
150
  ]
153
151
 
154
152
  [tool.bumpversion]
155
- current_version = "0.12.4.dev2"
153
+ current_version = "0.12.4.dev3"
156
154
  commit = true
157
155
  tag = true
158
156
  parse = '(?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\.(?P<release>[a-z]+)(?P<candidate>\d+))?'
@@ -181,7 +179,6 @@ src = ["copulas"]
181
179
  target-version = "py312"
182
180
  exclude = [
183
181
  "docs",
184
- ".tox",
185
182
  ".git",
186
183
  "__pycache__",
187
184
  ".ipynb_checkpoints",
File without changes
File without changes
File without changes