def validate_supervision_set(supervisions: SupervisionSet, **kwargs) -> None: for s in supervisions: validate_supervision(s) # Catch errors in data preparation: # - more than one supervision for a given recording starts at 0 supervisions._index_by_recording_id_and_cache() for rid, sups in supervisions._segments_by_recording_id.items(): cntr = 0 for s in sups: cntr += int(s.start == 0) if cntr > 1: logging.warning( f"SupervisionSet contains {cntr} supervisions that start at 0 for recording {rid}." f"Did you forget to set supervision start times?")
def validate_supervision_set(supervisions: SupervisionSet, **kwargs) -> None: for s in supervisions: validate_supervision(s) # Catch errors in data preparation: # - more than one supervision for a given recording starts at 0 (in a given channel) supervisions._index_by_recording_id_and_cache() for rid, sups in supervisions._segments_by_recording_id.items(): cntr_per_channel = defaultdict(int) for s in sups: cntr_per_channel[s.channel] += int(s.start == 0) for channel, count in cntr_per_channel.items(): if count > 1: logging.warning( f"SupervisionSet contains {count} supervisions that start at 0 for recording {rid} " f"(channel {channel}). Did you forget to set supervision start times?" )