copulas 0.11.0__tar.gz → 0.11.1__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.

Potentially problematic release.


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

Files changed (40) hide show
  1. {copulas-0.11.0 → copulas-0.11.1}/PKG-INFO +11 -34
  2. {copulas-0.11.0 → copulas-0.11.1}/copulas/__init__.py +5 -6
  3. {copulas-0.11.0 → copulas-0.11.1}/copulas/bivariate/__init__.py +2 -2
  4. {copulas-0.11.0 → copulas-0.11.1}/copulas/bivariate/base.py +6 -8
  5. {copulas-0.11.0 → copulas-0.11.1}/copulas/bivariate/clayton.py +3 -2
  6. {copulas-0.11.0 → copulas-0.11.1}/copulas/bivariate/frank.py +1 -0
  7. {copulas-0.11.0 → copulas-0.11.1}/copulas/datasets.py +2 -9
  8. {copulas-0.11.0 → copulas-0.11.1}/copulas/multivariate/__init__.py +1 -7
  9. {copulas-0.11.0 → copulas-0.11.1}/copulas/multivariate/gaussian.py +9 -4
  10. {copulas-0.11.0 → copulas-0.11.1}/copulas/multivariate/tree.py +11 -13
  11. {copulas-0.11.0 → copulas-0.11.1}/copulas/multivariate/vine.py +12 -6
  12. {copulas-0.11.0 → copulas-0.11.1}/copulas/optimize/__init__.py +4 -3
  13. {copulas-0.11.0 → copulas-0.11.1}/copulas/univariate/__init__.py +1 -1
  14. {copulas-0.11.0 → copulas-0.11.1}/copulas/univariate/base.py +15 -4
  15. {copulas-0.11.0 → copulas-0.11.1}/copulas/univariate/beta.py +1 -6
  16. {copulas-0.11.0 → copulas-0.11.1}/copulas/univariate/gaussian.py +2 -8
  17. {copulas-0.11.0 → copulas-0.11.1}/copulas/univariate/gaussian_kde.py +5 -6
  18. {copulas-0.11.0 → copulas-0.11.1}/copulas/univariate/student_t.py +1 -5
  19. {copulas-0.11.0 → copulas-0.11.1}/copulas/univariate/truncated_gaussian.py +8 -16
  20. {copulas-0.11.0 → copulas-0.11.1}/copulas/univariate/uniform.py +2 -8
  21. {copulas-0.11.0 → copulas-0.11.1}/copulas/visualization.py +15 -20
  22. {copulas-0.11.0 → copulas-0.11.1}/copulas.egg-info/PKG-INFO +11 -34
  23. {copulas-0.11.0 → copulas-0.11.1}/copulas.egg-info/SOURCES.txt +0 -1
  24. copulas-0.11.1/copulas.egg-info/requires.txt +71 -0
  25. {copulas-0.11.0 → copulas-0.11.1}/pyproject.toml +61 -39
  26. copulas-0.11.1/setup.cfg +4 -0
  27. copulas-0.11.0/copulas.egg-info/requires.txt +0 -90
  28. copulas-0.11.0/setup.cfg +0 -23
  29. {copulas-0.11.0 → copulas-0.11.1}/LICENSE +0 -0
  30. {copulas-0.11.0 → copulas-0.11.1}/README.md +0 -0
  31. {copulas-0.11.0 → copulas-0.11.1}/copulas/bivariate/gumbel.py +0 -0
  32. {copulas-0.11.0 → copulas-0.11.1}/copulas/bivariate/independence.py +0 -0
  33. {copulas-0.11.0 → copulas-0.11.1}/copulas/bivariate/utils.py +0 -0
  34. {copulas-0.11.0 → copulas-0.11.1}/copulas/multivariate/base.py +0 -0
  35. {copulas-0.11.0 → copulas-0.11.1}/copulas/univariate/gamma.py +0 -0
  36. {copulas-0.11.0 → copulas-0.11.1}/copulas/univariate/log_laplace.py +0 -0
  37. {copulas-0.11.0 → copulas-0.11.1}/copulas/univariate/selection.py +0 -0
  38. {copulas-0.11.0 → copulas-0.11.1}/copulas.egg-info/dependency_links.txt +0 -0
  39. {copulas-0.11.0 → copulas-0.11.1}/copulas.egg-info/top_level.txt +0 -0
  40. {copulas-0.11.0 → copulas-0.11.1}/tests/test_tasks.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: copulas
3
- Version: 0.11.0
3
+ Version: 0.11.1
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
@@ -24,20 +24,20 @@ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
24
24
  Requires-Python: <3.13,>=3.8
25
25
  Description-Content-Type: text/markdown
26
26
  License-File: LICENSE
27
- Requires-Dist: numpy>=1.20.0; python_version < "3.10"
27
+ Requires-Dist: numpy>=1.21.0; python_version < "3.10"
28
28
  Requires-Dist: numpy>=1.23.3; python_version >= "3.10" and python_version < "3.12"
29
29
  Requires-Dist: numpy>=1.26.0; python_version >= "3.12"
30
- Requires-Dist: pandas>=1.1.3; python_version < "3.10"
31
- Requires-Dist: pandas>=1.3.4; python_version >= "3.10" and python_version < "3.11"
32
- Requires-Dist: pandas>=1.5.0; python_version >= "3.11"
30
+ Requires-Dist: pandas>=1.4.0; python_version < "3.11"
31
+ Requires-Dist: pandas>=1.5.0; python_version >= "3.11" and python_version < "3.12"
32
+ Requires-Dist: pandas>=2.1.1; python_version >= "3.12"
33
33
  Requires-Dist: plotly>=5.10.0
34
- Requires-Dist: scipy>=1.5.4; python_version < "3.10"
34
+ Requires-Dist: scipy>=1.7.3; python_version < "3.10"
35
35
  Requires-Dist: scipy>=1.9.2; python_version >= "3.10" and python_version < "3.12"
36
36
  Requires-Dist: scipy>=1.12.0; python_version >= "3.12"
37
37
  Provides-Extra: tutorials
38
38
  Requires-Dist: markupsafe<=2.0.1; extra == "tutorials"
39
- Requires-Dist: scikit-learn<1.2,>=0.24; python_version < "3.10" and extra == "tutorials"
40
- Requires-Dist: scikit-learn<1.5,>=0.24; python_version >= "3.10" and extra == "tutorials"
39
+ Requires-Dist: scikit-learn>=0.24; python_version < "3.12" and extra == "tutorials"
40
+ Requires-Dist: scikit-learn>=1.3.1; python_version >= "3.12" and extra == "tutorials"
41
41
  Requires-Dist: jupyter<2,>=1.0.0; extra == "tutorials"
42
42
  Provides-Extra: test
43
43
  Requires-Dist: copulas[tutorials]; extra == "test"
@@ -62,37 +62,14 @@ Requires-Dist: sphinxcontrib-htmlhelp<2.0.5; extra == "dev"
62
62
  Requires-Dist: sphinxcontrib_serializinghtml<1.1.10; extra == "dev"
63
63
  Requires-Dist: sphinxcontrib_qthelp<1.0.7; extra == "dev"
64
64
  Requires-Dist: alabaster<0.7.13; extra == "dev"
