SOFIRpy: Enhancing Research Data Management and Code Documentation in Python

We’re excited to introduce SOFIRpy (Co-Simulation Of Functional Mock-up Units with Integrated Research Data Management), a Python package that lets you co-simulate functional mock-up units (FMUs) with custom models. It includes functions designed to make your research data management more efficient and serves as a good practice example for code development and documentation.

SOFIRpy: Research Data Management by Design
SOFIRpy offers smooth Data Handling with FAIRness in mind with easy-to-use functionalities for storing data and metadata in a hdf5 file, which allows to implement custom automated simulation workflows.

Tools like OpenModelica and Dymola are excellent for modelling complex physical systems. These models can be exported as FMUs. SOFIRpy allows to co-simulate the FMUs with custom written controllers, such as machine learning toolboxes. This way, SOFIRpy enables the implementation of complex control strategies..

Good Practice Example for Code Development and Documentation
Clear code documentation is crucial for maintaining sustainable and collaborative research projects. SOFIRpy demonstrates best practices in this area:

⚬ Detailed Docstrings: SOFIRpy encourages comprehensive docstrings that explain the purpose, parameters, and usage of functions and classes.
⚬ Practical Examples: SOFIRpy includes tutorials and real-world use cases to guide users in understanding and documenting their code effectively.
⚬ Version Control: Maintain transparency with version history and changelogs, just like SOFIRpy does, to keep track of your package’s evolution.
⚬ Easily Reusable, Streamlined CI/CD Pipeline: Many parts of the SOFIRpy project, like the CI/CD pipeline, can be easily adjusted and reused for other projects.

Fig. 1: An example system of functional mockup units for SOFIRpy

Getting Started with SOFIRpy:

To begin using SOFIRpy, follow these steps:

1. Installation: You can use `pip` to install SOFIRpy: `pip install sofirpy`.
2. Explore the Docs: Visit https://sofirpy.readthedocs.io/en/stable/index.html to dive into the package documentation. Familiarize yourself with its features, usage, and documentation tips.
3. Get involved: SOFIRpy’s Gitlab repo can be found under https://git.rwth-aachen.de/sofirpy. Share insights, ask questions, and feel free to contribute.

We are happy about any feedback!