Package: parsim
IntroductionParsim is a tool for working with parameterized simulation models.
The primary objective is to facilitate quality assurance of simulation projects.
The tool supports a scripted and automated workflow, where verified and validated simulation models
are parameterized, so that they can be altered/modified in well-defined ways and reused with minimal user invention.
All events are logged on several levels, to support traceability, project documentation and quality control.Parsim provides basic functionality for generating studies based on common design-of experiments
(DOE) methods, for example using factorial designs, response surface methods or random sampling,
like Monte Carlo or Latin Hypercube.Parsim can also be used as an interface to theDakotalibrary;
Dakota is run as a subprocess, generating cases from a Parsim model template.How it worksOnce a prototype simulation case has been developed, a corresponding simulationmodel templateis created by collecting all simulation input files, data
files and scripts into atemplate directory. The text files in a model
template can then be parameterized by replacing numerical values, or text
strings with macro names. Parsim uses the pyexpander macro processing library, which
supports embedding of arbitrarly complex Python code in the template files.
This can be used for advanced parameterization needs, for example to compute data
tables from functions, generate graphs for reports, generate content in loops or
conditionals, etc.When a simulation case is created, the model template directory is recursively
replicated to create acase directory. Parsim operations can also be carried
out on astudy, containing multiple cases. A study is a directory containing
multiple case directories.You operate on your cases (either individually or on all cases of a study at once)
by executing scripts written to perform specific tasks, e.g.
meshing operations, starting a simulation, or post-processing of results.Your simulation project lives in a Parsimproject directory, which holds all
cases and studies of the project. The project directory holds Parsim
configuration settings and logs project events, like creation of cases and
studies, serious errors, change of configuration settings, etc.Summary of features:Flexible and full-featured support for parameterization of text-based simulation models.Cases and parameter studies kept together in projects.Scripted workflow can be applied to individual cases as well as to large parameter studies.Logging and error handling, for traceability and project documentation.Python API can be conveniently used for post-processing and analysis, with input parameters
and output available as pandas DataFrames.Support for many common design-of-experiments (DOE) methods.Can be used as an interface to the Dakota library, for complex uncertainty quantification and optimization tasks.Based on Python (as of version 2.0 Python3 only).One simple workflow for any kind of simulation application.Platform independent: Works in both Linux, Windows and MacOS environments.Simple installation from public Python repositories (install with pip, in any Python installation).Available under open-source license (GNU Public License v. 3)InstallationParsim is available at bothPyPI, the Python Package Indexand as a conda package
through theconda-forge repository, depending on which Python distribution and package
manager you use (pipandconda, respectively).The Parsim installation requires and automatically installs the
Python librarypyexpander,
which is used for macro and parameter expansion (parameterization of input files).
The DOE (Design of Experiments) functionality is provided by the pyDOE2, numpy and
scipy libraries. The pandas library has also been included, so that the Python API can
provide results and caselist data as pandas DataFrames.
If you want to use theDakota toolkit, it is installed separately;
thedakotaexecutable should be in yourPATH.NoteIf you experience issues with the installation, it is recommended to first make a clean and fully
functional installation of the NumPy, SciPy and pandas libraries. The best way to do this depends on
which Python distribution you use. Theanaconda Python distributionis highly recommended. It works well on both Windows and Linux.Installation from PyPIUse the package installerpipto install:pip install parsimInstallation with condaNote that you need to select theconda-forgechannel to find parsim with conda.To install in your base environment:conda install -c conda-forge parsimAlternatively, create a separate conda environment (here calledpsm-env) for using parsim:conda create -n psm-env -c conda-forge parsim
conda activate psm-envDocumentationThe Parsim documentation is hosted atReadTheDocs.AuthorParsim was developed byOla Widlund,RISE Research Institutes of Sweden, to
provide basic and generic functionality for uncertainty quantification
and quality assurance of parameterized simulation models.LicensingParsim is licensed under the GNU Public License, GPL, version 3 or later.
Copyright belongs toRISE Research Institutes of Sweden AB.Source code and reporting of issuesThe source code is hosted atGitLab.com.
Here you can also report issues and suggest improvements.