65
- Requires-Dist: Jinja2<3,>=2; extra == "dev"
66
- Requires-Dist: flake8<4,>=3.7.7; extra == "dev"
67
- Requires-Dist: isort<5,>=4.3.4; extra == "dev"
68
- Requires-Dist: flake8-debugger<4.1,>=4.0.0; extra == "dev"
69
- Requires-Dist: flake8-mock<0.4,>=0.3; extra == "dev"
70
- Requires-Dist: flake8-mutable<1.3,>=1.2.0; extra == "dev"
71
- Requires-Dist: flake8-fixme<1.2,>=1.1.1; extra == "dev"
72
- Requires-Dist: pep8-naming<0.13,>=0.12.1; extra == "dev"
73
- Requires-Dist: dlint<0.12,>=0.11.0; extra == "dev"
74
- Requires-Dist: flake8-docstrings<2,>=1.5.0; extra == "dev"
75
- Requires-Dist: pydocstyle<6.2,>=6.1.1; extra == "dev"
76
- Requires-Dist: flake8-pytest-style<2,>=1.5.0; extra == "dev"
77
- Requires-Dist: flake8-comprehensions<3.7,>=3.6.1; extra == "dev"
78
- Requires-Dist: flake8-print<4.1,>=4.0.0; extra == "dev"
79
- Requires-Dist: flake8-expression-complexity<0.1,>=0.0.9; extra == "dev"
80
- Requires-Dist: flake8-multiline-containers<0.1,>=0.0.18; extra == "dev"
81
- Requires-Dist: pandas-vet<0.3,>=0.2.2; extra == "dev"
82
- Requires-Dist: flake8-builtins<1.6,>=1.5.3; extra == "dev"
83
- Requires-Dist: flake8-eradicate<1.2,>=1.1.0; extra == "dev"
84
- Requires-Dist: flake8-quotes<4,>=3.3.0; extra == "dev"
85
- Requires-Dist: flake8-variables-names<0.1,>=0.0.4; extra == "dev"
86
- Requires-Dist: flake8-sfs<0.1,>=0.0.3; extra == "dev"
87
- Requires-Dist: flake8-absolute-import<2,>=1.0; extra == "dev"
88
- Requires-Dist: autoflake<2,>=1.1; extra == "dev"
89
- Requires-Dist: autopep8<1.6,>=1.4.3; extra == "dev"
65
+ Requires-Dist: Jinja2<3,>=2; python_version < "3.12" and extra == "dev"
66
+ Requires-Dist: Jinja2<4,>=2; python_version >= "3.12" and extra == "dev"
67
+ Requires-Dist: ruff<1,>=0.3.2; extra == "dev"
90
68
  Requires-Dist: twine<4,>=1.10.0; extra == "dev"
91
69
  Requires-Dist: wheel>=0.30.0; extra == "dev"
92
70
  Requires-Dist: coverage<6,>=4.5.1; extra == "dev"
93
71
  Requires-Dist: tox<4,>=2.9.1; extra == "dev"
94
72
  Requires-Dist: invoke; extra == "dev"
95
- Requires-Dist: doc8<0.9,>=0.8.0; extra == "dev"
96
73
  Requires-Dist: urllib3<1.26,>=1.20; extra == "dev"
97
74
  Requires-Dist: tabulate<0.9,>=0.8.3; extra == "dev"
98
75
  Requires-Dist: boto3<1.10,>=1.7.47; extra == "dev"
@@ -4,7 +4,7 @@
4
4
 
5
5
  __author__ = 'DataCebo, Inc.'
6
6
  __email__ = 'info@sdv.dev'
7
- __version__ = '0.11.0'
7
+ __version__ = '0.11.1'
8
8
 
9
9
  import contextlib
10
10
  import importlib
@@ -86,7 +86,8 @@ def validate_random_state(random_state):
86
86
  else:
87
87
  raise TypeError(
88
88
  f'`random_state` {random_state} expected to be an int '
89
- 'or `np.random.RandomState` object.')
89
+ 'or `np.random.RandomState` object.'
90
+ )
90
91
 
91
92
 
92
93
  def get_instance(obj, **kwargs):
@@ -192,8 +193,7 @@ def vectorize(function):
192
193
 
193
194
  if len(X.shape) == 2:
194
195
  return np.fromiter(
195
- (function(self, *x, *args, **kwargs) for x in X),
196
- np.dtype('float64')
196
+ (function(self, *x, *args, **kwargs) for x in X), np.dtype('float64')
197
197
  )
198
198
 
199
199
  else:
@@ -243,7 +243,6 @@ def check_valid_values(function):
243
243
  """
244
244
 
245
245
  def decorated(self, X, *args, **kwargs):
246
-
247
246
  if isinstance(X, pd.DataFrame):
248
247
  W = X.to_numpy()
249
248
 
@@ -321,7 +320,7 @@ def _find_addons():
321
320
  try:
322
321
  addon = entry_point.load()
323
322
  except Exception: # pylint: disable=broad-exception-caught
324
- msg = f'Failed to load "{entry_point.name}" from "{entry_point.module_name}".'
323
+ msg = f'Failed to load "{entry_point.name}" from "{entry_point.value}".'
325
324
  warnings.warn(msg)
326
325
  continue
327
326
 
@@ -47,7 +47,6 @@ def _compute_empirical(X):
47
47
  right = sum(np.logical_and(U >= base[k], V >= base[k])) / N
48
48
 
49
49
  if left > 0:
50
-
51
50
  z_left.append(base[k])
52
51
  L.append(left / base[k] ** 2)
53
52
 
@@ -151,7 +150,8 @@ def select_copula(X):
151
150
 
152
151
  left_tail, empirical_left_aut, right_tail, empirical_right_aut = _compute_empirical(X)
153
152
  candidate_left_auts, candidate_right_auts = _compute_candidates(
154
- copula_candidates, left_tail, right_tail)
153
+ copula_candidates, left_tail, right_tail
154
+ )
155
155
 
156
156
  empirical_aut = np.concatenate((empirical_left_aut, empirical_right_aut))
157
157
  candidate_auts = [
@@ -96,7 +96,7 @@ class Bivariate(object):
96
96
  return super(Bivariate, cls).__new__(cls)
97
97
 
98
98
  if not isinstance(copula_type, CopulaTypes):
99
- if (isinstance(copula_type, str) and copula_type.upper() in CopulaTypes.__members__):
99
+ if isinstance(copula_type, str) and copula_type.upper() in CopulaTypes.__members__:
100
100
  copula_type = CopulaTypes[copula_type.upper()]
101
101
  else:
102
102
  raise ValueError(f'Invalid copula type {copula_type}')
@@ -192,11 +192,7 @@ class Bivariate(object):
192
192
  dict: Parameters of the copula.
193
193
 
194
194
  """
195
- return {
196
- 'copula_type': self.copula_type.name,
197
- 'theta': self.theta,
198
- 'tau': self.tau
199
- }
195
+ return {'copula_type': self.copula_type.name, 'theta': self.theta, 'tau': self.tau}
200
196
 
201
197
  @classmethod
202
198
  def from_dict(cls, copula_dict):
@@ -297,6 +293,7 @@ class Bivariate(object):
297
293
  self.check_fit()
298
294
  result = []
299
295
  for _y, _v in zip(y, V):
296
+
300
297
  def f(u):
301
298
  return self.partial_derivative_scalar(u, _v) - _y
302
299
 
@@ -330,7 +327,7 @@ class Bivariate(object):
330
327
  np.ndarray
