yaml_parser module
This module provides functionality for creating a Fedem model based on a YAML-formatted input file. The following keywords are recognized when parsing the input file:
Each keyword (except the first three) are followed by an arbitrary number of lines, where each line defines one object to be created (or edited). The syntax of the input can be either list-based or dictionary based.
This module can also be launched directly using the syntax
python -m fedempy.yaml_parser -f mymodel.yaml
It will then invoke the method yaml_parser.main()
on the specified input file (mymodel.yaml).
- class yaml_parser.ModelYAML(input_file)[source]
Bases:
object
This class contains methods for parsing a YAML-formated input file and creating a Fedem model from it. It is an extension of the class
modeler.FedemModeler
.- Parameters:
- input_filestr
Absolute path to the YAML-formated input file
Methods
build:
Loads and parses all model attributes into the model instance
save:
Saves the model to the input file specified FEDEM model file
solve:
Executes the dynamics solver on the created model.
- build(dump_file=None)[source]
Loads and parses all model attributes into the model instance.
- Parameters:
- dump_filestr, default=None
Absolute path to dump the model data dictionary to
- yaml_parser.main(input_file, dump_file=None, solve=False)[source]
Main driver.
- Parameters:
- input_filestr
Absolute path to the YAML-formated input file
- dump_filestr, default=None
Absolute path to json-file for dumping the model data dictionary
- solvebool, default=False
If True, the dynamics solver is launched on the created model