sdv 1.36.2.dev0__tar.gz → 1.36.3.dev0__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 (87) hide show
  1. {sdv-1.36.2.dev0/sdv.egg-info → sdv-1.36.3.dev0}/PKG-INFO +1 -1
  2. {sdv-1.36.2.dev0 → sdv-1.36.3.dev0}/pyproject.toml +1 -1
  3. {sdv-1.36.2.dev0 → sdv-1.36.3.dev0}/sdv/__init__.py +1 -1
  4. {sdv-1.36.2.dev0 → sdv-1.36.3.dev0}/sdv/cag/__init__.py +0 -2
  5. {sdv-1.36.2.dev0 → sdv-1.36.3.dev0}/sdv/cag/programmable_constraint.py +4 -51
  6. {sdv-1.36.2.dev0 → sdv-1.36.3.dev0}/sdv/sequential/par.py +2 -2
  7. {sdv-1.36.2.dev0 → sdv-1.36.3.dev0}/sdv/single_table/base.py +22 -0
  8. {sdv-1.36.2.dev0 → sdv-1.36.3.dev0/sdv.egg-info}/PKG-INFO +1 -1
  9. {sdv-1.36.2.dev0 → sdv-1.36.3.dev0}/LICENSE +0 -0
  10. {sdv-1.36.2.dev0 → sdv-1.36.3.dev0}/README.md +0 -0
  11. {sdv-1.36.2.dev0 → sdv-1.36.3.dev0}/sdv/_utils.py +0 -0
  12. {sdv-1.36.2.dev0 → sdv-1.36.3.dev0}/sdv/cag/_errors.py +0 -0
  13. {sdv-1.36.2.dev0 → sdv-1.36.3.dev0}/sdv/cag/_utils.py +0 -0
  14. {sdv-1.36.2.dev0 → sdv-1.36.3.dev0}/sdv/cag/base.py +0 -0
  15. {sdv-1.36.2.dev0 → sdv-1.36.3.dev0}/sdv/cag/fixed_combinations.py +0 -0
  16. {sdv-1.36.2.dev0 → sdv-1.36.3.dev0}/sdv/cag/fixed_increments.py +0 -0
  17. {sdv-1.36.2.dev0 → sdv-1.36.3.dev0}/sdv/cag/inequality.py +0 -0
  18. {sdv-1.36.2.dev0 → sdv-1.36.3.dev0}/sdv/cag/one_hot_encoding.py +0 -0
  19. {sdv-1.36.2.dev0 → sdv-1.36.3.dev0}/sdv/cag/range.py +0 -0
  20. {sdv-1.36.2.dev0 → sdv-1.36.3.dev0}/sdv/constraints/__init__.py +0 -0
  21. {sdv-1.36.2.dev0 → sdv-1.36.3.dev0}/sdv/constraints/base.py +0 -0
  22. {sdv-1.36.2.dev0 → sdv-1.36.3.dev0}/sdv/constraints/errors.py +0 -0
  23. {sdv-1.36.2.dev0 → sdv-1.36.3.dev0}/sdv/constraints/tabular.py +0 -0
  24. {sdv-1.36.2.dev0 → sdv-1.36.3.dev0}/sdv/constraints/utils.py +0 -0
  25. {sdv-1.36.2.dev0 → sdv-1.36.3.dev0}/sdv/data_processing/__init__.py +0 -0
  26. {sdv-1.36.2.dev0 → sdv-1.36.3.dev0}/sdv/data_processing/data_processor.py +0 -0
  27. {sdv-1.36.2.dev0 → sdv-1.36.3.dev0}/sdv/data_processing/datetime_formatter.py +0 -0
  28. {sdv-1.36.2.dev0 → sdv-1.36.3.dev0}/sdv/data_processing/errors.py +0 -0
  29. {sdv-1.36.2.dev0 → sdv-1.36.3.dev0}/sdv/data_processing/numerical_formatter.py +0 -0
  30. {sdv-1.36.2.dev0 → sdv-1.36.3.dev0}/sdv/data_processing/utils.py +0 -0
  31. {sdv-1.36.2.dev0 → sdv-1.36.3.dev0}/sdv/datasets/__init__.py +0 -0
  32. {sdv-1.36.2.dev0 → sdv-1.36.3.dev0}/sdv/datasets/demo.py +0 -0
  33. {sdv-1.36.2.dev0 → sdv-1.36.3.dev0}/sdv/datasets/local.py +0 -0
  34. {sdv-1.36.2.dev0 → sdv-1.36.3.dev0}/sdv/errors.py +0 -0
  35. {sdv-1.36.2.dev0 → sdv-1.36.3.dev0}/sdv/evaluation/__init__.py +0 -0
  36. {sdv-1.36.2.dev0 → sdv-1.36.3.dev0}/sdv/evaluation/_utils.py +0 -0
  37. {sdv-1.36.2.dev0 → sdv-1.36.3.dev0}/sdv/evaluation/multi_table.py +0 -0
  38. {sdv-1.36.2.dev0 → sdv-1.36.3.dev0}/sdv/evaluation/single_table.py +0 -0
  39. {sdv-1.36.2.dev0 → sdv-1.36.3.dev0}/sdv/io/__init__.py +0 -0
  40. {sdv-1.36.2.dev0 → sdv-1.36.3.dev0}/sdv/io/local/__init__.py +0 -0
  41. {sdv-1.36.2.dev0 → sdv-1.36.3.dev0}/sdv/io/local/local.py +0 -0
  42. {sdv-1.36.2.dev0 → sdv-1.36.3.dev0}/sdv/lite/__init__.py +0 -0
  43. {sdv-1.36.2.dev0 → sdv-1.36.3.dev0}/sdv/lite/single_table.py +0 -0
  44. {sdv-1.36.2.dev0 → sdv-1.36.3.dev0}/sdv/logging/__init__.py +0 -0
  45. {sdv-1.36.2.dev0 → sdv-1.36.3.dev0}/sdv/logging/logger.py +0 -0
  46. {sdv-1.36.2.dev0 → sdv-1.36.3.dev0}/sdv/logging/sdv_logger_config.yml +0 -0
  47. {sdv-1.36.2.dev0 → sdv-1.36.3.dev0}/sdv/logging/utils.py +0 -0
  48. {sdv-1.36.2.dev0 → sdv-1.36.3.dev0}/sdv/metadata/__init__.py +0 -0
  49. {sdv-1.36.2.dev0 → sdv-1.36.3.dev0}/sdv/metadata/errors.py +0 -0
  50. {sdv-1.36.2.dev0 → sdv-1.36.3.dev0}/sdv/metadata/metadata.py +0 -0
  51. {sdv-1.36.2.dev0 → sdv-1.36.3.dev0}/sdv/metadata/metadata_upgrader.py +0 -0
  52. {sdv-1.36.2.dev0 → sdv-1.36.3.dev0}/sdv/metadata/multi_table.py +0 -0
  53. {sdv-1.36.2.dev0 → sdv-1.36.3.dev0}/sdv/metadata/single_table.py +0 -0
  54. {sdv-1.36.2.dev0 → sdv-1.36.3.dev0}/sdv/metadata/utils.py +0 -0
  55. {sdv-1.36.2.dev0 → sdv-1.36.3.dev0}/sdv/metadata/visualization.py +0 -0
  56. {sdv-1.36.2.dev0 → sdv-1.36.3.dev0}/sdv/metrics/__init__.py +0 -0
  57. {sdv-1.36.2.dev0 → sdv-1.36.3.dev0}/sdv/metrics/demos.py +0 -0
  58. {sdv-1.36.2.dev0 → sdv-1.36.3.dev0}/sdv/metrics/relational.py +0 -0
  59. {sdv-1.36.2.dev0 → sdv-1.36.3.dev0}/sdv/metrics/tabular.py +0 -0
  60. {sdv-1.36.2.dev0 → sdv-1.36.3.dev0}/sdv/metrics/timeseries.py +0 -0
  61. {sdv-1.36.2.dev0 → sdv-1.36.3.dev0}/sdv/multi_table/__init__.py +0 -0
  62. {sdv-1.36.2.dev0 → sdv-1.36.3.dev0}/sdv/multi_table/base.py +0 -0
  63. {sdv-1.36.2.dev0 → sdv-1.36.3.dev0}/sdv/multi_table/dayz.py +0 -0
  64. {sdv-1.36.2.dev0 → sdv-1.36.3.dev0}/sdv/multi_table/hma.py +0 -0
  65. {sdv-1.36.2.dev0 → sdv-1.36.3.dev0}/sdv/multi_table/utils.py +0 -0
  66. {sdv-1.36.2.dev0 → sdv-1.36.3.dev0}/sdv/sampling/__init__.py +0 -0
  67. {sdv-1.36.2.dev0 → sdv-1.36.3.dev0}/sdv/sampling/hierarchical_sampler.py +0 -0
  68. {sdv-1.36.2.dev0 → sdv-1.36.3.dev0}/sdv/sampling/independent_sampler.py +0 -0
  69. {sdv-1.36.2.dev0 → sdv-1.36.3.dev0}/sdv/sampling/tabular.py +0 -0
  70. {sdv-1.36.2.dev0 → sdv-1.36.3.dev0}/sdv/sequential/__init__.py +0 -0
  71. {sdv-1.36.2.dev0 → sdv-1.36.3.dev0}/sdv/single_table/__init__.py +0 -0
  72. {sdv-1.36.2.dev0 → sdv-1.36.3.dev0}/sdv/single_table/copulagan.py +0 -0
  73. {sdv-1.36.2.dev0 → sdv-1.36.3.dev0}/sdv/single_table/copulas.py +0 -0
  74. {sdv-1.36.2.dev0 → sdv-1.36.3.dev0}/sdv/single_table/ctgan.py +0 -0
  75. {sdv-1.36.2.dev0 → sdv-1.36.3.dev0}/sdv/single_table/dayz.py +0 -0
  76. {sdv-1.36.2.dev0 → sdv-1.36.3.dev0}/sdv/single_table/utils.py +0 -0
  77. {sdv-1.36.2.dev0 → sdv-1.36.3.dev0}/sdv/utils/__init__.py +0 -0
  78. {sdv-1.36.2.dev0 → sdv-1.36.3.dev0}/sdv/utils/mixins.py +0 -0
  79. {sdv-1.36.2.dev0 → sdv-1.36.3.dev0}/sdv/utils/poc.py +0 -0
  80. {sdv-1.36.2.dev0 → sdv-1.36.3.dev0}/sdv/utils/utils.py +0 -0
  81. {sdv-1.36.2.dev0 → sdv-1.36.3.dev0}/sdv/version/__init__.py +0 -0
  82. {sdv-1.36.2.dev0 → sdv-1.36.3.dev0}/sdv.egg-info/SOURCES.txt +0 -0
  83. {sdv-1.36.2.dev0 → sdv-1.36.3.dev0}/sdv.egg-info/dependency_links.txt +0 -0
  84. {sdv-1.36.2.dev0 → sdv-1.36.3.dev0}/sdv.egg-info/entry_points.txt +0 -0
  85. {sdv-1.36.2.dev0 → sdv-1.36.3.dev0}/sdv.egg-info/requires.txt +0 -0
  86. {sdv-1.36.2.dev0 → sdv-1.36.3.dev0}/sdv.egg-info/top_level.txt +0 -0
  87. {sdv-1.36.2.dev0 → sdv-1.36.3.dev0}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sdv