331
328
 
332
329
  """
333
- delta = (-2 * (X[:, 1] > 0.5) + 1)
330
+ delta = -2 * (X[:, 1] > 0.5) + 1
334
331
  delta = 0.0001 * delta
335
332
  X_prime = X.copy()
336
333
  X_prime[:, 1] += delta
@@ -411,10 +408,11 @@ class Bivariate(object):
411
408
 
412
409
  """
413
410
  from copulas.bivariate import select_copula # noqa
411
+
414
412
  warnings.warn(
415
413
  '`Bivariate.select_copula` has been deprecated and will be removed in a later '
416
414
  'release. Please use `copulas.bivariate.select_copula` instead',
417
- DeprecationWarning
415
+ DeprecationWarning,
418
416
  )
419
417
  return select_copula(X)
420
418
 
@@ -84,9 +84,10 @@ class Clayton(Bivariate):
84
84
  cdfs = [
85
85
  np.power(
86
86
  np.power(U[i], -self.theta) + np.power(V[i], -self.theta) - 1,
87
- -1.0 / self.theta
87
+ -1.0 / self.theta,
88
88
  )
89
- if (U[i] > 0 and V[i] > 0) else 0
89
+ if (U[i] > 0 and V[i] > 0)
90
+ else 0
90
91
  for i in range(len(U))
91
92
  ]
92
93
 
@@ -162,6 +162,7 @@ class Frank(Bivariate):
162
162
 
163
163
  def _tau_to_theta(self, alpha):
164
164
  """Relationship between tau and theta as a solvable equation."""
165
+
165
166
  def debye(t):
166
167
  return t / (np.exp(t) - 1)
167
168
 
@@ -33,10 +33,7 @@ def sample_bivariate_age_income(size=1000, seed=42):
33
33
  income += np.random.normal(loc=np.log(age) / 100, scale=10, size=size)
34
34
  income[np.random.randint(0, 10, size=size) == 0] /= 1000
35
35
 
36
- return pd.DataFrame({
37
- 'age': age,
38
- 'income': income
39
- })
36
+ return pd.DataFrame({'age': age, 'income': income})
40
37
 
41
38
 
42
39
  def sample_trivariate_xyz(size=1000, seed=42):
@@ -61,11 +58,7 @@ def sample_trivariate_xyz(size=1000, seed=42):
61
58
  with set_random_state(validate_random_state(seed), _dummy_fn):
62
59
  x = stats.beta.rvs(a=0.1, b=0.1, size=size)
63
60
  y = stats.beta.rvs(a=0.1, b=0.5, size=size)
64
- return pd.DataFrame({
65
- 'x': x,
66
- 'y': y,
67
- 'z': np.random.normal(size=size) + y * 10
68
- })
61
+ return pd.DataFrame({'x': x, 'y': y, 'z': np.random.normal(size=size) + y * 10})
69
62
 
70
63
 
71
64
  def sample_univariate_bernoulli(size=1000, seed=42):
@@ -5,10 +5,4 @@ from copulas.multivariate.gaussian import GaussianMultivariate
5
5
  from copulas.multivariate.tree import Tree, TreeTypes
6
6
  from copulas.multivariate.vine import VineCopula
7
7
 
8
- __all__ = (
9
- 'Multivariate',
10
- 'GaussianMultivariate',
11
- 'VineCopula',
12
- 'Tree',
13
- 'TreeTypes'
14
- )
8
+ __all__ = ('Multivariate', 'GaussianMultivariate', 'VineCopula', 'Tree', 'TreeTypes')
@@ -8,8 +8,14 @@ import pandas as pd
8
8
  from scipy import stats
9
9
 
10
10
  from copulas import (
11
- EPSILON, check_valid_values, get_instance, get_qualified_name, random_state, store_args,
12
- validate_random_state)
11
+ EPSILON,
12
+ check_valid_values,
13
+ get_instance,
14
+ get_qualified_name,
15
+ random_state,
16
+ store_args,
17
+ validate_random_state,
18
+ )
13
19
  from copulas.multivariate.base import Multivariate
14
20
  from copulas.univariate import GaussianUnivariate, Univariate
15
21
 
@@ -149,8 +155,7 @@ class GaussianMultivariate(Multivariate):
149
155
  self.check_fit()
150
156
  transformed = self._transform_to_normal(X)
151
157
 
152
- return stats.multivariate_normal.pdf(
153
- transformed, cov=self.correlation, allow_singular=True)
158
+ return stats.multivariate_normal.pdf(transformed, cov=self.correlation, allow_singular=True)
154
159
 
155
160
  def cumulative_distribution(self, X):
156
161
  """Compute the cumulative distribution value for each point in X.
@@ -98,7 +98,7 @@ class Tree(Multivariate):
98
98
  """
99
99
  # first column is the variable of interest
100
100
  tau_y = self.tau_matrix[:, y]
101
- tau_y[y] = np.NaN
101
+ tau_y[y] = np.nan
102
102
 
103
103
  temp = np.empty([self.n_nodes, 3])
104
104
  temp[:, 0] = np.arange(self.n_nodes)
@@ -131,7 +131,7 @@ class Tree(Multivariate):
131
131
  left_parent, right_parent = edge.parents
132
132
  left_u, right_u = Edge.get_conditional_uni(left_parent, right_parent)
133
133
 
134
- tau[i, j], pvalue = scipy.stats.kendalltau(left_u, right_u)
134
+ tau[i, j], _pvalue = scipy.stats.kendalltau(left_u, right_u)
135
135
 
136
136
  return tau
137
137
 
@@ -212,8 +212,7 @@ class Tree(Multivariate):
212
212
  """Produce printable representation of the class."""
213
213
  template = 'L:{} R:{} D:{} Copula:{} Theta:{}'
214
214
  return '\n'.join([
215
- template.format(edge.L, edge.R, edge.D, edge.name, edge.theta)
216
- for edge in self.edges
215
+ template.format(edge.L, edge.R, edge.D, edge.name, edge.theta) for edge in self.edges
217
216
  ])
218
217
 
219
218
  def _serialize_previous_tree(self):
@@ -237,11 +236,7 @@ class Tree(Multivariate):
237
236
  Parameters of this Tree.
238
237
  """
239
238
  fitted = self.fitted
240
- result = {
241
- 'tree_type': self.tree_type,
242
- 'type': get_qualified_name(self),
243
- 'fitted': fitted
244
- }
239
+ result = {'tree_type': self.tree_type, 'type': get_qualified_name(self), 'fitted': fitted}
245
240
 
246
241
  if not fitted:
247
242
  return result
@@ -451,7 +446,7 @@ def get_tree(tree_type):
451
446
  Instance of a Tree of the specified type.
452
447
  """
453
448
  if not isinstance(tree_type, TreeTypes):
454
- if (isinstance(tree_type, str) and tree_type.upper() in TreeTypes.__members__):
449
+ if isinstance(tree_type, str) and tree_type.upper() in TreeTypes.__members__:
455
450
  tree_type = TreeTypes[tree_type.upper()]
456
451
  else:
457
452
  raise ValueError(f'Invalid tree type {tree_type}')
@@ -657,7 +652,7 @@ class Edge(object):
657
652
  'theta': self.theta,
658
653
  'tau': self.tau,
659
654
  'U': U,
