psweep

psweep#

FileTemplate(filename[, target_suffix])

GIT_ADD_ALL

str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Machine(machine_dir[, jobscript_name])

PANDAS_DEFAULT_ORIENT

str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

PANDAS_TIME_UNIT

str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

PSET_HASH_ALG

str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

PsweepHashError

capture_logs_wrapper(pset, worker, capture_logs)

Capture and redirect stdout and stderr produced in worker().

check_calc_dir(calc_dir, df)

Check calc dir for consistency with database.

df_filter_conds(df, conds[, op])

Filter DataFrame using bool arrays/Series/DataFrames in conds.

df_print(df[, index, special_cols, ...])

Print DataFrame, by default without the index and prefix columns such as _pset_id.

df_read(fn[, fmt])

Read DataFrame from file fn.

df_to_json(df, **kwds)

Like df.to_json but with defaults for orient, date_unit, date_format, double_precision.

df_write(fn, df[, fmt])

Write DataFrame to disk.

file_read(fn)

file_write(fn, txt[, mode])

filter_params_dup_hash(params, hashes, **kwds)

Return params with psets whose hash is not in hashes.

filter_params_unique(params, **kwds)

Reduce params to unique psets.

flatten(seq)

fullpath(path)

rtype:

str

gather_calc_templates(calc_templ_dir)

gather_machines(machine_templ_dir)

get_many_uuids(num[, retry, existing])

rtype:

Sequence[str]

get_uuid([retry, existing])

rtype:

str

git_clean()

git_enter(use_git[, always_commit])

git_exit(use_git, df)

in_git_repo()

intspace(*args[, dtype])

Like np.linspace but round to integers.

is_seq(seq)

rtype:

bool

itr(func)

Wrap func to allow pasing args not as sequence.

itr2params(loops)

Transform the (possibly nested) result of a loop over plists (or whatever has been used to create psets) to a proper list of psets by flattening and merging dicts.

logspace(start, stop[, num, offset, log_func])

Like numpy.logspace but

makedirs(path)

Create path recursively, no questions asked.

merge_dicts(args)

Start with an empty dict and update with each arg dict left-to-right.

pgrid(plists)

Convenience function for the most common loop: nested loops with itertools.product: ps.itr2params(itertools.product(a,b,c,...)).

pickle_read(fn)

pickle_write(fn, obj)

plist(name, seq)

Create a list of single-item dicts holding the parameter name and a value.

prep_batch(params, *[, calc_templ_dir, ...])

Write files based on templates.

pset_hash(dct[, method, raise_error, ...])

Reproducible hash of a dict for usage in database (hash of a pset).

run(worker, params[, df, poolsize, ...])

Call worker for each pset in params.

stargrid(const, vary[, vary_labels, ...])

Helper to create a specific param sampling pattern.

system(cmd, **kwds)

Call shell command.

worker_wrapper(pset, worker, *[, tmpsave, ...])

Add those prefix fields (e.g. _time_utc) to pset which can be determined at call time.