sdv 1.38.2.dev0__tar.gz → 1.38.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.
- {sdv-1.38.2.dev0/sdv.egg-info → sdv-1.38.3.dev0}/PKG-INFO +2 -3
- {sdv-1.38.2.dev0 → sdv-1.38.3.dev0}/pyproject.toml +2 -3
- {sdv-1.38.2.dev0 → sdv-1.38.3.dev0}/sdv/__init__.py +1 -1
- sdv-1.38.3.dev0/sdv/datasets/_utils.py +116 -0
- {sdv-1.38.2.dev0 → sdv-1.38.3.dev0}/sdv/datasets/demo.py +3 -0
- {sdv-1.38.2.dev0 → sdv-1.38.3.dev0/sdv.egg-info}/PKG-INFO +2 -3
- {sdv-1.38.2.dev0 → sdv-1.38.3.dev0}/sdv.egg-info/SOURCES.txt +1 -0
- {sdv-1.38.2.dev0 → sdv-1.38.3.dev0}/sdv.egg-info/requires.txt +1 -2
- {sdv-1.38.2.dev0 → sdv-1.38.3.dev0}/LICENSE +0 -0
- {sdv-1.38.2.dev0 → sdv-1.38.3.dev0}/README.md +0 -0
- {sdv-1.38.2.dev0 → sdv-1.38.3.dev0}/sdv/_utils.py +0 -0
- {sdv-1.38.2.dev0 → sdv-1.38.3.dev0}/sdv/cag/__init__.py +0 -0
- {sdv-1.38.2.dev0 → sdv-1.38.3.dev0}/sdv/cag/_errors.py +0 -0
- {sdv-1.38.2.dev0 → sdv-1.38.3.dev0}/sdv/cag/_utils.py +0 -0
- {sdv-1.38.2.dev0 → sdv-1.38.3.dev0}/sdv/cag/base.py +0 -0
- {sdv-1.38.2.dev0 → sdv-1.38.3.dev0}/sdv/cag/fixed_combinations.py +0 -0
- {sdv-1.38.2.dev0 → sdv-1.38.3.dev0}/sdv/cag/fixed_increments.py +0 -0
- {sdv-1.38.2.dev0 → sdv-1.38.3.dev0}/sdv/cag/inequality.py +0 -0
- {sdv-1.38.2.dev0 → sdv-1.38.3.dev0}/sdv/cag/one_hot_encoding.py +0 -0
- {sdv-1.38.2.dev0 → sdv-1.38.3.dev0}/sdv/cag/programmable_constraint.py +0 -0
- {sdv-1.38.2.dev0 → sdv-1.38.3.dev0}/sdv/cag/range.py +0 -0
- {sdv-1.38.2.dev0 → sdv-1.38.3.dev0}/sdv/constraints/__init__.py +0 -0
- {sdv-1.38.2.dev0 → sdv-1.38.3.dev0}/sdv/constraints/base.py +0 -0
- {sdv-1.38.2.dev0 → sdv-1.38.3.dev0}/sdv/constraints/errors.py +0 -0
- {sdv-1.38.2.dev0 → sdv-1.38.3.dev0}/sdv/constraints/tabular.py +0 -0
- {sdv-1.38.2.dev0 → sdv-1.38.3.dev0}/sdv/constraints/utils.py +0 -0
- {sdv-1.38.2.dev0 → sdv-1.38.3.dev0}/sdv/data_processing/__init__.py +0 -0
- {sdv-1.38.2.dev0 → sdv-1.38.3.dev0}/sdv/data_processing/data_processor.py +0 -0
- {sdv-1.38.2.dev0 → sdv-1.38.3.dev0}/sdv/data_processing/datetime_formatter.py +0 -0
- {sdv-1.38.2.dev0 → sdv-1.38.3.dev0}/sdv/data_processing/errors.py +0 -0
- {sdv-1.38.2.dev0 → sdv-1.38.3.dev0}/sdv/data_processing/numerical_formatter.py +0 -0
- {sdv-1.38.2.dev0 → sdv-1.38.3.dev0}/sdv/data_processing/utils.py +0 -0
- {sdv-1.38.2.dev0 → sdv-1.38.3.dev0}/sdv/datasets/__init__.py +0 -0
- {sdv-1.38.2.dev0 → sdv-1.38.3.dev0}/sdv/datasets/local.py +0 -0
- {sdv-1.38.2.dev0 → sdv-1.38.3.dev0}/sdv/errors.py +0 -0
- {sdv-1.38.2.dev0 → sdv-1.38.3.dev0}/sdv/evaluation/__init__.py +0 -0
- {sdv-1.38.2.dev0 → sdv-1.38.3.dev0}/sdv/evaluation/_utils.py +0 -0
- {sdv-1.38.2.dev0 → sdv-1.38.3.dev0}/sdv/evaluation/evaluation.py +0 -0
- {sdv-1.38.2.dev0 → sdv-1.38.3.dev0}/sdv/evaluation/multi_table.py +0 -0
- {sdv-1.38.2.dev0 → sdv-1.38.3.dev0}/sdv/evaluation/single_table.py +0 -0
- {sdv-1.38.2.dev0 → sdv-1.38.3.dev0}/sdv/evaluation/utils.py +0 -0
- {sdv-1.38.2.dev0 → sdv-1.38.3.dev0}/sdv/io/__init__.py +0 -0
- {sdv-1.38.2.dev0 → sdv-1.38.3.dev0}/sdv/io/local/__init__.py +0 -0
- {sdv-1.38.2.dev0 → sdv-1.38.3.dev0}/sdv/io/local/local.py +0 -0
- {sdv-1.38.2.dev0 → sdv-1.38.3.dev0}/sdv/lite/__init__.py +0 -0
- {sdv-1.38.2.dev0 → sdv-1.38.3.dev0}/sdv/lite/single_table.py +0 -0
- {sdv-1.38.2.dev0 → sdv-1.38.3.dev0}/sdv/logging/__init__.py +0 -0
- {sdv-1.38.2.dev0 → sdv-1.38.3.dev0}/sdv/logging/logger.py +0 -0
- {sdv-1.38.2.dev0 → sdv-1.38.3.dev0}/sdv/logging/sdv_logger_config.yml +0 -0
- {sdv-1.38.2.dev0 → sdv-1.38.3.dev0}/sdv/logging/utils.py +0 -0
- {sdv-1.38.2.dev0 → sdv-1.38.3.dev0}/sdv/metadata/__init__.py +0 -0
- {sdv-1.38.2.dev0 → sdv-1.38.3.dev0}/sdv/metadata/errors.py +0 -0
- {sdv-1.38.2.dev0 → sdv-1.38.3.dev0}/sdv/metadata/metadata.py +0 -0
- {sdv-1.38.2.dev0 → sdv-1.38.3.dev0}/sdv/metadata/metadata_upgrader.py +0 -0
- {sdv-1.38.2.dev0 → sdv-1.38.3.dev0}/sdv/metadata/multi_table.py +0 -0
- {sdv-1.38.2.dev0 → sdv-1.38.3.dev0}/sdv/metadata/single_table.py +0 -0
- {sdv-1.38.2.dev0 → sdv-1.38.3.dev0}/sdv/metadata/utils.py +0 -0
- {sdv-1.38.2.dev0 → sdv-1.38.3.dev0}/sdv/metadata/visualization.py +0 -0
- {sdv-1.38.2.dev0 → sdv-1.38.3.dev0}/sdv/metrics/__init__.py +0 -0
- {sdv-1.38.2.dev0 → sdv-1.38.3.dev0}/sdv/metrics/demos.py +0 -0
- {sdv-1.38.2.dev0 → sdv-1.38.3.dev0}/sdv/metrics/relational.py +0 -0
- {sdv-1.38.2.dev0 → sdv-1.38.3.dev0}/sdv/metrics/tabular.py +0 -0
- {sdv-1.38.2.dev0 → sdv-1.38.3.dev0}/sdv/metrics/timeseries.py +0 -0
- {sdv-1.38.2.dev0 → sdv-1.38.3.dev0}/sdv/multi_table/__init__.py +0 -0
- {sdv-1.38.2.dev0 → sdv-1.38.3.dev0}/sdv/multi_table/base.py +0 -0
- {sdv-1.38.2.dev0 → sdv-1.38.3.dev0}/sdv/multi_table/dayz.py +0 -0
- {sdv-1.38.2.dev0 → sdv-1.38.3.dev0}/sdv/multi_table/hma.py +0 -0
- {sdv-1.38.2.dev0 → sdv-1.38.3.dev0}/sdv/multi_table/utils.py +0 -0
- {sdv-1.38.2.dev0 → sdv-1.38.3.dev0}/sdv/sampling/__init__.py +0 -0
- {sdv-1.38.2.dev0 → sdv-1.38.3.dev0}/sdv/sampling/hierarchical_sampler.py +0 -0
- {sdv-1.38.2.dev0 → sdv-1.38.3.dev0}/sdv/sampling/independent_sampler.py +0 -0
- {sdv-1.38.2.dev0 → sdv-1.38.3.dev0}/sdv/sampling/tabular.py +0 -0
- {sdv-1.38.2.dev0 → sdv-1.38.3.dev0}/sdv/sequential/__init__.py +0 -0
- {sdv-1.38.2.dev0 → sdv-1.38.3.dev0}/sdv/sequential/par.py +0 -0
- {sdv-1.38.2.dev0 → sdv-1.38.3.dev0}/sdv/single_table/__init__.py +0 -0
- {sdv-1.38.2.dev0 → sdv-1.38.3.dev0}/sdv/single_table/base.py +0 -0
- {sdv-1.38.2.dev0 → sdv-1.38.3.dev0}/sdv/single_table/copulagan.py +0 -0
- {sdv-1.38.2.dev0 → sdv-1.38.3.dev0}/sdv/single_table/copulas.py +0 -0
- {sdv-1.38.2.dev0 → sdv-1.38.3.dev0}/sdv/single_table/ctgan.py +0 -0
- {sdv-1.38.2.dev0 → sdv-1.38.3.dev0}/sdv/single_table/dayz.py +0 -0
- {sdv-1.38.2.dev0 → sdv-1.38.3.dev0}/sdv/single_table/utils.py +0 -0
- {sdv-1.38.2.dev0 → sdv-1.38.3.dev0}/sdv/utils/__init__.py +0 -0
- {sdv-1.38.2.dev0 → sdv-1.38.3.dev0}/sdv/utils/mixins.py +0 -0
- {sdv-1.38.2.dev0 → sdv-1.38.3.dev0}/sdv/utils/poc.py +0 -0
- {sdv-1.38.2.dev0 → sdv-1.38.3.dev0}/sdv/utils/utils.py +0 -0
- {sdv-1.38.2.dev0 → sdv-1.38.3.dev0}/sdv/version/__init__.py +0 -0
- {sdv-1.38.2.dev0 → sdv-1.38.3.dev0}/sdv.egg-info/dependency_links.txt +0 -0
- {sdv-1.38.2.dev0 → sdv-1.38.3.dev0}/sdv.egg-info/entry_points.txt +0 -0
- {sdv-1.38.2.dev0 → sdv-1.38.3.dev0}/sdv.egg-info/top_level.txt +0 -0
- {sdv-1.38.2.dev0 → sdv-1.38.3.dev0}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: sdv
|
|
3
|
-
Version: 1.38.
|
|
3
|
+
Version: 1.38.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
|
|
@@ -48,8 +48,7 @@ Requires-Dist: deepecho>=0.7.0; python_version < "3.14"
|
|
|
48
48
|
Requires-Dist: deepecho>=0.8.0; python_version >= "3.14"
|
|
49
49
|
Requires-Dist: rdt>=1.18.2; python_version < "3.14"
|
|
50
50
|
Requires-Dist: rdt>=1.20.0; python_version >= "3.14"
|
|
51
|
-
Requires-Dist: sdmetrics>=0.
|
|
52
|
-
Requires-Dist: plotly<7.0.0
|
|
51
|
+
Requires-Dist: sdmetrics>=0.30.0
|
|
53
52
|
Requires-Dist: platformdirs>=4.0
|
|
54
53
|
Requires-Dist: pyyaml>=6.0.1
|
|
55
54
|
Provides-Extra: excel
|
|
@@ -46,8 +46,7 @@ dependencies = [
|
|
|
46
46
|
"deepecho>=0.8.0;python_version>='3.14'",
|
|
47
47
|
"rdt>=1.18.2;python_version<'3.14'",
|
|
48
48
|
"rdt>=1.20.0;python_version>='3.14'",
|
|
49
|
-
"sdmetrics>=0.
|
|
50
|
-
"plotly<7.0.0",
|
|
49
|
+
"sdmetrics>=0.30.0",
|
|
51
50
|
'platformdirs>=4.0',
|
|
52
51
|
'pyyaml>=6.0.1',
|
|
53
52
|
]
|
|
@@ -150,7 +149,7 @@ namespaces = false
|
|
|
150
149
|
version = {attr = 'sdv.__version__'}
|
|
151
150
|
|
|
152
151
|
[tool.bumpversion]
|
|
153
|
-
current_version = "1.38.
|
|
152
|
+
current_version = "1.38.3.dev0"
|
|
154
153
|
parse = '(?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\.(?P<release>[a-z]+)(?P<candidate>\d+))?'
|
|
155
154
|
serialize = [
|
|
156
155
|
'{major}.{minor}.{patch}.{release}{candidate}',
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import warnings
|
|
2
|
+
|
|
3
|
+
from pandas.core.dtypes.common import is_object_dtype
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class InvalidDataWarning(Warning):
|
|
7
|
+
pass
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def _process_adventure_works(data):
|
|
11
|
+
data = data.copy()
|
|
12
|
+
data['CountryRegion'].loc[data['CountryRegion']['Name'] == 'Namibia', 'CountryRegionCode'] = (
|
|
13
|
+
'NA'
|
|
14
|
+
)
|
|
15
|
+
integer_comma_columns = {
|
|
16
|
+
'PurchaseOrderDetail': [
|
|
17
|
+
'ReceivedQty',
|
|
18
|
+
'RejectedQty',
|
|
19
|
+
'StockedQty',
|
|
20
|
+
],
|
|
21
|
+
'BillOfMaterials': ['PerAssemblyQty'],
|
|
22
|
+
'TransactionHistoryArchive': [],
|
|
23
|
+
}
|
|
24
|
+
float_comma_columns = {
|
|
25
|
+
'Product': ['StandardCost', 'ListPrice', 'Weight'],
|
|
26
|
+
'ProductListPriceHistory': ['ListPrice'],
|
|
27
|
+
'ProductCostHistory': ['StandardCost'],
|
|
28
|
+
'ProductVendor': ['StandardPrice', 'LastReceiptCost'],
|
|
29
|
+
'SalesOrderDetail': ['UnitPrice', 'UnitPriceDiscount', 'LineTotal'],
|
|
30
|
+
'SalesOrderHeader': ['SubTotal', 'TaxAmt', 'Freight', 'TotalDue'],
|
|
31
|
+
'PurchaseOrderDetail': [
|
|
32
|
+
'UnitPrice',
|
|
33
|
+
'LineTotal',
|
|
34
|
+
],
|
|
35
|
+
'PurchaseOrderHeader': ['SubTotal', 'TaxAmt', 'Freight', 'TotalDue'],
|
|
36
|
+
'TransactionHistory': ['ActualCost'],
|
|
37
|
+
'TransactionHistoryArchive': ['ActualCost'],
|
|
38
|
+
'SalesTaxRate': ['TaxRate'],
|
|
39
|
+
'EmployeePayHistory': ['Rate'],
|
|
40
|
+
'ShipMethod': ['ShipBase', 'ShipRate'],
|
|
41
|
+
'Location': ['CostRate', 'Availability'],
|
|
42
|
+
'WorkOrderRouting': ['ActualResourceHrs', 'PlannedCost', 'ActualCost'],
|
|
43
|
+
'SalesPersonQuotaHistory': ['SalesQuota'],
|
|
44
|
+
'SalesPerson': [
|
|
45
|
+
'SalesQuota',
|
|
46
|
+
'Bonus',
|
|
47
|
+
'CommissionPct',
|
|
48
|
+
'SalesYTD',
|
|
49
|
+
'SalesLastYear',
|
|
50
|
+
],
|
|
51
|
+
'SalesTerritory': ['SalesYTD', 'SalesLastYear', 'CostYTD', 'CostLastYear'],
|
|
52
|
+
'CurrencyRate': ['AverageRate', 'EndOfDayRate'],
|
|
53
|
+
'SpecialOffer': ['DiscountPct'],
|
|
54
|
+
}
|
|
55
|
+
for table_name, columns in float_comma_columns.items():
|
|
56
|
+
for column_name in columns:
|
|
57
|
+
col = data[table_name][column_name]
|
|
58
|
+
if is_object_dtype(col.dtype):
|
|
59
|
+
data[table_name][column_name] = col.str.replace(',', '.').astype(float)
|
|
60
|
+
|
|
61
|
+
for table_name, columns in integer_comma_columns.items():
|
|
62
|
+
for column_name in columns:
|
|
63
|
+
col = data[table_name][column_name]
|
|
64
|
+
if is_object_dtype(col.dtype):
|
|
65
|
+
data[table_name][column_name] = (
|
|
66
|
+
col.str.replace(',', '.').astype(float).astype('int64')
|
|
67
|
+
)
|
|
68
|
+
EMAIL_NAME_FIXES = {
|
|
69
|
+
'fran?ois': 'francois',
|
|
70
|
+
'jos?': 'jose',
|
|
71
|
+
'j?sus': 'jesus',
|
|
72
|
+
'mar?a': 'maria',
|
|
73
|
+
'c?sar': 'cesar',
|
|
74
|
+
'andr?s': 'andres',
|
|
75
|
+
'ram?n': 'ramon',
|
|
76
|
+
'bego?a': 'begona',
|
|
77
|
+
'desir?e': 'desiree',
|
|
78
|
+
'ren?e': 'renee',
|
|
79
|
+
'al?cia': 'alicia',
|
|
80
|
+
'ni?ia': 'ninia',
|
|
81
|
+
}
|
|
82
|
+
for table_name in ('EmailAddress', 'ProductReview'):
|
|
83
|
+
emails = data[table_name]['EmailAddress']
|
|
84
|
+
for broken, fixed in EMAIL_NAME_FIXES.items():
|
|
85
|
+
emails = emails.str.replace(broken, fixed, regex=False)
|
|
86
|
+
data[table_name]['EmailAddress'] = emails
|
|
87
|
+
|
|
88
|
+
PHONE_COLUMNS = {
|
|
89
|
+
'PersonPhone': ['PhoneNumber'],
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
for table_name, columns in PHONE_COLUMNS.items():
|
|
93
|
+
for column_name in columns:
|
|
94
|
+
col = data[table_name][column_name].astype('string')
|
|
95
|
+
needs_prefix = col.notna() & ~col.str.startswith('+')
|
|
96
|
+
data[table_name][column_name] = col.where(~needs_prefix, '+1 ' + col)
|
|
97
|
+
|
|
98
|
+
return data
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
def process_adventure_works(data, metadata):
|
|
102
|
+
try:
|
|
103
|
+
metadata.validate_data(data)
|
|
104
|
+
return data, metadata
|
|
105
|
+
except Exception:
|
|
106
|
+
try:
|
|
107
|
+
processed_data = _process_adventure_works(data)
|
|
108
|
+
metadata.validate_data(processed_data)
|
|
109
|
+
return processed_data, metadata
|
|
110
|
+
except Exception:
|
|
111
|
+
warning_msg = (
|
|
112
|
+
'This downloaded data and metadata are not compatible with each other. They '
|
|
113
|
+
'cannot be modeled using SDV without some modifications.'
|
|
114
|
+
)
|
|
115
|
+
warnings.warn(warning_msg, InvalidDataWarning)
|
|
116
|
+
return data, metadata
|
|
@@ -18,6 +18,7 @@ import yaml
|
|
|
18
18
|
from botocore import UNSIGNED
|
|
19
19
|
from botocore.client import Config
|
|
20
20
|
|
|
21
|
+
from sdv.datasets._utils import process_adventure_works
|
|
21
22
|
from sdv.errors import DemoResourceNotFoundError, DemoResourceNotFoundWarning
|
|
22
23
|
from sdv.metadata.metadata import Metadata
|
|
23
24
|
|
|
@@ -506,6 +507,8 @@ def download_demo(
|
|
|
506
507
|
data = data.popitem()[1]
|
|
507
508
|
|
|
508
509
|
metadata = _get_metadata(metadata_bytes, dataset_name, output_folder_name)
|
|
510
|
+
if dataset_name == 'adventure-works':
|
|
511
|
+
data, metadata = process_adventure_works(data, metadata)
|
|
509
512
|
return data, metadata
|
|
510
513
|
|
|
511
514
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: sdv
|
|
3
|
-
Version: 1.38.
|
|
3
|
+
Version: 1.38.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
|
|
@@ -48,8 +48,7 @@ Requires-Dist: deepecho>=0.7.0; python_version < "3.14"
|
|
|
48
48
|
Requires-Dist: deepecho>=0.8.0; python_version >= "3.14"
|
|
49
49
|
Requires-Dist: rdt>=1.18.2; python_version < "3.14"
|
|
50
50
|
Requires-Dist: rdt>=1.20.0; python_version >= "3.14"
|
|
51
|
-
Requires-Dist: sdmetrics>=0.
|
|
52
|
-
Requires-Dist: plotly<7.0.0
|
|
51
|
+
Requires-Dist: sdmetrics>=0.30.0
|
|
53
52
|
Requires-Dist: platformdirs>=4.0
|
|
54
53
|
Requires-Dist: pyyaml>=6.0.1
|
|
55
54
|
Provides-Extra: excel
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|