660
- 'likelihood': self.likelihood
655
+ 'likelihood': self.likelihood,
661
656
  }
662
657
 
663
658
  @classmethod
@@ -674,8 +669,11 @@ class Edge(object):
674
669
  Instance of the edge defined on the parameters.
675
670
  """
676
671
  instance = cls(
677
- edge_dict['index'], edge_dict['L'], edge_dict['R'],
678
- edge_dict['name'], edge_dict['theta']
672
+ edge_dict['index'],
673
+ edge_dict['L'],
674
+ edge_dict['R'],
675
+ edge_dict['name'],
676
+ edge_dict['theta'],
679
677
  )
680
678
  instance.U = np.array(edge_dict['U'])
681
679
  parents = edge_dict['parents']
@@ -8,8 +8,13 @@ import numpy as np
8
8
  import pandas as pd
9
9
 
10
10
  from copulas import (
11
- EPSILON, check_valid_values, get_qualified_name, random_state, store_args,
12
- validate_random_state)
11
+ EPSILON,
12
+ check_valid_values,
13
+ get_qualified_name,
14
+ random_state,
15
+ store_args,
16
+ validate_random_state,
17
+ )
13
18
  from copulas.bivariate.base import Bivariate, CopulaTypes
14
19
  from copulas.multivariate.base import Multivariate
15
20
  from copulas.multivariate.tree import Tree, get_tree
@@ -103,7 +108,7 @@ class VineCopula(Multivariate):
103
108
  result = {
104
109
  'type': get_qualified_name(self),
105
110
  'vine_type': self.vine_type,
106
- 'fitted': self.fitted
111
+ 'fitted': self.fitted,
107
112
  }
108
113
 
109
114
  if not self.fitted:
@@ -118,7 +123,7 @@ class VineCopula(Multivariate):
118
123
  'tau_mat': self.tau_mat.tolist(),
119
124
  'u_matrix': self.u_matrix.tolist(),
120
125
  'unis': [distribution.to_dict() for distribution in self.unis],
121
- 'columns': self.columns
126
+ 'columns': self.columns,
122
127
  })
123
128
  return result
124
129
 
@@ -293,8 +298,9 @@ class VineCopula(Multivariate):
293
298
  # get index of edge to retrieve
294
299
  for edge in current_tree:
295
300
  if i == 0:
296
- if (edge.L == current and edge.R == visited[0]) or\
297
- (edge.R == current and edge.L == visited[0]):
301
+ if (edge.L == current and edge.R == visited[0]) or (
302
+ edge.R == current and edge.L == visited[0]
303
+ ):
298
304
  current_ind = edge.index
299
305
  break
300
306
  else:
@@ -127,7 +127,7 @@ def chandrupatla(f, xmin, xmax, eps_m=None, eps_a=None, maxiter=50):
127
127
  # to determine which method we should use next
128
128
  xi = (a - b) / (c - b)
129
129
  phi = (fa - fb) / (fc - fb)
130
- iqi = np.logical_and(phi**2 < xi, (1 - phi)**2 < 1 - xi)
130
+ iqi = np.logical_and(phi**2 < xi, (1 - phi) ** 2 < 1 - xi)
131
131
 
132
132
  if not shape:
133
133
  # scalar case
@@ -143,8 +143,9 @@ def chandrupatla(f, xmin, xmax, eps_m=None, eps_a=None, maxiter=50):
143
143
  # array case
144
144
  t = np.full(shape, 0.5)
145
145
  a2, b2, c2, fa2, fb2, fc2 = a[iqi], b[iqi], c[iqi], fa[iqi], fb[iqi], fc[iqi]
146
- t[iqi] = fa2 / (fb2 - fa2) * fc2 / (fb2 - fc2) + (c2 - a2) / \
147
- (b2 - a2) * fa2 / (fc2 - fa2) * fb2 / (fc2 - fb2)
146
+ t[iqi] = fa2 / (fb2 - fa2) * fc2 / (fb2 - fc2) + (c2 - a2) / (b2 - a2) * fa2 / (
147
+ fc2 - fa2
148
+ ) * fb2 / (fc2 - fb2)
148
149
 
149
150
  # limit to the range (tlim, 1-tlim)
150
151
  t = np.minimum(1 - tlim, np.maximum(tlim, t))
@@ -21,5 +21,5 @@ __all__ = (
21
21
  'ParametricType',
22
22
  'BoundedType',
23
23
  'UniformUnivariate',
24
- 'LogLaplace'
24
+ 'LogLaplace',
25
25
  )
@@ -7,8 +7,13 @@ from enum import Enum
7
7
  import numpy as np
8
8
 
9
9
  from copulas import (
10
- NotFittedError, get_instance, get_qualified_name, random_state, store_args,
11
- validate_random_state)
10
+ NotFittedError,
11
+ get_instance,
12
+ get_qualified_name,
13
+ random_state,
14
+ store_args,
15
+ validate_random_state,
16
+ )
12
17
  from copulas.univariate.selection import select_univariate
13
18
 
14
19
 
@@ -84,8 +89,14 @@ class Univariate(object):
84
89
  return candidates
85
90
 
86
91
  @store_args
87
- def __init__(self, candidates=None, parametric=None, bounded=None, random_state=None,
88
- selection_sample_size=None):
92
+ def __init__(
93
+ self,
94
+ candidates=None,
95
+ parametric=None,
96
+ bounded=None,
97
+ random_state=None,
98
+ selection_sample_size=None,
99
+ ):
89
100
  self.candidates = candidates or self._select_candidates(parametric, bounded)
90
101
  self.random_state = validate_random_state(random_state)
91
102
  self.selection_sample_size = selection_sample_size
@@ -28,12 +28,7 @@ class BetaUnivariate(ScipyModel):
28
28
  loc = np.min(X)
29
29
  scale = np.max(X) - loc
30
30
  a, b, loc, scale = beta.fit(X, loc=loc, scale=scale)
31
- self._params = {
32
- 'loc': loc,
33
- 'scale': scale,
34
- 'a': a,
35
- 'b': b
36
- }
31
+ self._params = {'loc': loc, 'scale': scale, 'a': a, 'b': b}
37
32
 
38
33
  def _is_constant(self):
39
34
  return self._params['scale'] == 0
@@ -15,16 +15,10 @@ class GaussianUnivariate(ScipyModel):
15
15
  MODEL_CLASS = norm
16
16
 
17
17
  def _fit_constant(self, X):
18
- self._params = {
19
- 'loc': np.unique(X)[0],
20
- 'scale': 0
21
- }
18
+ self._params = {'loc': np.unique(X)[0], 'scale': 0}
22
19
 
23
20
  def _fit(self, X):
24
- self._params = {
25
- 'loc': np.mean(X),
26
- 'scale': np.std(X)
27
- }
21
+ self._params = {'loc': np.mean(X), 'scale': np.std(X)}
28
22
 
29
23
  def _is_constant(self):
30
24
  return self._params['scale'] == 0
@@ -129,7 +129,7 @@ class GaussianKDE(ScipyModel):
129
129
  self.check_fit()
130
130
 
131
131
  if len(U.shape) > 1:
132
- raise ValueError(f'Expected 1d array, got {(U, )}.')
132
+ raise ValueError(f'Expected 1d array, got {(U,)}.')
133
133
 
134
134
  if np.any(U > 1.0) or np.any(U < 0.0):
135
135
  raise ValueError('Expected values in range [0.0, 1.0].')
@@ -165,11 +165,10 @@ class GaussianKDE(ScipyModel):
165
165
 
166
166
  def _fit(self, X):
167
167
  if self._sample_size:
168
- X = gaussian_kde(X, bw_method=self.bw_method,
169
- weights=self.weights).resample(self._sample_size)
170
- self._params = {
171
- 'dataset': X.tolist()
172
- }
168
+ X = gaussian_kde(X, bw_method=self.bw_method, weights=self.weights).resample(
169
+ self._sample_size
170
+ )
171
+ self._params = {'dataset': X.tolist()}
173
172
  self._model = self._get_model()
174
173
 
175
174
  def _is_constant(self):
@@ -22,11 +22,7 @@ class StudentTUnivariate(ScipyModel):
22
22
 
23
23
  def _fit(self, X):
24
24
  dataframe, loc, scale = t.fit(X)
25
- self._params = {
26
- 'df': dataframe,
27
- 'loc': loc,
28
- 'scale': scale
29
- }
25
+ self._params = {'df': dataframe, 'loc': loc, 'scale': scale}
30
26
 
31
27
  def _is_constant(self):
32
28
  return self._params['scale'] == 0
@@ -28,12 +28,7 @@ class TruncatedGaussian(ScipyModel):
28
28
 
29
29
  def _fit_constant(self, X):
30
30
  constant = np.unique(X)[0]
31
- self._params = {
32
- 'a': constant,
33
- 'b': constant,
34
- 'loc': constant,
35
- 'scale': 0.0
36
- }
31
+ self._params = {'a': constant, 'b': constant, 'loc': constant, 'scale': 0.0}
37
32
 
38
33
  def _fit(self, X):
39
34
  if self.min is None:
@@ -51,21 +46,18 @@ class TruncatedGaussian(ScipyModel):
51
46
  initial_params = X.mean(), X.std()
52
47
  with warnings.catch_warnings():
53
48
  warnings.simplefilter('ignore', category=RuntimeWarning)
54
- optimal = fmin_slsqp(nnlf, initial_params, iprint=False, bounds=[
55
- (self.min, self.max),
56
- (0.0, (self.max - self.min)**2)
57
- ])
49
+ optimal = fmin_slsqp(
50
+ nnlf,
51
+ initial_params,
52
+ iprint=False,
53
+ bounds=[(self.min, self.max), (0.0, (self.max - self.min) ** 2)],
54
+ )
58
55
 
59
56
  loc, scale = optimal
60
57
  a = (self.min - loc) / scale
61
58
  b = (self.max - loc) / scale
62
59
 
63
- self._params = {
64
- 'a': a,
65
- 'b': b,
66
- 'loc': loc,
67
- 'scale': scale
68
- }
60
+ self._params = {'a': a, 'b': b, 'loc': loc, 'scale': scale}
69
61
 
70
62
  def _is_constant(self):
71
63
  return self._params['a'] == self._params['b']
@@ -15,16 +15,10 @@ class UniformUnivariate(ScipyModel):
15
15
  MODEL_CLASS = uniform
16
16
 
17
17
  def _fit_constant(self, X):
18
- self._params = {
19
- 'loc': np.min(X),
20
- 'scale': np.max(X) - np.min(X)
21
- }
18
+ self._params = {'loc': np.min(X), 'scale': np.max(X) - np.min(X)}
22
19
 
23
20
  def _fit(self, X):
24
- self._params = {
25
- 'loc': np.min(X),
26
- 'scale': np.max(X) - np.min(X)
27
- }
21
+ self._params = {'loc': np.min(X), 'scale': np.max(X) - np.min(X)}
28
22
 
29
23
  def _is_constant(self):
30
24
  return self._params['scale'] == 0
@@ -31,11 +31,7 @@ def _generate_1d_plot(data, title, labels, colors):
31
31
  plotly.graph_objects._figure.Figure
32
32
  """
