py4sci

Previous topic

Smolyak UQ Method

Next topic

TestProgram

This Page

Sweep Reference

class puq.Sweep(psweep, host, prog, caldata=None, calerr=None, description='', sweepid='')

Creates an object that contains all the information about a parameter sweep.

Parameters:
  • psweep – Parameter Sweep object. See PSweep.
  • host – Host object. See Host.
  • prog – TestProgram object: See TestProgram.
  • caldata(array: Experimental data for calibration. Optional.
  • calerr (float) – Measurement error in the experimental data.
  • description (string) – Optional description of this run.
  • sweepid – an optional string that uniquely identifies this sweep.
  • This string is passed to the TestProgram by the Host object
  • using the jobinfo parameter.
analyze(verbose=False)

If not done already, collects the output from all the jobs into an HDF5 file. Parses any tagged data in the output and puts it in the output/data group in the HDF5 file.

This function is called from the puq command line interface script automatically.

collect_data(hf=None)

Collects data from captured stdout files and puts it in arrays in ‘output/data’. Returns True on success.

run(fn=None, overwrite=False, dryrun=False)

Calls PSweep.run() to run all the jobs in the Sweep. Collect the data from the outputs and call the PSweep analyze method. If the PSweep method has an iterative callback defined, call it, otherwise return.

Parameters:
  • fn (string) – HDF5 filename for output. ‘.hdf5’ will be appended to the filename if necessary. If fn is None, a filename will be generated starting with “sweep_” followed by a timestamp.
  • overwrite (boolean) – If True and fn is not None, will silently overwrite any previous files of the same name.
  • dryrun (boolean) – Simulates what would happen if UQ is run, without actually running the TestProgram.
Returns:

True on success.