3
- Version: 1.36.2.dev0
3
+ Version: 1.36.3.dev0
4
4
  Summary: Generate synthetic data for single table, multi table and sequential data
5
5
  Author-email: "DataCebo, Inc." <info@sdv.dev>
6
6
  License-Expression: BUSL-1.1
@@ -149,7 +149,7 @@ namespaces = false
149
149
  version = {attr = 'sdv.__version__'}
150
150
 
151
151
  [tool.bumpversion]
152
- current_version = "1.36.2.dev0"
152
+ current_version = "1.36.3.dev0"
153
153
  parse = '(?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\.(?P<release>[a-z]+)(?P<candidate>\d+))?'
154
154
  serialize = [
155
155
  '{major}.{minor}.{patch}.{release}{candidate}',
@@ -6,7 +6,7 @@
6
6
 
7
7
  __author__ = 'DataCebo, Inc.'
8
8
  __email__ = 'info@sdv.dev'
9
- __version__ = '1.36.2.dev0'
9
+ __version__ = '1.36.3.dev0'
10
10
 
11
11
 
12
12
  import sys
@@ -7,7 +7,6 @@ from sdv.cag.range import Range
7
7
  from sdv.cag.one_hot_encoding import OneHotEncoding
8
8
  from sdv.cag.programmable_constraint import (
9
9
  ProgrammableConstraint,
10
- SingleTableProgrammableConstraint,
11
10
  )
12
11
 
13
12
  __all__ = (
@@ -17,5 +16,4 @@ __all__ = (
17
16
  'Range',
18
17
  'OneHotEncoding',
19
18
  'ProgrammableConstraint',
20
- 'SingleTableProgrammableConstraint',
21
19
  )
@@ -2,14 +2,13 @@
2
2
 
3
3
  from copy import deepcopy
4
4
 
5
- from sdv.cag._errors import ConstraintNotMetError
6
5
  from sdv.cag.base import BaseConstraint
7
6
 
8
7
 
9
8
  class ProgrammableConstraint:
10
9
  """Base class to create programmable constraints."""
11
10
 
12
- _is_single_table = False
11
+ _is_single_table = True
13
12
 
14
13
  def validate(self, metadata):
15
14
  """Validates that the metadata is compatible with the constraint and its parameters.
@@ -125,12 +124,6 @@ class ProgrammableConstraint:
125
124
  return synthetic_data
126
125
 
127
126
 
128
- class SingleTableProgrammableConstraint(ProgrammableConstraint):
129
- """Single table variant of the base programmable constraint class."""
130
-
131
- _is_single_table = True
132
-
133
-
134
127
  class ProgrammableConstraintHarness(BaseConstraint):
135
128
  """Constraint interface class for programmable constraints."""
136
129
 
@@ -141,21 +134,9 @@ class ProgrammableConstraintHarness(BaseConstraint):
141
134
  self._is_single_table = self.programmable_constraint._is_single_table
142
135
 
143
136
  def _validate_constraint_with_metadata(self, metadata):
144
- if self.programmable_constraint._is_single_table and len(metadata.tables) != 1:
145
- if getattr(self.programmable_constraint, 'table_name', None) is None:
146
- raise ConstraintNotMetError(
147
- 'SingleTableProgrammableConstraint cannot be used with multi-table metadata '
148
- 'if the `table_name` attribute has not been set. Please set the table name '
149
- 'attribute to the target table, or use the ProgrammableContraint '
150
- 'base class instead.'
151
- )
152
-
153
137
  self.programmable_constraint.validate(metadata)
154
138
 
155
139
  def _validate_constraint_with_data(self, data, metadata):
156
- if self._is_single_table:
157
- data = data[self._get_single_table_name(metadata)]
158
-
159
140
  self.programmable_constraint.validate_input_data(data)
160
141
 
161
142
  def _get_updated_metadata(self, metadata):
@@ -163,41 +144,13 @@ class ProgrammableConstraintHarness(BaseConstraint):
163
144
  return self.programmable_constraint.get_updated_metadata(metadata)
164
145
 
165
146
  def _fit(self, data, metadata):
166
- if self._is_single_table:
167
- data = data[self._table_name]
168
-
169
147
  self.programmable_constraint.fit(data, metadata)
170
148
 
171
149
  def _transform(self, data):
172
- if self._is_single_table:
173
- data = data[self._table_name]
174
-
175
- transformed = self.programmable_constraint.transform(data)
176
-
177
- if self._is_single_table:
178
- return {self._table_name: transformed}
179
-
180
- return transformed
150
+ return self.programmable_constraint.transform(data)
181
151
 
182
152
  def _reverse_transform(self, data):
183
- if self._is_single_table:
184
- data = data[self._table_name]
185
-
186
- reverse_transformed = self.programmable_constraint.reverse_transform(data)
187
-
188
- if self._is_single_table:
189
- return {self._table_name: reverse_transformed}
190
-
191
- return reverse_transformed
153
+ return self.programmable_constraint.reverse_transform(data)
192
154
 
193
155
  def _is_valid(self, data, metadata):
194
- if self._is_single_table:
195
- table_name = self._get_single_table_name(metadata)
196
- data = data[table_name]
197
-
198
- is_valid = self.programmable_constraint.is_valid(data)
199
-
200
- if self._is_single_table:
201
- return {table_name: is_valid}
202
-
203
- return is_valid
156
+ return self.programmable_constraint.is_valid(data)
@@ -209,13 +209,13 @@ class PARSynthesizer(LossValuesMixin, MissingModuleMixin, BaseSynthesizer):
209
209
  def add_constraints(self, constraints):
210
210
  """Add constraints to the synthesizer.
211
211
 
212
- For PARSynthesizers allow SingleTableProgrammableConstraints and built-in constraints
212
+ For PARSynthesizers allow ProgrammableConstraints and built-in constraints
213
213
  that follow these rules:
214
214
 
215
215
  1) All constraints must be either for all contextual columns or non-contextual column.
216
216
  No mixing constraints that cover both contextual and non-contextual columns
217
217
  2) No overlapping constraints (there are no constraints that act on the same column)