33
33
  fig = ff.create_distplot(
34
- hist_data=data,
35
- group_labels=labels,
36
- show_hist=False,
37
- show_rug=False,
38
- colors=colors
34
+ hist_data=data, group_labels=labels, show_hist=False, show_rug=False, colors=colors
39
35
  )
40
36
 
41
37
  for i, name in enumerate(labels):
@@ -52,7 +48,7 @@ def _generate_1d_plot(data, title, labels, colors):
52
48
  font={'size': PlotConfig.FONT_SIZE},
53
49
  showlegend=True if labels[0] else False,
54
50
  xaxis_title='value',
55
- yaxis_title='frequency'
51
+ yaxis_title='frequency',
56
52
  )
57
53
 
58
54
  return fig
@@ -80,10 +76,7 @@ def dist_1d(data, title=None, label=None):
80
76
  title += f" for column '{data.name}'"
81
77
 
82
78
  return _generate_1d_plot(
83
- data=[data],
84
- title=title,
85
- labels=[label],
86
- colors=[PlotConfig.DATACEBO_DARK]
79
+ data=[data], title=title, labels=[label], colors=[PlotConfig.DATACEBO_DARK]
87
80
  )
88
81
 
89
82
 
@@ -112,7 +105,7 @@ def compare_1d(real, synth, title=None):
112
105
  data=[real, synth],
113
106
  title=title,
114
107
  labels=['Real', 'Synthetic'],
115
- colors=[PlotConfig.DATACEBO_DARK, PlotConfig.DATACEBO_GREEN]
108
+ colors=[PlotConfig.DATACEBO_DARK, PlotConfig.DATACEBO_GREEN],
116
109
  )
117
110
 
118
111
 
@@ -148,7 +141,7 @@ def _generate_scatter_2d_plot(data, columns, color_discrete_map, title):
148
141
  y=columns[1],
149
142
  color='Data',
150
143
  color_discrete_map=color_discrete_map,
151
- symbol='Data'
144
+ symbol='Data',
152
145
  )
153
146
 
154
147
  fig.update_layout(
@@ -189,7 +182,7 @@ def scatter_2d(data, columns=None, title=None):
189
182
  data=data,
190
183
  columns=columns,
191
184
  color_discrete_map={'Real': PlotConfig.DATACEBO_DARK},
192
- title=title
185
+ title=title,
193
186
  )
194
187
 
195
188
 
@@ -226,9 +219,9 @@ def compare_2d(real, synth, columns=None, title=None):
226
219
  columns=columns,
227
220
  color_discrete_map={
228
221
  'Real': PlotConfig.DATACEBO_DARK,
229
- 'Synthetic': PlotConfig.DATACEBO_GREEN
222
+ 'Synthetic': PlotConfig.DATACEBO_GREEN,
230
223
  },
231
- title=title
224
+ title=title,
232
225
  )
233
226
 
234
227
 
@@ -302,14 +295,15 @@ def scatter_3d(data, columns=None, title=None):
302
295
  if columns:
303
296
  title += f" for columns '{columns[0]}', '{columns[1]}' and '{columns[2]}'"
304
297
  elif isinstance(data, pd.DataFrame):
305
- title += \
298
+ title += (
306
299
  f" for columns '{data.columns[0]}', '{data.columns[1]}' and '{data.columns[2]}'"
300
+ )
307
301
 
308
302
  return _generate_scatter_3d_plot(
309
303
  data=data,
310
304
  columns=columns,
311
305
  color_discrete_map={'Real': PlotConfig.DATACEBO_DARK},
312
- title=title
306
+ title=title,
313
307
  )
