Example #1
0
def main(plot=False, savefig='None', geoms='fcs', nNs=7, Ns=None,
         nspecies='1,2,3', nstencils='3,5,7', verbose=False, **kwargs):
    nstencils = [int(_) for _ in nstencils.split(',')]
    if Ns is None:
        Ns = [8*(2**i) for i in range(nNs)]
    else:
        Ns = list(map(int, Ns.split(',')))
        nNs = len(Ns)
    nspecies = list(map(int, nspecies.split(',')))
    varied = OrderedDict([('nspecies', nspecies), ('N', Ns), ('geom', geoms),
                          ('nstencil', nstencils)])

    kw1 = default_constant.copy()
    kw1.update(kwargs)

    results = {
        'varied_keys': list(varied.keys()),
        'varied_values': list(varied.values()),
    }

    all_params = list(product(*varied.values()))
    for params in progress(all_params) if verbose else all_params:
        kw2 = kw1.copy()
        kw2.update(dict(zip(varied.keys(), params)))
        results[params] = integrate(**kw2)
    basename = os.path.splitext(os.path.basename(__file__))[0]
    pickle.dump(results, gzip.open(basename + '.pkl', 'wb'))
Example #2
0
def main(varied=None, verbose=False):
    if varied is None:
        varied = default_varied
    results = {
        'varied_keys': list(default_varied.keys()),
        'varied_values': list(default_varied.values())
    }
    all_params = list(product(*varied.values()))
    for params in progress(all_params) if verbose else all_params:
        kwargs = constant.copy()
        kwargs.update(dict(zip(varied.keys(), params)))
        results[params] = integrate(**kwargs)
    basename = os.path.splitext(os.path.basename(__file__))[0]
    pickle.dump(results, gzip.open(basename+'.pkl', 'wb'))