Run Diag

mail@pastecode.io avatar
unknown
python
14 days ago
597 B
5
Indexable
Never
import flow_rate_to_disorder_status as status 
import final_episodes as epi

def run_diagnostic(flow_rate, segment_len, interval, threshold, min_segment):
    if (len(flow_rate) < 20):
        return 'Not enough data'
    if (interval[0] > interval[1]):
        return 'Corrupted input'
    if (threshold < 0):
        return 'Corrupted input'
    if not isinstance(segment_len, int):
        return 'Corrupted input'
    disorder_status = status.flow_rate_to_disorder_status(flow_rate,segment_len,interval,threshold)        
    return epi.find_episodes(disorder_status, min_segment)
Leave a Comment