314
308
 
315
309
 
@@ -336,15 +330,16 @@ def compare_3d(real, synth, columns=None, title=None):
336
330
  if columns:
337
331
  title += f" for columns '{columns[0]}', '{columns[1]}' and '{columns[2]}'"
338
332
  elif isinstance(data, pd.DataFrame):
339
- title += \
333
+ title += (
340
334
  f" for columns '{data.columns[0]}', '{data.columns[1]}' and '{data.columns[2]}'"
335
+ )
341
336
 
342
337
  return _generate_scatter_3d_plot(
343
338
  data=data,
344
339
  columns=columns,
345
340
  color_discrete_map={
346
341
  'Real': PlotConfig.DATACEBO_DARK,
347
- 'Synthetic': PlotConfig.DATACEBO_GREEN
342
+ 'Synthetic': PlotConfig.DATACEBO_GREEN,
348
343
  },
349
- title=title
344
+ title=title,
350
345
  )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: copulas
3
- Version: 0.11.0
3
+ Version: 0.11.1
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
@@ -24,20 +24,20 @@ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
24
24
  Requires-Python: <3.13,>=3.8
25
25
  Description-Content-Type: text/markdown
26
26
  License-File: LICENSE
27
- Requires-Dist: numpy>=1.20.0; python_version < "3.10"
27
+ Requires-Dist: numpy>=1.21.0; python_version < "3.10"
28
28
  Requires-Dist: numpy>=1.23.3; python_version >= "3.10" and python_version < "3.12"
29
29
  Requires-Dist: numpy>=1.26.0; python_version >= "3.12"
30
- Requires-Dist: pandas>=1.1.3; python_version < "3.10"
31
- Requires-Dist: pandas>=1.3.4; python_version >= "3.10" and python_version < "3.11"
32
- Requires-Dist: pandas>=1.5.0; python_version >= "3.11"
30
+ Requires-Dist: pandas>=1.4.0; python_version < "3.11"
31
+ Requires-Dist: pandas>=1.5.0; python_version >= "3.11" and python_version < "3.12"
32
+ Requires-Dist: pandas>=2.1.1; python_version >= "3.12"
33
33
  Requires-Dist: plotly>=5.10.0
34
- Requires-Dist: scipy>=1.5.4; python_version < "3.10"
34
+ Requires-Dist: scipy>=1.7.3; python_version < "3.10"
35
35
  Requires-Dist: scipy>=1.9.2; python_version >= "3.10" and python_version < "3.12"
36
36
  Requires-Dist: scipy>=1.12.0; python_version >= "3.12"
37
37
  Provides-Extra: tutorials
38
38
  Requires-Dist: markupsafe<=2.0.1; extra == "tutorials"
39
- Requires-Dist: scikit-learn<1.2,>=0.24; python_version < "3.10" and extra == "tutorials"
40
- Requires-Dist: scikit-learn<1.5,>=0.24; python_version >= "3.10" and extra == "tutorials"
39
+ Requires-Dist: scikit-learn>=0.24; python_version < "3.12" and extra == "tutorials"
40
+ Requires-Dist: scikit-learn>=1.3.1; python_version >= "3.12" and extra == "tutorials"
41
41
  Requires-Dist: jupyter<2,>=1.0.0; extra == "tutorials"
42
42
  Provides-Extra: test
43
43
  Requires-Dist: copulas[tutorials]; extra == "test"
@@ -62,37 +62,14 @@ Requires-Dist: sphinxcontrib-htmlhelp<2.0.5; extra == "dev"
62
62
  Requires-Dist: sphinxcontrib_serializinghtml<1.1.10; extra == "dev"
63
63
  Requires-Dist: sphinxcontrib_qthelp<1.0.7; extra == "dev"
64
64
  Requires-Dist: alabaster<0.7.13; extra == "dev"
65
- Requires-Dist: Jinja2<3,>=2; extra == "dev"
66
- Requires-Dist: flake8<4,>=3.7.7; extra == "dev"
67
- Requires-Dist: isort<5,>=4.3.4; extra == "dev"
68
- Requires-Dist: flake8-debugger<4.1,>=4.0.0; extra == "dev"
69
- Requires-Dist: flake8-mock<0.4,>=0.3; extra == "dev"
70
- Requires-Dist: flake8-mutable<1.3,>=1.2.0; extra == "dev"
71
- Requires-Dist: flake8-fixme<1.2,>=1.1.1; extra == "dev"
72
- Requires-Dist: pep8-naming<0.13,>=0.12.1; extra == "dev"
73
- Requires-Dist: dlint<0.12,>=0.11.0; extra == "dev"
74
- Requires-Dist: flake8-docstrings<2,>=1.5.0; extra == "dev"
75
- Requires-Dist: pydocstyle<6.2,>=6.1.1; extra == "dev"
76
- Requires-Dist: flake8-pytest-style<2,>=1.5.0; extra == "dev"
77
- Requires-Dist: flake8-comprehensions<3.7,>=3.6.1; extra == "dev"
78
- Requires-Dist: flake8-print<4.1,>=4.0.0; extra == "dev"
79
- Requires-Dist: flake8-expression-complexity<0.1,>=0.0.9; extra == "dev"
80
- Requires-Dist: flake8-multiline-containers<0.1,>=0.0.18; extra == "dev"
81
- Requires-Dist: pandas-vet<0.3,>=0.2.2; extra == "dev"
82
- Requires-Dist: flake8-builtins<1.6,>=1.5.3; extra == "dev"
83
- Requires-Dist: flake8-eradicate<1.2,>=1.1.0; extra == "dev"
84
- Requires-Dist: flake8-quotes<4,>=3.3.0; extra == "dev"
85
- Requires-Dist: flake8-variables-names<0.1,>=0.0.4; extra == "dev"
86
- Requires-Dist: flake8-sfs<0.1,>=0.0.3; extra == "dev"
87
- Requires-Dist: flake8-absolute-import<2,>=1.0; extra == "dev"
88
- Requires-Dist: autoflake<2,>=1.1; extra == "dev"
89
- Requires-Dist: autopep8<1.6,>=1.4.3; extra == "dev"
65
+ Requires-Dist: Jinja2<3,>=2; python_version < "3.12" and extra == "dev"
66
+ Requires-Dist: Jinja2<4,>=2; python_version >= "3.12" and extra == "dev"
67
+ Requires-Dist: ruff<1,>=0.3.2; extra == "dev"
90
68
  Requires-Dist: twine<4,>=1.10.0; extra == "dev"
91
69
  Requires-Dist: wheel>=0.30.0; extra == "dev"
92
70
  Requires-Dist: coverage<6,>=4.5.1; extra == "dev"
93
71
  Requires-Dist: tox<4,>=2.9.1; extra == "dev"
94
72
  Requires-Dist: invoke; extra == "dev"
95
- Requires-Dist: doc8<0.9,>=0.8.0; extra == "dev"
96
73
  Requires-Dist: urllib3<1.26,>=1.20; extra == "dev"
97
74
  Requires-Dist: tabulate<0.9,>=0.8.3; extra == "dev"
98
75
  Requires-Dist: boto3<1.10,>=1.7.47; extra == "dev"
@@ -1,7 +1,6 @@
1
1
  LICENSE
2
2
  README.md
