deepecho 0.6.1.dev0__tar.gz → 0.7.0.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.
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: deepecho
3
- Version: 0.6.1.dev0
3
+ Version: 0.7.0.dev0
4
4
  Summary: Create sequential synthetic data of mixed types using a GAN.
5
5
  Author-email: "DataCebo, Inc." <info@sdv.dev>
6
6
  License: BSL-1.1
@@ -19,20 +19,24 @@ Classifier: Programming Language :: Python :: 3.9
19
19
  Classifier: Programming Language :: Python :: 3.10
20
20
  Classifier: Programming Language :: Python :: 3.11
21
21
  Classifier: Programming Language :: Python :: 3.12
22
+ Classifier: Programming Language :: Python :: 3.13
22
23
  Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
23
- Requires-Python: <3.13,>=3.8
24
+ Requires-Python: <3.14,>=3.8
24
25
  Description-Content-Type: text/markdown
25
26
  License-File: LICENSE
26
27
  Requires-Dist: numpy>=1.21.0; python_version < "3.10"
27
28
  Requires-Dist: numpy>=1.23.3; python_version >= "3.10" and python_version < "3.12"
28
- Requires-Dist: numpy>=1.26.0; python_version >= "3.12"
29
+ Requires-Dist: numpy>=1.26.0; python_version >= "3.12" and python_version < "3.13"
30
+ Requires-Dist: numpy>=2.1.0; python_version >= "3.13"
29
31
  Requires-Dist: pandas>=1.4.0; python_version < "3.11"
30
32
  Requires-Dist: pandas>=1.5.0; python_version >= "3.11" and python_version < "3.12"
31
- Requires-Dist: pandas>=2.1.1; python_version >= "3.12"
33
+ Requires-Dist: pandas>=2.1.1; python_version >= "3.12" and python_version < "3.13"
34
+ Requires-Dist: pandas>=2.2.3; python_version >= "3.13"
32
35
  Requires-Dist: torch>=1.9.0; python_version < "3.10"
33
36
  Requires-Dist: torch>=1.11.0; python_version >= "3.10" and python_version < "3.11"
34
37
  Requires-Dist: torch>=2.0.0; python_version >= "3.11" and python_version < "3.12"
35
- Requires-Dist: torch>=2.2.0; python_version >= "3.12"
38
+ Requires-Dist: torch>=2.2.0; python_version >= "3.12" and python_version < "3.13"
39
+ Requires-Dist: torch>=2.6.0; python_version >= "3.13"
36
40
  Requires-Dist: tqdm>=4.29
37
41
  Provides-Extra: test
38
42
  Requires-Dist: pytest>=3.4.2; extra == "test"
@@ -2,7 +2,7 @@
2
2
 
3
3
  __author__ = 'DataCebo, Inc.'
4
4
  __email__ = 'info@sdv.dev'
5
- __version__ = '0.6.1.dev0'
5
+ __version__ = '0.7.0.dev0'
6
6
  __path__ = __import__('pkgutil').extend_path(__path__, __name__)
7
7
 
8
8
  from deepecho.demo import load_demo
@@ -54,12 +54,12 @@ class DeepEcho:
54
54
  For example, a sequence might look something like::
55
55
 
56
56
  {
57
- "context": [1],
58
- "data": [
57
+ 'context': [1],
58
+ 'data': [
59
59
  [1, 3, 4, 5, 11, 3, 4],
60
- [2, 2, 3, 4, 5, 1, 2],
61
- [1, 3, 4, 5, 2, 3, 1]
62
- ]
60
+ [2, 2, 3, 4, 5, 1, 2],
61
+ [1, 3, 4, 5, 2, 3, 1],
62
+ ],
63
63
  }
64
64
 
65
65
  The "context" attribute maps to a list of variables which
@@ -148,7 +148,7 @@ class DeepEcho:
148
148
  if segment_size is not None and not isinstance(segment_size, int):
149
149
  if sequence_index is None:
150
150
  raise TypeError(
151
- '`segment_size` must be of type `int` if ' 'no `sequence_index` is given.'
151
+ '`segment_size` must be of type `int` if no `sequence_index` is given.'
152
152
  )
153
153
  if data[sequence_index].dtype.kind != 'M':
