def extract(what, calc_id, webapi=True):
    """
    Extract an output from the datastore and save it into an .hdf5 file.
    By default uses the WebAPI, otherwise the extraction is done locally.
    """
    with performance.Monitor('extract', measuremem=True) as mon:
        if webapi:
            obj = WebExtractor(calc_id).get(what)
        else:
            obj = Extractor(calc_id).get(what)
        fname = '%s_%d.hdf5' % (what.replace('/', '-').replace('?', '-'),
                                calc_id)
        obj.save(fname)
        print('Saved', fname)
    if mon.duration > 1:
        print(mon)
def extract ( what , calc_id , webapi = True ) : with performance . Monitor ( 'extract' , measuremem = True ) as mon : if webapi : obj = WebExtractor ( calc_id ) . get ( what ) else : obj = Extractor ( calc_id ) . get ( what ) fname = '%s_%d.hdf5' % ( what . replace ( '/' , '-' ) . replace ( '?' , '-' ) , calc_id ) obj . save ( fname ) print ( 'Saved' , fname ) if mon . duration > 1 : print ( mon )
Extract an output from the datastore and save it into an .hdf5 file.
    By default uses the WebAPI, otherwise the extraction is done locally.