easyvvuq.encoders package¶
Submodules¶
easyvvuq.encoders.copy_encoder module¶
An encoder meant to simply copy a file to the input directory unchanged. It is meant to be used in combination with MultiBuilder encoder and possibly the DirectoryBuilder. It duplicates some functionality of the ApplyFixtures encoder but can be useful for very simple cases.
Examples
>>> multiencoder = uq.encoders.MultiEncoder(
DirectoryBuilder(tree={"parent" : {"child1" : None, "child2" : None}}),
CopyEncoder('/home/user/input1.conf', 'parent/child1/input1.conf')
CopyEncoder('/home/user/input2.conf', 'parent/child1/input2.conf')
CopyEncoder('/home/user/input3.conf', 'parent/child2/input3.conf')
GenericEncoder(delimiter='$', template_fname='/home/user/template.in',
target_filename='parent/input.int'))
- class easyvvuq.encoders.copy_encoder.CopyEncoder(source_filename, target_filename)[source]¶
Bases:
object
An Encoder to copy an input file to a simulation.
- Parameters:
source_filename (str) – a full path to some file that a simulation needs
target_filename (str) – a target filename inside the simulation directory
easyvvuq.encoders.directory_builder module¶
- class easyvvuq.encoders.directory_builder.DirectoryBuilder(tree)[source]¶
Bases:
object
DirectoryBuilder builds the specified directory structure for a Run.
The dir structure is specified by the ‘tree’ parameter. This should be a dict of dicts, for example:
tree = {‘a’ : {‘b’ : {‘c’ : None, ‘d’ : None}}, ‘e’ : {‘f’ : None}}
- Parameters:
tree (dict of dicts) – The desired directory structure
easyvvuq.encoders.generic_template module¶
easyvvuq.encoders.jinja_encoder module¶
- class easyvvuq.encoders.jinja_encoder.JinjaEncoder(template_fname, target_filename='app_input.txt')[source]¶
Bases:
object
JinjaEncoder for substituting values into application template input. Uses the jinja2 template system, which supports more complex expressions than the GenericEncoder. See https://jinja.palletsprojects.com/en/2.10.x/templates/ for template syntax.