154
154
  raise TypeError(
@@ -271,7 +271,7 @@ class BasicGANModel(DeepEcho):
271
271
  def _normalize(tensor, value, properties):
272
272
  """Normalize the value between 0 and 1 and flag nans."""
273
273
  value_idx, missing_idx = properties['indices']
274
- if pd.isnull(value):
274
+ if pd.isna(value):
275
275
  tensor[value_idx] = 0.0
276
276
  tensor[missing_idx] = 1.0
277
277
  else:
@@ -493,12 +493,12 @@ class BasicGANModel(DeepEcho):
493
493
  For example, a sequence might look something like::
494
494
 
495
495
  {
496
- "context": [1],
497
- "data": [
496
+ 'context': [1],
497
+ 'data': [
498
498
  [1, 3, 4, 5, 11, 3, 4],
499
- [2, 2, 3, 4, 5, 1, 2],
500
- [1, 3, 4, 5, 2, 3, 1]
501
- ]
499
+ [2, 2, 3, 4, 5, 1, 2],
500
+ [1, 3, 4, 5, 2, 3, 1],
501
+ ],
502
502
  }
503
503
 
504
504
  The "context" attribute maps to a list of variables which
@@ -131,7 +131,7 @@ class PARModel(DeepEcho):
131
131
  'type': t,
132
132
  'mu': np.nanmean(x[i]),
133
133
  'std': np.nanstd(x[i]),
134
- 'nulls': pd.isnull(x[i]).any(),
134
+ 'nulls': pd.isna(x[i]).any(),
135
135
  'indices': (idx, idx + 1, idx + 2),
136
136
  }
137
137
  idx += 3
@@ -141,7 +141,7 @@ class PARModel(DeepEcho):
141
141
  'type': t,
142
142
  'min': np.nanmin(x[i]),
143
143
  'range': np.nanmax(x[i]) - np.nanmin(x[i]),
144
- 'nulls': pd.isnull(x[i]).any(),
144
+ 'nulls': pd.isna(x[i]).any(),
145
145
  'indices': (idx, idx + 1, idx + 2),
146
146
  }
147
147
  idx += 3
@@ -150,7 +150,7 @@ class PARModel(DeepEcho):
150
150
  idx_map[i] = {'type': t, 'indices': {}}
151
151
  idx += 1
152
152
  for v in set(x[i]):
153
- if pd.isnull(v):
153
+ if pd.isna(v):
154
154
  v = None
155
155
 
156
156
  idx_map[i]['indices'][v] = idx
@@ -210,30 +210,30 @@ class PARModel(DeepEcho):
210
210
 
211
211
  elif props['type'] in ['continuous', 'timestamp']:
212
212
  mu_idx, sigma_idx, missing_idx = props['indices']
213
- if pd.isnull(data[key][i]) or props['std'] == 0:
213
+ if pd.isna(data[key][i]) or props['std'] == 0:
214
214
  x[mu_idx] = 0.0
215
215
  else:
216
216
  x[mu_idx] = (data[key][i] - props['mu']) / props['std']
217
217
 
218
218
  x[sigma_idx] = 0.0
219
- x[missing_idx] = 1.0 if pd.isnull(data[key][i]) else 0.0
219
+ x[missing_idx] = 1.0 if pd.isna(data[key][i]) else 0.0
220
220
 
221
221
  elif props['type'] in ['count']:
222
222
  r_idx, p_idx, missing_idx = props['indices']
223
- if pd.isnull(data[key][i]) or props['range'] == 0:
223
+ if pd.isna(data[key][i]) or props['range'] == 0:
224
224
  x[r_idx] = 0.0
225
225
  else:
226
226
  x[r_idx] = (data[key][i] - props['min']) / props['range']
227
227
 
228
228
  x[p_idx] = 0.0
229
- x[missing_idx] = 1.0 if pd.isnull(data[key][i]) else 0.0
229
+ x[missing_idx] = 1.0 if pd.isna(data[key][i]) else 0.0
230
230
 
231
231
  elif props['type'] in [
232
232
  'categorical',
233
233
  'ordinal',
234
234
  ]: # categorical
235
235
  value = data[key][i]
236
- if pd.isnull(value):
236
+ if pd.isna(value):
237
237
  value = None
238
238
  x[props['indices'][value]] = 1.0
239
239
 
@@ -258,25 +258,25 @@ class PARModel(DeepEcho):
258
258
  mu_idx, sigma_idx, missing_idx = props['indices']
