def manage_file_analysis(args: argparse.Namespace, filename: str, data: object) -> None:
    """
    Take care of the analysis of a datafile
    """
    key = DataStore.hashfile(filename)
    print('Analyzing {} --> {}'.format(filename, key))
    if data.check_key(key):  # if exists in database, prepopulate
        fit = LineFit(filename, data=data.get_data(key))
    else:
        fit = LineFit(filename)
    if args.time:
        noise, curvature, rnge, domn = fit.analyze(time=args.time)
        newrow = [args.time, noise, curvature,
                  rnge, domn, fit.accepts[args.time]]
        data.update1(key, newrow, len(fit.noises))
    else:
        fit.analyze_full()
        newrows = np.array([range(len(fit.noises)), fit.noises,
                            fit.curves, fit.ranges, fit.domains, fit.accepts])
        data.update(key, newrows)
    data.save()
def manage_file_analysis ( args : argparse . Namespace , filename : str , data : object ) -> None : key = DataStore . hashfile ( filename ) print ( 'Analyzing {} --> {}' . format ( filename , key ) ) if data . check_key ( key ) : fit = LineFit ( filename , data = data . get_data ( key ) ) else : fit = LineFit ( filename ) if args . time : noise , curvature , rnge , domn = fit . analyze ( time = args . time ) newrow = [ args . time , noise , curvature , rnge , domn , fit . accepts [ args . time ] ] data . update1 ( key , newrow , len ( fit . noises ) ) else : fit . analyze_full ( ) newrows = np . array ( [ range ( len ( fit . noises ) ) , fit . noises , fit . curves , fit . ranges , fit . domains , fit . accepts ] ) data . update ( key , newrows ) data . save ( )
Take care of the analysis of a datafile