A Python written MOdelica LIbrary ANAlyser for Dymola.
Analysation of modelica libraries based on Dymolas checkModel()
.
In Dymola, checkModel()
could only be applied to one package/model at a time. Forthermore and unfortunately, results of checkModel()
for one package/model are discarded after applying checkModel()
to the next package/model.
Moliana enables the user to apply checkModel()
to a complete library (or only selected packages) and get results for each subpackage/submodel up to a chosen level.
Results of checkModel()
are reduced to the number of errors and warnings and the overall result (success of failure). These results can be converted to a table-based Html code, with the possibility to highlight failures, errors or warnings.
Furthermore it is possible to compare one set of results to a different one (as long as both sets correspond to the same library) and highlight changes with respect to the numbers of errors or warnings or the overall result.
Of course this could be used for different usecases, but its main purpose is the usecase of software development using versioning systems as git or svn and to ease the process of assuring quality when merging development branches to the master.
Moliana provides following classes:
DymolaMode
: Automated execution of DymolascheckModel()
.Report
: Representation and comparison of results.Converter
: Conversion of Report instances to HTML files and vice versa.
The following lines show a general usage of Moliana.
pDym = os.path.join('C:\Program Files (x86)\Dymola 2016\\bin64','Dymola.exe')
pLib = os.path.join('examples',TestModelicaLibrary')
pRep = os.path.join('examples',reports')
dlc = moliana.DymolaMode(pLib, pDym, report_name ='example', report_path = pRep)
dlc.execute_check('html')
This will apply DymolaMode
to the Modelica library TestModelicaLibrary
. An Html report with file name example.html
is generated in the folder reports
. Both, the folder reports
as well as the library are stored in the folder examples
.
More examples, especially one that shows how to compare reports, can be found in ./examples/examples.py
or in the Examples section of the wiki.
Take a look at the source code of Moliana or at the wiki. In both places, the complete user-interface of Moliana is documented.
- This module has been implemented and tested with Python 3.4.3 on a Windows 7 and Windows 10 platform.
- DymolaMode requires Dymola 2016 or newer.
Moliana comes along with a GNU General Public License (see file LICENSE.txt
). Additional information can be found in the header of moliana.py
.
Of course, there are many more possibilities on how to make Molina more 'powerful', but the current version matches the original purpose quite well. So to keep the usage of Moliana as simple as possible, developments will depend on actual usecases, i.e. what functionality could ease the handling of Moliana, which property is missing.
So if you have any suggestions on interesting extensions to Moliana, just open an issue. The same goes for the case of any problems with Moliana - be it its usage or actual bugs. Any feedback is welcome!