259
259
  x[mu_idx] = (
260
260
  0.0
261
- if (pd.isnull(context[key]) or props['std'] == 0)
261
+ if (pd.isna(context[key]) or props['std'] == 0)
262
262
  else (context[key] - props['mu']) / props['std']
263
263
  )
264
264
  x[sigma_idx] = 0.0
265
- x[missing_idx] = 1.0 if pd.isnull(context[key]) else 0.0
265
+ x[missing_idx] = 1.0 if pd.isna(context[key]) else 0.0
266
266
 
267
267
  elif props['type'] in ['count']:
268
268
  r_idx, p_idx, missing_idx = props['indices']
269
269
  x[r_idx] = (
270
270
  0.0
271
- if (pd.isnull(context[key]) or props['range'] == 0)
271
+ if (pd.isna(context[key]) or props['range'] == 0)
272
272
  else (context[key] - props['min']) / props['range']
273
273
  )
274
274
  x[p_idx] = 0.0
275
- x[missing_idx] = 1.0 if pd.isnull(context[key]) else 0.0
275
+ x[missing_idx] = 1.0 if pd.isna(context[key]) else 0.0
276
276
 
277
277
  elif props['type'] in ['categorical', 'ordinal']:
278
278
  value = context[key]
279
- if pd.isnull(value):
279
+ if pd.isna(value):
280
280
  value = None
281
281
  x[props['indices'][value]] = 1.0
282
282
 
@@ -295,12 +295,12 @@ class PARModel(DeepEcho):
295
295
  For example, a sequence might look something like::
296
296
 
297
297
  {
298
- "context": [1],
299
- "data": [
298
+ 'context': [1],
299
+ 'data': [
300
300
  [1, 3, 4, 5, 11, 3, 4],
301
- [2, 2, 3, 4, 5, 1, 2],
302
- [1, 3, 4, 5, 2, 3, 1]
303
- ]
301
+ [2, 2, 3, 4, 5, 1, 2],
302
+ [1, 3, 4, 5, 2, 3, 1],
303
+ ],
304
304
  }
305
305
 
306
306
  The "context" attribute maps to a list of variables which
@@ -406,9 +406,7 @@ class PARModel(DeepEcho):
406
406
  p_true = X_padded[: seq_len[i], i, missing_idx]
407
407
  p_pred = missing[: seq_len[i], i]
408
408
  log_likelihood += torch.sum(p_true * p_pred)
409
- log_likelihood += torch.sum(
410
- (1.0 - p_true) * torch.log(1.0 - torch.exp(p_pred))
411
- )
409
+ log_likelihood += torch.sum((1.0 - p_true) * torch.log(1.0 - torch.exp(p_pred)))
412
410
 
413
411
  elif props['type'] in ['count']:
414
412
  r_idx, p_idx, missing_idx = props['indices']
@@ -428,9 +426,7 @@ class PARModel(DeepEcho):
428
426
  p_true = X_padded[: seq_len[i], i, missing_idx]
429
427
  p_pred = missing[: seq_len[i], i]
430
428
  log_likelihood += torch.sum(p_true * p_pred)
431
- log_likelihood += torch.sum(
432
- (1.0 - p_true) * torch.log(1.0 - torch.exp(p_pred))
433
- )
429
+ log_likelihood += torch.sum((1.0 - p_true) * torch.log(1.0 - torch.exp(p_pred)))
434
430
 
435
431
  elif props['type'] in ['categorical', 'ordinal']:
436
432
  idx = list(props['indices'].values())
@@ -59,7 +59,7 @@ def segment_by_time(sequence, segment_size, sequence_index):
59
59
  while start <= max_time:
60
60
  end = start + segment_size
61
61
  selected = (start <= sequence_index) & (sequence_index < end)
62
- sequences.append(sequence[selected.values].reset_index(drop=True))
62
+ sequences.append(sequence[selected.to_numpy()].reset_index(drop=True))
63
63
  start = end
64
64
 
65
65
  return sequences
@@ -112,7 +112,7 @@ def _convert_to_dicts(segments, context_columns):
112
112
  if len(context.drop_duplicates()) > 1:
113
113
  raise ValueError('Context columns are not constant within each segment.')
114
114
 
115
- context = context.iloc[0].values
115
+ context = context.iloc[0].to_numpy()
116
116
  segment = segment.drop(context_columns, axis=1)
117
117
  else:
118
118
  context = []
