Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR reworks the native library by refactoring core FMU functions, improving logging behavior and error handling, and updating API usage for greater clarity and support for FMI3 in the future.
- Refactored fmi2.cpp to replace reinterpret_cast with static_cast and improved logger usage.
- Updated PySlaveInstance implementation and removed deprecated setup_experiment.
- Removed legacy cppfmu_cs files and updated log message formatting.
Reviewed Changes
Copilot reviewed 12 out of 13 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| pythonfmu/fmu_except.hpp | New exception class added for fatal errors. |
| pythonfmu/fmi2.cpp | Refactored casting, logging, and FMI function implementations. |
| pythonfmu/SlaveInstance.hpp | Updated interface for SlaveInstance with optional parameters. |
| pythonfmu/PySlaveInstance.{hpp,cpp} | Reworked Python slave instance integration with improved resource handling. |
| pythonfmu/Logger.hpp | Introduced a new PyLogger interface for consistent logging. |
| pythonfmu/cppfmu/cppfmu_cs.{hpp,cpp} | Legacy co-simulation interface removed. |
| pythonfmu/logmsg.py | Adjusted LogMsg class and its string formatting. |
| pythonfmu/fmi2slave.py | Minor API changes in initialization mode and logging support. |
| pythonfmu/_version.py | Version bumped to 0.7.0. |
Files not reviewed (1)
- pythonfmu/pythonfmu-export/src/CMakeLists.txt: Language not supported
Also fixes and enables old logging tests
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A first attempt to rework the native library.
setup_experiment is removed (API change).startTimeis moved to enter_initiliaization_mode`This change should make it easier to understand the native workings and also make it easier to add FMI3 support. The structure is similar to fmu4cpp.