Repository navigation
Python: export components without a source without a source attribute (#1697) - #1698
Merged
Merged
Conversation
…OpenModelica#1697) A component without a source (an architecture placeholder) was read from source="" and written back as source=".", since Path("").as_posix() is "."; other SSP importers drop such components. An SSD without the source attribute could not be imported at all (Path(None)). SSP 2.0 makes source optional: a component without a source has no source attribute. Read a missing, empty or "." source as no source, leave the attribute out on export (FMUs and tables), and fail instantiation with a clear error. New test api/componentNoSource1.py. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The other placeholders keep no source attribute and the connections stay. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1698 +/- ##
=======================================
Coverage 30.22% 30.22%
=======================================
Files 74 74
Lines 14661 14661
Branches 9432 9432
=======================================
Hits 4431 4431
Misses 8892 8892
Partials 1338 1338
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
arun3688
approved these changes
Nov 11, 2026
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.
Related Issues
Fixes #1697
Purpose
A component without a source (an architecture placeholder with connectors but no FMU yet) did not
survive an SSP round trip. Its
source=""came back assource="."(Path("").as_posix()is"."),and other SSP importers drop such components and their connections. An SSD where the component has no
sourceattribute, which is the correct form in SSP 2.0 (sourceisuse="optional"), could not beimported at all because of
Path(None).Approach
"."source all mean no source (fmuPath/filePathisNone)."."is still read, for SSPs written by earlier versions.sourceattribute.Component '<name>' has no source FMU and cannot be simulatedinstead of a confusing path error.New test
api/componentNoSource1.pywith the resourcecomponentNoSource. It imports one component ofeach kind (
source="", no attribute,source="."), adds a real FMU, exports, checks thesourceattributes, re-imports and exports again, and checks the instantiation error. The SSDs it exports
validate against
schema/ssp/SystemStructureDescription.xsd. The test fails on master with theTypeError. Locally all api and simulation tests pass on Linux (9 are skipped on this platform).🤖 Generated with Claude Code