@@ -180,7 +180,7 @@ def assemble_sequences(
180
180
  segments = []
181
181
  groupby_columns = entity_columns[0] if len(entity_columns) == 1 else entity_columns
182
182
  for _, sequence in data.groupby(groupby_columns):
183
- sequence.drop(entity_columns, axis=1, inplace=True)
183
+ sequence = sequence.drop(entity_columns, axis=1)
184
184
  if context_columns:
185
185
  if len(sequence[context_columns].drop_duplicates()) > 1:
186
186
  raise ValueError('Context columns are not constant within each entity.')
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: deepecho
3
- Version: 0.6.1.dev0
3
+ Version: 0.7.0.dev0
4
4
  Summary: Create sequential synthetic data of mixed types using a GAN.
5
5
  Author-email: "DataCebo, Inc." <info@sdv.dev>
6
6
  License: BSL-1.1
@@ -19,20 +19,24 @@ Classifier: Programming Language :: Python :: 3.9
19
19
  Classifier: Programming Language :: Python :: 3.10
20
20
  Classifier: Programming Language :: Python :: 3.11
21
21
  Classifier: Programming Language :: Python :: 3.12
22
+ Classifier: Programming Language :: Python :: 3.13
22
23
  Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
23
- Requires-Python: <3.13,>=3.8
24
+ Requires-Python: <3.14,>=3.8
24
25
  Description-Content-Type: text/markdown
25
26
  License-File: LICENSE
26
27
  Requires-Dist: numpy>=1.21.0; python_version < "3.10"
27
28
  Requires-Dist: numpy>=1.23.3; python_version >= "3.10" and python_version < "3.12"
28
- Requires-Dist: numpy>=1.26.0; python_version >= "3.12"
29
+ Requires-Dist: numpy>=1.26.0; python_version >= "3.12" and python_version < "3.13"
30
+ Requires-Dist: numpy>=2.1.0; python_version >= "3.13"
29
31
  Requires-Dist: pandas>=1.4.0; python_version < "3.11"
30
32
  Requires-Dist: pandas>=1.5.0; python_version >= "3.11" and python_version < "3.12"
31
- Requires-Dist: pandas>=2.1.1; python_version >= "3.12"
33
+ Requires-Dist: pandas>=2.1.1; python_version >= "3.12" and python_version < "3.13"
34
+ Requires-Dist: pandas>=2.2.3; python_version >= "3.13"
32
35
  Requires-Dist: torch>=1.9.0; python_version < "3.10"
33
36
  Requires-Dist: torch>=1.11.0; python_version >= "3.10" and python_version < "3.11"
34
37
  Requires-Dist: torch>=2.0.0; python_version >= "3.11" and python_version < "3.12"
35
- Requires-Dist: torch>=2.2.0; python_version >= "3.12"
38
+ Requires-Dist: torch>=2.2.0; python_version >= "3.12" and python_version < "3.13"
39
+ Requires-Dist: torch>=2.6.0; python_version >= "3.13"
36
40
  Requires-Dist: tqdm>=4.29
37
41
  Provides-Extra: test
38
42
  Requires-Dist: pytest>=3.4.2; extra == "test"
@@ -17,11 +17,16 @@ numpy>=1.23.3
17
17
  pandas>=1.5.0
18
18
  torch>=2.0.0
19
19
 
20
- [:python_version >= "3.12"]
20
+ [:python_version >= "3.12" and python_version < "3.13"]
21
21
  numpy>=1.26.0
22
22
  pandas>=2.1.1
23
23
  torch>=2.2.0
24
24
 
25
+ [:python_version >= "3.13"]
26
+ numpy>=2.1.0
27
+ pandas>=2.2.3
28
+ torch>=2.6.0
29
+
25
30
  [dev]
26
31
  deepecho[test]
27
32
  setuptools<70
@@ -13,24 +13,28 @@ classifiers = [
13
13
  'Programming Language :: Python :: 3.10',
14
14
  'Programming Language :: Python :: 3.11',
15
15
  'Programming Language :: Python :: 3.12',
16
+ 'Programming Language :: Python :: 3.13',
16
17
  'Topic :: Scientific/Engineering :: Artificial Intelligence',
17
18
  ]
18
19
  keywords = ['deepecho', 'DeepEcho']
19
20
  dynamic = ['version']
20
21
  license = { text = 'BSL-1.1' }
21
- requires-python = '>=3.8,<3.13'
22
+ requires-python = '>=3.8,<3.14'
22
23
  readme = 'README.md'
23
24
  dependencies = [
24
25
  "numpy>=1.21.0;python_version<'3.10'",
25
26
  "numpy>=1.23.3;python_version>='3.10' and python_version<'3.12'",
26
- "numpy>=1.26.0;python_version>='3.12'",
27
+ "numpy>=1.26.0;python_version>='3.12' and python_version<'3.13'",
28
+ "numpy>=2.1.0;python_version>='3.13'",
27
29
  "pandas>=1.4.0;python_version<'3.11'",
28
30
  "pandas>=1.5.0;python_version>='3.11' and python_version<'3.12'",
29
- "pandas>=2.1.1;python_version>='3.12'",
31
+ "pandas>=2.1.1;python_version>='3.12' and python_version<'3.13'",
32
+ "pandas>=2.2.3;python_version>='3.13'",
30
33
  "torch>=1.9.0;python_version<'3.10'",
31
34
  "torch>=1.11.0;python_version>='3.10' and python_version<'3.11'",
32
35
  "torch>=2.0.0;python_version>='3.11' and python_version<'3.12'",
33
- "torch>=2.2.0;python_version>='3.12'",
36
+ "torch>=2.2.0;python_version>='3.12' and python_version<'3.13'",
37
+ "torch>=2.6.0;python_version>='3.13'",
34
38
  'tqdm>=4.29',
35
39
  ]
36
40
 
@@ -122,7 +126,7 @@ use_parentheses = true
122
126
  collect_ignore = ['pyproject.toml']
123
127
 
124
128
  [tool.bumpversion]
125
- current_version = "0.6.1.dev0"
129
+ current_version = "0.7.0.dev0"
126
130
  parse = '(?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\.(?P<release>[a-z]+)(?P<candidate>\d+))?'
127
131
  serialize = [
128
132
  '{major}.{minor}.{patch}.{release}{candidate}',
@@ -160,7 +164,8 @@ build-backend = 'setuptools.build_meta'
160
164
 
161
165
  [tool.ruff]
162
166
  preview = true
163
- line-length = 99
167
+ line-length = 100
168
+ indent-width = 4
164
169
  src = ["deepecho"]
165
170
  target-version = "py312"
166
171
  exclude = [
@@ -168,7 +173,9 @@ exclude = [
168
173
  ".tox",
169
174
  ".git",
170
175
  "__pycache__",
171
- ".ipynb_checkpoints"
176
+ "*.ipynb",
177
+ ".ipynb_checkpoints",
178
+ "tasks.py",
172
179
  ]
173
180
 
174
181
  [tool.ruff.lint]
@@ -178,13 +185,23 @@ select = [
178
185
  # Pycodestyle
179
186
  "E",
180
187
  "W",
188
+ # pydocstyle
189
+ "D",
181
190
  # isort
182
- "I001"
191
+ "I001",
192
+ # print statements
193
+ "T201",
194
+ # pandas-vet
195
+ "PD",
196
+ # numpy 2.0
197
+ "NPY201"
183
198
  ]
184
199
  ignore = [
185
- "E501",
200
+ # pydocstyle
186
201
  "D107", # Missing docstring in __init__
187
202
  "D417", # Missing argument descriptions in the docstring, this is a bug from pydocstyle: https://github.com/PyCQA/pydocstyle/issues/449
203
+ "PD901",
204
+ "PD101",
188
205
  ]
189
206
 
190
207
  [tool.ruff.lint.pep8-naming]
@@ -192,6 +209,7 @@ extend-ignore-names = ["X", "C", "X_padded", "Y", "Y_padded"]
192
209
 
193
210
  [tool.ruff.lint.isort]
194
211
  known-first-party = ["deepecho"]
212
+ lines-between-types = 0
195
213
 
196
214
  [tool.ruff.lint.per-file-ignores]
197
215
  "__init__.py" = ["F401", "E402", "F403", "F405", "E501", "I001"]
@@ -200,6 +218,12 @@ known-first-party = ["deepecho"]
200
218
  quote-style = "single"
201
219
  indent-style = "space"
202
220
  preview = true
221
+ docstring-code-format = true
222
+ docstring-code-line-length = "dynamic"
203
223
 
204
224
  [tool.ruff.lint.pydocstyle]
205
225
  convention = "google"
226
+
227
+ [tool.ruff.lint.pycodestyle]
228
+ max-doc-length = 100
229
+ max-line-length = 100
File without changes
File without changes
File without changes