218
- 3) Any custom constraint is allowed, as long as it is a SingleTableProgrammableConstraint
218
+ 3) Any custom constraint is allowed, as long as it is a single table constraint
219
219
 
220
220
  Args:
221
221
  constraints (list):
@@ -1439,6 +1439,7 @@ class BaseSingleTableSynthesizer(BaseSynthesizer):
1439
1439
  """
1440
1440
  self._validate_fit_before_sample()
1441
1441
  output_file_path = validate_file_path(output_file_path)
1442
+ sample_timestamp = datetime.datetime.now()
1442
1443
 
1443
1444
  num_rows = functools.reduce(
1444
1445
  lambda num_rows, condition: condition.get_num_rows() + num_rows, conditions, 0
@@ -1474,6 +1475,16 @@ class BaseSingleTableSynthesizer(BaseSynthesizer):
1474
1475
  except (Exception, KeyboardInterrupt) as error:
1475
1476
  handle_sampling_error(output_file_path, error)
1476
1477
 
1478
+ SYNTHESIZER_LOGGER.info({
1479
+ 'EVENT': 'Sample',
1480
+ 'TIMESTAMP': sample_timestamp,
1481
+ 'SYNTHESIZER CLASS NAME': self.__class__.__name__,
1482
+ 'SYNTHESIZER ID': self._synthesizer_id,
1483
+ 'TOTAL NUMBER OF TABLES': 1,
1484
+ 'TOTAL NUMBER OF ROWS': len(sampled),
1485
+ 'TOTAL NUMBER OF COLUMNS': len(sampled.columns),
1486
+ })
1487
+
1477
1488
  return sampled
1478
1489
 
1479
1490
  def _validate_known_columns(self, conditions):
@@ -1513,6 +1524,7 @@ class BaseSingleTableSynthesizer(BaseSynthesizer):
1513
1524
 
1514
1525
  known_columns = known_columns.copy()
1515
1526
  self._validate_known_columns(known_columns)
1527
+ sample_timestamp = datetime.datetime.now()
1516
1528
  sampled = pd.DataFrame()
1517
1529
  try:
1518
1530
  with tqdm.tqdm(total=len(known_columns)) as progress_bar:
@@ -1535,4 +1547,14 @@ class BaseSingleTableSynthesizer(BaseSynthesizer):
1535
1547
  except (Exception, KeyboardInterrupt) as error:
1536
1548
  handle_sampling_error(output_file_path, error)
1537
1549
 
1550
+ SYNTHESIZER_LOGGER.info({
1551
+ 'EVENT': 'Sample',
1552
+ 'TIMESTAMP': sample_timestamp,
1553
+ 'SYNTHESIZER CLASS NAME': self.__class__.__name__,
1554
+ 'SYNTHESIZER ID': self._synthesizer_id,
1555
+ 'TOTAL NUMBER OF TABLES': 1,
1556
+ 'TOTAL NUMBER OF ROWS': len(sampled),
1557
+ 'TOTAL NUMBER OF COLUMNS': len(sampled.columns),
1558
+ })
1559
+
1538
1560
  return sampled
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sdv
3
- Version: 1.36.2.dev0
3
+ Version: 1.36.3.dev0
4
4
  Summary: Generate synthetic data for single table, multi table and sequential data
5
5
  Author-email: "DataCebo, Inc." <info@sdv.dev>
6
6
  License-Expression: BUSL-1.1
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes