diff options
| author | bd <bdunahu@operationnull.com> | 2025-06-16 16:26:55 -0400 |
|---|---|---|
| committer | bd <bdunahu@operationnull.com> | 2025-06-16 16:26:55 -0400 |
| commit | f04af4d6e012de6b0b8fb24446db9cba152585b6 (patch) | |
| tree | 6efe98f9d4cbbc671efe8706c8b2ba3597cf3acb | |
| parent | 8391634ea99581e3f50debdb7c599afe4155a998 (diff) | |
Remove `filter_duplicated_frame`
| -rwxr-xr-x | aergia | 21 |
1 files changed, 2 insertions, 19 deletions
@@ -220,28 +220,11 @@ class Aergia(object): def sort_samples(sample_dict): '''Returns SAMPLE_DICT in descending order by number of samples.''' return {k: v for k, v in sorted(sample_dict.items(), - key=lambda item: Aergia.sum_sample(item[1]), + key=lambda item: Aergia.sum_sample( + item[1]), reverse=True)} @staticmethod - def filter_duplicated_frames(frames) -> bool: - s = set() - dup = [] - for f in frames: - if f in s: - dup.append(f) - else: - s.add(f) - # TODO we probably have one because given get_async_frames returns the - # currently executing task. Would be an easy fix in that method. - # if there's more than one, I cannot explain it. - assert len( - dup) < 2, f"ERROR: More than 1 duplicate frame (shouldn't happen): {dup}" - if len(dup) != 0: - print(f"WARN: Duplicate frame found: {dup}", file=sys.stderr) - return list(s) - - @staticmethod def sum_sample(sample): return sample[0] + sample[1] |
