sonusai 1.0.4__py3-none-any.whl → 1.0.5__py3-none-any.whl

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.
@@ -130,6 +130,7 @@ def initialize_db(location: str, test: bool = False) -> None:
130
130
  snr_gain FLOAT NOT NULL,
131
131
  snr_random BOOLEAN NOT NULL,
132
132
  start INTEGER NOT NULL,
133
+ UNIQUE(effects, file_id, pre_tempo, repeat, snr, snr_gain, snr_random, start),
133
134
  FOREIGN KEY(file_id) REFERENCES source_file (id))
134
135
  """)
135
136
 
@@ -436,28 +437,7 @@ def populate_mixture_table(
436
437
 
437
438
  # Populate source table
438
439
  if logging:
439
- logger.info("Populating source table")
440
- # TODO: refactor this to not load all sources into list; maybe us UNIQUE table modifier?
441
- sources: list[tuple[str, int, float, bool, float, float, bool, int]] = []
442
- for mixture in mixtures:
443
- for source in mixture.all_sources.values():
444
- entry = from_source(source)
445
- if entry not in sources:
446
- sources.append(entry)
447
- for source in track(sources, disable=not show_progress):
448
- con.execute(
449
- """
450
- INSERT INTO source (effects, file_id, pre_tempo, repeat, snr, snr_gain, snr_random, start)
451
- VALUES (?, ?, ?, ?, ?, ?, ?, ?)
452
- """,
453
- source,
454
- )
455
-
456
- con.commit()
457
-
458
- # Populate mixture table
459
- if logging:
460
- logger.info("Populating mixture table")
440
+ logger.info("Populating mixture and source tables")
461
441
  for mixture in track(mixtures, disable=not show_progress):
462
442
  m_id = int(mixture.name) + 1
463
443
  con.execute(
@@ -469,6 +449,14 @@ def populate_mixture_table(
469
449
  )
470
450
 
471
451
  for source in mixture.all_sources.values():
452
+ con.execute(
453
+ """
454
+ INSERT OR IGNORE INTO source (effects, file_id, pre_tempo, repeat, snr, snr_gain, snr_random, start)
455
+ VALUES (?, ?, ?, ?, ?, ?, ?, ?)
456
+ """,
457
+ from_source(source),
458
+ )
459
+
472
460
  source_id = con.execute(
473
461
  """
474
462
  SELECT id
@@ -487,7 +475,7 @@ def populate_mixture_table(
487
475
  con.execute("INSERT INTO mixture_source (mixture_id, source_id) VALUES (?, ?)", (m_id, source_id))
488
476
 
489
477
  if logging:
490
- logger.info("Closing mixture table")
478
+ logger.info("Closing mixture and source tables")
491
479
  con.commit()
492
480
  con.close()
493
481
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: sonusai
3
- Version: 1.0.4
3
+ Version: 1.0.5
4
4
  Summary: Framework for building deep neural network models for sound, speech, and voice AI
5
5
  Home-page: https://aaware.com
6
6
  License: GPL-3.0-only
@@ -54,7 +54,7 @@ sonusai/mixture/data_io.py,sha256=DV48sFcP2Qp3NBzvcnlptQOXU3aUEcAeLuh3XOtC5jI,53
54
54
  sonusai/mixture/db_datatypes.py,sha256=VvNtbOgt5WSeSnBoVcNGC5gs_7hX_38pDUPjy5KRbG4,1471
55
55
  sonusai/mixture/effects.py,sha256=ghMO-WiSMQc1CvafD0wkt_DGsM2A6Hi_oZS6j-jeZh8,11784
56
56
  sonusai/mixture/feature.py,sha256=7GJvFhfqeqerfjy9Vq9aKt-cecgYblK0IypNNo5hgwY,2285
57
- sonusai/mixture/generation.py,sha256=iozYcur9oGFDOgovph-F7mzuaD7ie-2ED4NE7kpAPWY,32559
57
+ sonusai/mixture/generation.py,sha256=rsn2BO95UoXR_tX1IjcwCeYqVPzkohxQSTt5FsMKyhg,32179
58
58
  sonusai/mixture/helpers.py,sha256=dmyHwf1C5dZjYOd11kVV16KI33CaM-dU_fyaxOrrKt8,11642
59
59
  sonusai/mixture/ir_delay.py,sha256=aiC23HMWQ08-v5wORgMx1_DOJSdh4kunULqiQ-SGuMo,2026
60
60
  sonusai/mixture/ir_effects.py,sha256=PqiqD4PS42-7kD6ESnsZi2a3tnKCFa4E0xqUujRBvGg,2152
@@ -132,7 +132,7 @@ sonusai/utils/tokenized_shell_vars.py,sha256=EDrrAgz5lJ0RBAjLcTJt1MeyjhbNZiqXkym
132
132
  sonusai/utils/write_audio.py,sha256=IHzrJoFtFcea_J6wo6QSiojRkgnNOzAEcg-z0rFV7nU,810
133
133
  sonusai/utils/yes_or_no.py,sha256=0h1okjXmDNbJp7rZJFR2V-HFU1GJDm3YFTUVmYExkOU,263
134
134
  sonusai/vars.py,sha256=m8pdgfR4A6A9TCGf_rok6jPAT5BgrEsYXTSISIh1nrI,1163
135
- sonusai-1.0.4.dist-info/METADATA,sha256=zoOsV6OKVVFihoDmuEyN9mDCLoNPww_3WdB3d-YsJ3Y,2652
136
- sonusai-1.0.4.dist-info/WHEEL,sha256=RaoafKOydTQ7I_I3JTrPCg6kUmTgtm4BornzOqyEfJ8,88
137
- sonusai-1.0.4.dist-info/entry_points.txt,sha256=zMNjEphEPO6B3cD1GNpit7z-yA9tUU5-j3W2v-UWstU,92
138
- sonusai-1.0.4.dist-info/RECORD,,
135
+ sonusai-1.0.5.dist-info/METADATA,sha256=Q1nZTGYPe4eF4Zs8HEQWp5dKsINA8_CmHUQxfT57uJM,2652
136
+ sonusai-1.0.5.dist-info/WHEEL,sha256=RaoafKOydTQ7I_I3JTrPCg6kUmTgtm4BornzOqyEfJ8,88
137
+ sonusai-1.0.5.dist-info/entry_points.txt,sha256=zMNjEphEPO6B3cD1GNpit7z-yA9tUU5-j3W2v-UWstU,92
138
+ sonusai-1.0.5.dist-info/RECORD,,