Skip to content

175 add simple dymola example#177

Merged
HvanderStok merged 31 commits into
masterfrom
175-add-simple-dymola-example
May 27, 2026
Merged

175 add simple dymola example#177
HvanderStok merged 31 commits into
masterfrom
175-add-simple-dymola-example

Conversation

@HvanderStok

Copy link
Copy Markdown
Contributor

Add basic Dymola simulation workflow example

Closes #175

Adds a new example demonstrating a recommended workflow for Dymola simulation studies (`e3_0_simple_dymola_example). The example covers four common patterns:

  • Single model simulation (setup verification)
  • Parameter study across multiple model variants (cross-product)
  • Model comparison with shared parameters
  • Model comparison with individual parameters

The example also demonstrates:

  • Model name modifiers as the recommended approach for structural parameters
  • Custom post-processing of .mat files into datetime-indexed parquet files
  • Wildcard-based variable name filtering for selective result extraction

The simple_dymola_sim_study function is designed as a reusable template that users can adapt to their own studies.

Additionally, I improved a little bit the saving of parquet files and added a deprecation warning for the structural_parameters keyword of the DymolaAPI (see #176)

@HvanderStok HvanderStok linked an issue Apr 28, 2026 that may be closed by this pull request
Comment thread examples/e3_0_simple_dymola_example.py Outdated
@HvanderStok HvanderStok requested a review from HoeppJ April 28, 2026 09:16
@HvanderStok

Copy link
Copy Markdown
Contributor Author

@HoeppJ as we discussed personally, I moved the function simple_dymola_sim_study directly into ebcpy and adapted it a bit for that and also updated the new example.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new “simple Dymola workflow” example and supporting utilities to make common Dymola study patterns easier to follow, while also extending variable name filtering and improving parquet export robustness.

Changes:

  • Add simple_dymola_sim_study helper + a new basic Dymola workflow example covering common study patterns.
  • Extend get_names() with an exclude option and add tests for the new behavior.
  • Improve parquet saving for SparseDtype columns and add deprecation warnings for Dymola structural-parameter APIs.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
ebcpy/simulationapi/dymola_utils.py New reusable helper for common Dymola simulation study workflows.
examples/e3_0_simple_dymola_example.py New minimal, recommended Dymola workflow example using modifiers + postprocessing.
ebcpy/utils/__init__.py Adds exclude filtering to get_names().
tests/test_utils.py Adds test coverage for get_names(..., exclude=...).
ebcpy/simulationapi/dymola_api.py Adds deprecation warnings for structural_parameters and modify_structural_parameters.
tests/test_simulationapi.py Adds validation tests and minimal integration tests for simple_dymola_sim_study.
ebcpy/data_types.py Densifies SparseDtype columns before parquet write.
examples/README.md Updates example instructions and documents the new example.
examples/e5_modifier_example.py Updates stated learning goals to emphasize structural modifiers/redeclare.
ebcpy/__init__.py Exposes simple_dymola_sim_study at package top-level; bumps version.
CHANGELOG.md Adds v0.8.0 changelog entries for the new utilities and changes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread ebcpy/simulationapi/dymola_utils.py Outdated
Comment thread ebcpy/simulationapi/dymola_api.py Outdated
Comment thread ebcpy/simulationapi/dymola_utils.py
Comment thread ebcpy/utils/__init__.py
Comment thread ebcpy/data_types.py
Comment thread tests/test_simulationapi.py
Comment thread examples/README.md Outdated
Comment thread ebcpy/simulationapi/dymola_utils.py Outdated
HvanderStok and others added 2 commits April 30, 2026 09:33
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Comment thread ebcpy/simulationapi/dymola_utils.py
Comment thread examples/e3_0_simple_dymola_example.py
Comment thread examples/e3_0_simple_dymola_example.py Outdated

if __name__ == "__main__":
# TODO: Adjust this path to your local BESMod startup script
MOS_SCRIPT = r"D:\01_git\BESMod\startup.mos"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would suggest to rename this to mos_script_startup to make clear that this refers to the startup script.
Or mos_scirpt_pre as in simple_dymola_sim_study()

Comment thread examples/e3_0_simple_dymola_example.py Outdated
return df_path


if __name__ == "__main__":

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would suggest to keep the example structure consistent with other examples.
So maybe rename to function main() and call main over "if name == 'main':"

@HvanderStok HvanderStok requested a review from HoeppJ May 26, 2026 14:14

@HoeppJ HoeppJ left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good! Thanks for the work!

@HvanderStok HvanderStok merged commit 231bde5 into master May 27, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add simple Dymola example

4 participants