3
3
  pyproject.toml
4
- setup.cfg
5
4
  copulas/__init__.py
6
5
  copulas/datasets.py
7
6
  copulas/visualization.py
@@ -0,0 +1,71 @@
1
+ plotly>=5.10.0
2
+
3
+ [:python_version < "3.10"]
4
+ numpy>=1.21.0
5
+ scipy>=1.7.3
6
+
7
+ [:python_version < "3.11"]
8
+ pandas>=1.4.0
9
+
10
+ [:python_version >= "3.10" and python_version < "3.12"]
11
+ numpy>=1.23.3
12
+ scipy>=1.9.2
13
+
14
+ [:python_version >= "3.11" and python_version < "3.12"]
15
+ pandas>=1.5.0
16
+
17
+ [:python_version >= "3.12"]
18
+ numpy>=1.26.0
19
+ pandas>=2.1.1
20
+ scipy>=1.12.0
21
+
22
+ [dev]
23
+ copulas[test,tutorials]
24
+ pip>=9.0.1
25
+ build<2,>=1.0.0
26
+ bump-my-version<1,>=0.18.3
27
+ watchdog<5,>=1.0.1
28
+ m2r<0.3,>=0.2.0
29
+ nbsphinx<0.7,>=0.5.0
30
+ Sphinx<3,>=1.7.1
31
+ sphinx_rtd_theme<0.5,>=0.2.4
32
+ sphinxcontrib_applehelp<1.0.8
33
+ sphinxcontrib-devhelp<1.0.6
34
+ sphinxcontrib-htmlhelp<2.0.5
35
+ sphinxcontrib_serializinghtml<1.1.10
36
+ sphinxcontrib_qthelp<1.0.7
37
+ alabaster<0.7.13
38
+ ruff<1,>=0.3.2
39
+ twine<4,>=1.10.0
40
+ wheel>=0.30.0
41
+ coverage<6,>=4.5.1
42
+ tox<4,>=2.9.1
43
+ invoke
44
+ urllib3<1.26,>=1.20
45
+ tabulate<0.9,>=0.8.3
46
+ boto3<1.10,>=1.7.47
47
+ docutils<0.15,>=0.10
48
+
49
+ [dev:python_version < "3.12"]
50
+ Jinja2<3,>=2
51
+
52
+ [dev:python_version >= "3.12"]
53
+ Jinja2<4,>=2
54
+
55
+ [test]
56
+ copulas[tutorials]
57
+ pytest<7,>=6.2.5
58
+ pytest-cov<3,>=2.6.0
59
+ pytest-rerunfailures<15,>=10.3
60
+ rundoc<0.5,>=0.4.3
61
+ tomli<3,>=2.0.0
62
+
63
+ [tutorials]
64
+ markupsafe<=2.0.1
65
+ jupyter<2,>=1.0.0
66
+
67
+ [tutorials:python_version < "3.12"]
68
+ scikit-learn>=0.24
69
+
70
+ [tutorials:python_version >= "3.12"]
71
+ scikit-learn>=1.3.1
@@ -21,14 +21,14 @@ license = { text = 'BSL-1.1' }
21
21
  requires-python = '>=3.8,<3.13'
22
22
  readme = 'README.md'
23
23
  dependencies = [
24
- "numpy>=1.20.0;python_version<'3.10'",
24
+ "numpy>=1.21.0;python_version<'3.10'",
25
25
  "numpy>=1.23.3;python_version>='3.10' and python_version<'3.12'",
26
26
  "numpy>=1.26.0;python_version>='3.12'",
27
- "pandas>=1.1.3;python_version<'3.10'",
28
- "pandas>=1.3.4;python_version>='3.10' and python_version<'3.11'",
29
- "pandas>=1.5.0;python_version>='3.11'",
27
+ "pandas>=1.4.0;python_version<'3.11'",
28
+ "pandas>=1.5.0;python_version>='3.11' and python_version<'3.12'",
29
+ "pandas>=2.1.1;python_version>='3.12'",
30
30
  'plotly>=5.10.0',
31
- "scipy>=1.5.4;python_version<'3.10'",
31
+ "scipy>=1.7.3;python_version<'3.10'",
32
32
  "scipy>=1.9.2;python_version>='3.10' and python_version<'3.12'",
33
33
  "scipy>=1.12.0;python_version>='3.12'",
34
34
  ]
@@ -50,8 +50,8 @@ version = {attr = 'copulas.__version__'}
50
50
  [project.optional-dependencies]
51
51
  tutorials = [
52
52
  'markupsafe<=2.0.1',
53
- "scikit-learn>=0.24,<1.2;python_version<'3.10'",
54
- "scikit-learn>=0.24,<1.5;python_version>='3.10'",
53
+ "scikit-learn>=0.24;python_version<'3.12'",
54
+ "scikit-learn>=1.3.1;python_version>='3.12'",
55
55
  'jupyter>=1.0.0,<2',
56
56
  ]
