diff --git a/scaper/core.py b/scaper/core.py index e033dab..b8c3256 100644 --- a/scaper/core.py +++ b/scaper/core.py @@ -23,6 +23,7 @@ from .audio import get_integrated_lufs from .version import version as scaper_version +# TODO: for seeding, turn these into more complex functions in util? SUPPORTED_DIST = {"const": lambda x: x, "choose": lambda x: random.choice(x), "uniform": random.uniform, @@ -244,7 +245,7 @@ def trim(audio_infile, jams_infile, audio_outfile, jams_outfile, start_time, # Copy result back to original file shutil.copyfile(tmpfiles[-1].name, audio_outfile) - +# TODO: this should take a np.RandomSeed object (default to None) def _get_value_from_dist(dist_tuple): ''' Sample a value from the provided distribution tuple. @@ -731,7 +732,7 @@ def _validate_event(label, source_file, source_time, event_time, # Time stretch _validate_time_stretch(time_stretch) - +# TODO: add a seed parameter in init that defaults to None class Scaper(object): ''' Create a Scaper object. diff --git a/scaper/util.py b/scaper/util.py index 0dd6370..2c8d4b9 100644 --- a/scaper/util.py +++ b/scaper/util.py @@ -142,7 +142,7 @@ def _populate_label_list(folder_path, label_list): # ensure consistent ordering of labels label_list.sort() - +# TODO: add a seed parameter here for seeding def _trunc_norm(mu, sigma, trunc_min, trunc_max): ''' Return a random value sampled from a truncated normal distribution with