57
57
  test = [
@@ -84,35 +84,11 @@ dev = [
84
84
  'alabaster<0.7.13',
85
85
 
86
86
  # Jinja2>=3 makes the sphinx theme fail
87
- 'Jinja2>=2,<3',
87
+ "Jinja2>=2,<3;python_version<'3.12'",
88
+ "Jinja2>=2,<4;python_version>='3.12'",
88
89
 
89
90
  # style check
90
- 'flake8>=3.7.7,<4',
91
- 'isort>=4.3.4,<5',
92
- 'flake8-debugger>=4.0.0,<4.1',
93
- 'flake8-mock>=0.3,<0.4',
94
- 'flake8-mutable>=1.2.0,<1.3',
95
- 'flake8-fixme>=1.1.1,<1.2',
96
- 'pep8-naming>=0.12.1,<0.13',
97
- 'dlint>=0.11.0,<0.12',
98
- 'flake8-docstrings>=1.5.0,<2',
99
- 'pydocstyle>=6.1.1,<6.2',
100
- 'flake8-pytest-style>=1.5.0,<2',
101
- 'flake8-comprehensions>=3.6.1,<3.7',
102
- 'flake8-print>=4.0.0,<4.1',
103
- 'flake8-expression-complexity>=0.0.9,<0.1',
104
- 'flake8-multiline-containers>=0.0.18,<0.1',
105
- 'pandas-vet>=0.2.2,<0.3',
106
- 'flake8-builtins>=1.5.3,<1.6',
107
- 'flake8-eradicate>=1.1.0,<1.2',
108
- 'flake8-quotes>=3.3.0,<4',
109
- 'flake8-variables-names>=0.0.4,<0.1',
110
- 'flake8-sfs>=0.0.3,<0.1',
111
- 'flake8-absolute-import>=1.0,<2',
112
-
113
- # fix style issues
114
- 'autoflake>=1.1,<2',
115
- 'autopep8>=1.4.3,<1.6',
91
+ 'ruff>=0.3.2,<1',
116
92
 
117
93
  # distribute on PyPI
118
94
  'twine>=1.10.0,<4',
@@ -123,9 +99,6 @@ dev = [
123
99
  'tox>=2.9.1,<4',
124
100
  'invoke',
125
101
 
126
- # Documentation style
127
- 'doc8>=0.8.0,<0.9',
128
-
129
102
  # Large scale evaluation
130
103
  'urllib3>=1.20,<1.26',
131
104
  'tabulate>=0.8.3,<0.9',
@@ -138,7 +111,6 @@ line_length = 99
138
111
  lines_between_types = 0
139
112
  multi_line_output = 4
140
113
  use_parentheses = true
141
- not_skip = ['__init__.py']
142
114
 
143
115
  [tool.pydocstyle]
144
116
  convention = 'google'
@@ -177,7 +149,7 @@ namespaces = false
177
149
  ]
178
150
 
179
151
  [tool.bumpversion]
180
- current_version = "0.11.0"
152
+ current_version = "0.11.1"
181
153
  commit = true
182
154
  tag = true
183
155
  parse = '(?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\.(?P<release>[a-z]+)(?P<candidate>\d+))?'
@@ -198,3 +170,53 @@ filename = 'copulas/__init__.py'
198
170
  search = "__version__ = '{current_version}'"
199
171
  replace = "__version__ = '{new_version}'"
200
172
 
173
+ [tool.ruff]
174
+ preview = true
175
+ line-length = 100
176
+ indent-width = 4
177
+ src = ["copulas"]
178
+ target-version = "py312"
179
+ exclude = [
180
+ "docs",
181
+ ".tox",
182
+ ".git",
183
+ "__pycache__",
184
+ ".ipynb_checkpoints",
185
+ "*.ipynb"
186
+ ]
187
+
188
+ [tool.ruff.lint]
189
+ select = [
190
+ # Pyflakes
191
+ "F",
192
+ # Pycodestyle
193
+ "E",
194
+ "W",
195
+ "D200",
196
+ # isort
197
+ "I001",
198
+ ]
199
+ ignore = [
200
+ "E501",
201
+ "D107", # Missing docstring in __init__
202
+ "D417", # Missing argument descriptions in the docstring, this is a bug from pydocstyle: https://github.com/PyCQA/pydocstyle/issues/449
203
+ ]
204
+
205
+ [tool.ruff.format]
206
+ quote-style = "single"
207
+ indent-style = "space"
208
+ preview = true
209
+ docstring-code-format = true
210
+ docstring-code-line-length = "dynamic"
211
+
212
+ [tool.ruff.lint.pep8-naming]
213
+ extend-ignore-names = ["X", "C", "X_padded", "Y", "Y_padded"]
214
+
215
+ [tool.ruff.lint.isort]
216
+ known-first-party = ["copulas"]
217
+
218
+ [tool.ruff.lint.per-file-ignores]
219
+ "__init__.py" = ["F401", "E402", "F403", "F405", "E501", "I001"]
220
+
221
+ [tool.ruff.lint.pydocstyle]
222
+ convention = "google"
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -1,90 +0,0 @@
1
- plotly>=5.10.0
2
-
3
- [:python_version < "3.10"]
4
- numpy>=1.20.0
5
- pandas>=1.1.3
6
- scipy>=1.5.4
7
-
8
- [:python_version >= "3.10" and python_version < "3.11"]
9
- pandas>=1.3.4
10
-
11
- [:python_version >= "3.10" and python_version < "3.12"]
12
- numpy>=1.23.3
13
- scipy>=1.9.2
14
-
15
- [:python_version >= "3.11"]
16
- pandas>=1.5.0
17
-
18
- [:python_version >= "3.12"]
19
- numpy>=1.26.0
20
- scipy>=1.12.0
21
-
22
- [dev]
23
- copulas[test,tutorials]
24
- pip>=9.0.1
25
- build<2,>=1.0.0
26
- bump-my-version<1,>=0.18.3
27
- watchdog<5,>=1.0.1
28
- m2r<0.3,>=0.2.0
29
- nbsphinx<0.7,>=0.5.0
30
- Sphinx<3,>=1.7.1
31
- sphinx_rtd_theme<0.5,>=0.2.4
32
- sphinxcontrib_applehelp<1.0.8
33
- sphinxcontrib-devhelp<1.0.6
34
- sphinxcontrib-htmlhelp<2.0.5
35
- sphinxcontrib_serializinghtml<1.1.10
36
- sphinxcontrib_qthelp<1.0.7
37
- alabaster<0.7.13
38
- Jinja2<3,>=2
39
- flake8<4,>=3.7.7
40
- isort<5,>=4.3.4
41
- flake8-debugger<4.1,>=4.0.0
42
- flake8-mock<0.4,>=0.3
43
- flake8-mutable<1.3,>=1.2.0
44
- flake8-fixme<1.2,>=1.1.1
45
- pep8-naming<0.13,>=0.12.1
46
- dlint<0.12,>=0.11.0
47
- flake8-docstrings<2,>=1.5.0
48
- pydocstyle<6.2,>=6.1.1
49
- flake8-pytest-style<2,>=1.5.0
50
- flake8-comprehensions<3.7,>=3.6.1
51
- flake8-print<4.1,>=4.0.0
52
- flake8-expression-complexity<0.1,>=0.0.9
53
- flake8-multiline-containers<0.1,>=0.0.18
54
- pandas-vet<0.3,>=0.2.2
55
- flake8-builtins<1.6,>=1.5.3
56
- flake8-eradicate<1.2,>=1.1.0
57
- flake8-quotes<4,>=3.3.0
58
- flake8-variables-names<0.1,>=0.0.4
59
- flake8-sfs<0.1,>=0.0.3
60
- flake8-absolute-import<2,>=1.0
61
- autoflake<2,>=1.1
62
- autopep8<1.6,>=1.4.3
63
- twine<4,>=1.10.0
64
- wheel>=0.30.0
65
- coverage<6,>=4.5.1
66
- tox<4,>=2.9.1
67
- invoke
68
- doc8<0.9,>=0.8.0
69
- urllib3<1.26,>=1.20
70
- tabulate<0.9,>=0.8.3
71
- boto3<1.10,>=1.7.47
72
- docutils<0.15,>=0.10
73
-
74
- [test]
75
- copulas[tutorials]
76
- pytest<7,>=6.2.5
77
- pytest-cov<3,>=2.6.0
78
- pytest-rerunfailures<15,>=10.3
79
- rundoc<0.5,>=0.4.3
80
- tomli<3,>=2.0.0
81
-
82
- [tutorials]
83
- markupsafe<=2.0.1
84
- jupyter<2,>=1.0.0
85
-
86
- [tutorials:python_version < "3.10"]
87
- scikit-learn<1.2,>=0.24
88
-
89
- [tutorials:python_version >= "3.10"]
90
- scikit-learn<1.5,>=0.24
copulas-0.11.0/setup.cfg DELETED
@@ -1,23 +0,0 @@
1
- [flake8]
2
- max-line-length = 99
3
- exclude = docs, .git, __pycache__, .ipynb_checkpoints
4
- extend-ignore = D107, # Missing docstring in __init__
5
- D413, # Missing blank line after last section
6
- DUO103, # insecure use of "pickle" or "cPickle"
7
- N803, # argument name 'X' should be lowercase
8
- N806, # variable 'X' in function should be lowercase
9
- SFS3, # String literal formatting using f-string.
10
- VNE001 # Single letter variable names are not allowed
11
- per-file-ignores =
12
- large_scale_evaluation.py:T001
13
-
14
- [aliases]
15
- test = pytest
16
-
17
- [doc8]
18
- max-line-length = 99
19
-
20
- [egg_info]
21
- tag_build =
22
- tag_date = 0
23
-
File without changes
File without changes
File without changes