sysmlpy 0.27.4__tar.gz → 0.28.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/PKG-INFO +70 -32
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/README.md +69 -31
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/pyproject.toml +2 -2
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/__init__.py +5 -3
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/antlr_visitor.py +133 -1
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/grammar/classes.py +137 -1
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/plantuml.py +1170 -81
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/LICENSE +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/__main__.py +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/antlr/README.md +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/antlr/SysMLv2Lexer.interp +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/antlr/SysMLv2Lexer.py +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/antlr/SysMLv2Lexer.tokens +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/antlr/SysMLv2Parser.interp +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/antlr/SysMLv2Parser.py +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/antlr/SysMLv2Parser.tokens +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/antlr/SysMLv2ParserListener.py +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/antlr/SysMLv2ParserVisitor.py +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/antlr/src/sysmlpy/grammar/antlr4/SysMLv2Lexer.interp +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/antlr/src/sysmlpy/grammar/antlr4/SysMLv2Lexer.py +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/antlr/src/sysmlpy/grammar/antlr4/SysMLv2Lexer.tokens +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/antlr_parser.py +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/definition.py +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/examples/attribute_values.py +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/examples/part_attributes.py +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/examples/tuples_sequences.py +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/formatting.py +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/grammar/antlr4/README.md +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/grammar/antlr4/SysMLv2Lexer.g4 +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/grammar/antlr4/SysMLv2Lexer.interp +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/grammar/antlr4/SysMLv2Lexer.py +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/grammar/antlr4/SysMLv2Lexer.tokens +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/grammar/antlr4/SysMLv2Parser.g4 +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/grammar/antlr4/SysMLv2Parser.interp +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/grammar/antlr4/SysMLv2Parser.py +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/grammar/antlr4/SysMLv2Parser.tokens +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/grammar/antlr4/SysMLv2ParserListener.py +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/grammar/antlr4/SysMLv2ParserVisitor.py +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/grammar/antlr4/desc.xml +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/grammar/antlr4/examples/camera.sysml +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/grammar/antlr4/examples/toaster-system.sysml +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/grammar/antlr4/examples/vehicle-model.sysml +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/grammar/antlr4/pom.xml +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/library/LICENSE +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/library/README.md +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/library/__init__.py +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/library/domain/Analysis/AnalysisTooling.sysml +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/library/domain/Analysis/SampledFunctions.sysml +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/library/domain/Analysis/StateSpaceRepresentation.sysml +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/library/domain/Analysis/TradeStudies.sysml +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/library/domain/Cause and Effect/CausationConnections.sysml +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/library/domain/Cause and Effect/CauseAndEffect.sysml +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/library/domain/Geometry/ShapeItems.sysml +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/library/domain/Geometry/SpatialItems.sysml +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/library/domain/Metadata/ImageMetadata.sysml +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/library/domain/Metadata/ModelingMetadata.sysml +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/library/domain/Metadata/ParametersOfInterestMetadata.sysml +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/library/domain/Metadata/RiskMetadata.sysml +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/library/domain/Quantities and Units/ISQ.sysml +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/library/domain/Quantities and Units/ISQAcoustics.sysml +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/library/domain/Quantities and Units/ISQAtomicNuclear.sysml +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/library/domain/Quantities and Units/ISQBase.sysml +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/library/domain/Quantities and Units/ISQCharacteristicNumbers.sysml +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/library/domain/Quantities and Units/ISQChemistryMolecular.sysml +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/library/domain/Quantities and Units/ISQCondensedMatter.sysml +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/library/domain/Quantities and Units/ISQElectromagnetism.sysml +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/library/domain/Quantities and Units/ISQInformation.sysml +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/library/domain/Quantities and Units/ISQLight.sysml +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/library/domain/Quantities and Units/ISQMechanics.sysml +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/library/domain/Quantities and Units/ISQSpaceTime.sysml +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/library/domain/Quantities and Units/ISQThermodynamics.sysml +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/library/domain/Quantities and Units/MeasurementRefCalculations.sysml +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/library/domain/Quantities and Units/MeasurementReferences.sysml +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/library/domain/Quantities and Units/Quantities.sysml +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/library/domain/Quantities and Units/QuantityCalculations.sysml +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/library/domain/Quantities and Units/SI.sysml +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/library/domain/Quantities and Units/SIPrefixes.sysml +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/library/domain/Quantities and Units/TensorCalculations.sysml +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/library/domain/Quantities and Units/Time.sysml +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/library/domain/Quantities and Units/USCustomaryUnits.sysml +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/library/domain/Quantities and Units/VectorCalculations.sysml +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/library/domain/Requirement Derivation/DerivationConnections.sysml +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/library/domain/Requirement Derivation/RequirementDerivation.sysml +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/library/kernel/Base.kerml +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/library/kernel/BaseFunctions.kerml +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/library/kernel/BooleanFunctions.kerml +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/library/kernel/Clocks.kerml +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/library/kernel/CollectionFunctions.kerml +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/library/kernel/Collections.kerml +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/library/kernel/ComplexFunctions.kerml +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/library/kernel/ControlFunctions.kerml +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/library/kernel/ControlPerformances.kerml +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/library/kernel/DataFunctions.kerml +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/library/kernel/FeatureReferencingPerformances.kerml +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/library/kernel/IntegerFunctions.kerml +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/library/kernel/KerML.kerml +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/library/kernel/Links.kerml +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/library/kernel/Metaobjects.kerml +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/library/kernel/NaturalFunctions.kerml +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/library/kernel/NumericalFunctions.kerml +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/library/kernel/Objects.kerml +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/library/kernel/Observation.kerml +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/library/kernel/OccurrenceFunctions.kerml +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/library/kernel/Occurrences.kerml +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/library/kernel/Performances.kerml +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/library/kernel/RationalFunctions.kerml +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/library/kernel/RealFunctions.kerml +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/library/kernel/ScalarFunctions.kerml +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/library/kernel/ScalarValues.kerml +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/library/kernel/SequenceFunctions.kerml +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/library/kernel/SpatialFrames.kerml +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/library/kernel/StatePerformances.kerml +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/library/kernel/StringFunctions.kerml +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/library/kernel/Transfers.kerml +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/library/kernel/TransitionPerformances.kerml +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/library/kernel/TrigFunctions.kerml +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/library/kernel/Triggers.kerml +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/library/kernel/VectorFunctions.kerml +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/library/kernel/VectorValues.kerml +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/library/systems/Actions.sysml +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/library/systems/Allocations.sysml +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/library/systems/AnalysisCases.sysml +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/library/systems/Attributes.sysml +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/library/systems/Calculations.sysml +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/library/systems/Cases.sysml +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/library/systems/Connections.sysml +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/library/systems/Constraints.sysml +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/library/systems/Flows.sysml +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/library/systems/Interfaces.sysml +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/library/systems/Items.sysml +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/library/systems/Metadata.sysml +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/library/systems/Parts.sysml +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/library/systems/Ports.sysml +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/library/systems/Requirements.sysml +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/library/systems/StandardViewDefinitions.sysml +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/library/systems/States.sysml +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/library/systems/SysML.sysml +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/library/systems/UseCases.sysml +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/library/systems/VerificationCases.sysml +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/library/systems/Views.sysml +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/navigate.py +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/project.py +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/semantic.py +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/store.py +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/us_customary_units.txt +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/usage.py +0 -0
- {sysmlpy-0.27.4 → sysmlpy-0.28.1}/src/sysmlpy/validator.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: sysmlpy
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.28.1
|
|
4
4
|
Summary: SysML v2.0 Parser
|
|
5
5
|
License: MIT License
|
|
6
6
|
|
|
@@ -59,6 +59,8 @@ The project had diverged so much from sysml2py that a new name, sysmlpy, was sel
|
|
|
59
59
|
|
|
60
60
|

|
|
61
61
|
|
|
62
|
+
**v0.28.0:** Complete Gap 4 coverage — Block Definition Diagram (BDD), Internal Block Diagram (IBD), Parametric Diagram, and Package Diagram views. All 6 specialized SysML v2 view types now implemented (144 PlantUML tests). IBD shows flow/connection arrows with endpoint extraction. Parametric view extracts constraint parameters with types. Package diagram renders nested folder-style hierarchy.
|
|
63
|
+
|
|
62
64
|
**v0.27.0:** General View (GV), Package View, and three GridView specializations (Tabular View, Data Value Tabular View, Relationship Matrix View) with PlantUML, Markdown, and HTML output. 108 PlantUML tests. All 68+ `NotImplementedError` stubs in `grammar/classes.py` replaced with graceful handling.
|
|
63
65
|
|
|
64
66
|
**v0.26.0:** Action Flow View, Interconnection View, and State Transition View with auto-include of connected elements. Grammar-level flow scanning. 101 PlantUML tests.
|
|
@@ -493,10 +495,42 @@ from sysmlpy.plantuml import as_package_view
|
|
|
493
495
|
print(as_package_view(model, style="bw"))
|
|
494
496
|
```
|
|
495
497
|
|
|
498
|
+
#### Package Diagram View — `as_package_diagram_view()`
|
|
499
|
+
Folder-style package hierarchy with elements nested inside their containing packages. Shows containment structure clearly with color-coded element types.
|
|
500
|
+
|
|
501
|
+
```python
|
|
502
|
+
from sysmlpy.plantuml import as_package_diagram_view
|
|
503
|
+
print(as_package_diagram_view(model, style="bw"))
|
|
504
|
+
```
|
|
505
|
+
|
|
506
|
+
#### Block Definition Diagram (BDD) — `as_block_definition_view()`
|
|
507
|
+
Corresponds to SysML v2 Block Definition Diagrams. Shows block definitions with compartments for attributes, ports, and part references. Displays generalization relationships.
|
|
508
|
+
|
|
509
|
+
```python
|
|
510
|
+
from sysmlpy.plantuml import as_block_definition_view
|
|
511
|
+
print(as_block_definition_view(model, style="bw"))
|
|
512
|
+
```
|
|
513
|
+
|
|
514
|
+
#### Internal Block Diagram (IBD) — `as_internal_block_diagram()`
|
|
515
|
+
Corresponds to SysML v2 Internal Block Diagrams. Shows a single block's internal structure with boundary ports, nested parts, and flow/connection arrows between endpoints.
|
|
516
|
+
|
|
517
|
+
```python
|
|
518
|
+
from sysmlpy.plantuml import as_internal_block_diagram
|
|
519
|
+
print(as_internal_block_diagram(model, style="bw"))
|
|
520
|
+
```
|
|
521
|
+
|
|
522
|
+
#### Parametric Diagram — `as_parametric_view()`
|
|
523
|
+
Shows constraint definitions with parameter compartments (including types like `Real`). Supports constraint usages and parameter bindings.
|
|
524
|
+
|
|
525
|
+
```python
|
|
526
|
+
from sysmlpy.plantuml import as_parametric_view
|
|
527
|
+
print(as_parametric_view(model, style="bw"))
|
|
528
|
+
```
|
|
529
|
+
|
|
496
530
|
#### Action Flow View (AFV) — `as_action_flow_view()`
|
|
497
531
|
Corresponds to SysML v2 ``ActionFlowView`` (short name ``afv``). Shows actions with their control and object flows. Auto-includes connected flow elements.
|
|
498
532
|
|
|
499
|
-

|
|
500
534
|
|
|
501
535
|
```python
|
|
502
536
|
from sysmlpy.plantuml import as_action_flow_view
|
|
@@ -516,7 +550,7 @@ print(as_interconnection_view(model, style="bw"))
|
|
|
516
550
|
#### State Transition View (STV) — `as_state_transition_view()`
|
|
517
551
|
Corresponds to SysML v2 ``StateTransitionView`` (short name ``stv``). State machine diagram with hierarchical states and transitions. Auto-includes connected transition elements.
|
|
518
552
|
|
|
519
|
-

|
|
520
554
|
|
|
521
555
|
```python
|
|
522
556
|
from sysmlpy.plantuml import as_state_transition_view
|
|
@@ -526,19 +560,17 @@ print(as_state_transition_view(model, style="bw"))
|
|
|
526
560
|
#### Tree Diagram — `as_tree_diagram()`
|
|
527
561
|
Hierarchical containment tree using nested PlantUML containers. Shows ownership hierarchy with sharp corners for definitions and rounded corners for usages.
|
|
528
562
|
|
|
529
|
-

|
|
530
564
|
|
|
531
565
|
```python
|
|
532
566
|
from sysmlpy.plantuml import as_tree_diagram
|
|
533
567
|
print(as_tree_diagram(model, style="bw"))
|
|
534
568
|
```
|
|
535
569
|
|
|
536
|
-
### Tabular View Rendering Functions
|
|
537
|
-
|
|
538
570
|
#### Element Table — `as_element_table()`
|
|
539
571
|
A simple tabular listing with columns Name, Type, Kind, and Parent.
|
|
540
572
|
|
|
541
|
-

|
|
542
574
|
|
|
543
575
|
```python
|
|
544
576
|
from sysmlpy.plantuml import as_element_table
|
|
@@ -548,7 +580,7 @@ print(as_element_table(model, style="bw"))
|
|
|
548
580
|
#### Textual Notation — `as_textual_notation()`
|
|
549
581
|
Indented text representation inside a PlantUML note, similar to the SysML v2 textual concrete syntax.
|
|
550
582
|
|
|
551
|
-

|
|
552
584
|
|
|
553
585
|
```python
|
|
554
586
|
from sysmlpy.plantuml import as_textual_notation
|
|
@@ -559,20 +591,22 @@ print(as_textual_notation(model, style="bw"))
|
|
|
559
591
|
|
|
560
592
|
Per the SysML v2 standard, ``GridView`` (short name ``grv``) presents exposed model elements and their relationships in a rectangular grid. It has three specializations, all supporting **three output formats**:
|
|
561
593
|
|
|
562
|
-
| Format | Use case |
|
|
563
|
-
|
|
564
|
-
| `"
|
|
565
|
-
| `"
|
|
566
|
-
| `"
|
|
594
|
+
| Format | Use case | Compatibility |
|
|
595
|
+
|--------|----------|---------------|
|
|
596
|
+
| `"markdown"` (default) | Standard pipe table — for GitHub, MkDocs, or Jupyter | ✅ Universal |
|
|
597
|
+
| `"html"` | Rich `<table>` with CSS classes — for web dashboards | ✅ Universal |
|
|
598
|
+
| `"plantuml"` | PlantUML table / salt matrix — embed in diagrams | ⚠️ PlantUML <1.2024.7 only |
|
|
599
|
+
|
|
600
|
+
**Note:** PlantUML 1.2024.7+ removed support for legacy table syntax. Use `"markdown"` or `"html"` output format for compatibility with all PlantUML versions.
|
|
567
601
|
|
|
568
602
|
#### Tabular View — `as_tabular_view()`
|
|
569
603
|
Extensible table with configurable columns. Default columns: Name, Type, Kind, Parent, Typed By, Specializes.
|
|
570
604
|
|
|
571
|
-
|
|
605
|
+
See [`18-tabular-view.md`](docs/plantuml-examples/18-tabular-view.md) for example output.
|
|
572
606
|
|
|
573
607
|
```python
|
|
574
608
|
from sysmlpy.plantuml import as_tabular_view
|
|
575
|
-
print(as_tabular_view(model
|
|
609
|
+
print(as_tabular_view(model)) # Default: markdown output
|
|
576
610
|
```
|
|
577
611
|
|
|
578
612
|
Custom columns and other output formats:
|
|
@@ -583,18 +617,18 @@ print(as_tabular_view(model,
|
|
|
583
617
|
columns=["Name", "Type", "Parent", "Typed By"],
|
|
584
618
|
output_format="html"))
|
|
585
619
|
|
|
586
|
-
# Markdown for documentation
|
|
620
|
+
# Markdown for documentation (default)
|
|
587
621
|
print(as_tabular_view(model, output_format="markdown"))
|
|
588
622
|
```
|
|
589
623
|
|
|
590
624
|
#### Data Value Tabular View — `as_data_value_tabular_view()`
|
|
591
625
|
Attribute-specific version showing Element, Attribute, Value, Unit, and Type columns. Uses `Attribute.get_value()` for pint.Quantity extraction.
|
|
592
626
|
|
|
593
|
-
|
|
627
|
+
See [`19-data-value-view.md`](docs/plantuml-examples/19-data-value-view.md) for example output.
|
|
594
628
|
|
|
595
629
|
```python
|
|
596
630
|
from sysmlpy.plantuml import as_data_value_tabular_view
|
|
597
|
-
print(as_data_value_tabular_view(model
|
|
631
|
+
print(as_data_value_tabular_view(model)) # Default: markdown output
|
|
598
632
|
```
|
|
599
633
|
|
|
600
634
|
#### Relationship Matrix View — `as_relationship_matrix_view()`
|
|
@@ -605,11 +639,11 @@ Pairwise element×element matrix showing relationship types:
|
|
|
605
639
|
- **G** = Specialization (generalization)
|
|
606
640
|
- **B** = Binding, **F** = Flow, **R** = Redefinition, etc.
|
|
607
641
|
|
|
608
|
-
|
|
642
|
+
See [`20-relationship-matrix.md`](docs/plantuml-examples/20-relationship-matrix.md) for example output.
|
|
609
643
|
|
|
610
644
|
```python
|
|
611
645
|
from sysmlpy.plantuml import as_relationship_matrix_view
|
|
612
|
-
print(as_relationship_matrix_view(model
|
|
646
|
+
print(as_relationship_matrix_view(model)) # Default: markdown output
|
|
613
647
|
```
|
|
614
648
|
|
|
615
649
|
Type filtering and HTML output:
|
|
@@ -626,14 +660,14 @@ All rendering functions accept `style="color"` for colored output with CSS-style
|
|
|
626
660
|
|
|
627
661
|
```python
|
|
628
662
|
from sysmlpy.plantuml import as_tabular_view
|
|
629
|
-
print(as_tabular_view(model, style="color"))
|
|
663
|
+
print(as_tabular_view(model, output_format="html", style="color"))
|
|
630
664
|
```
|
|
631
665
|
|
|
632
|
-
|
|
666
|
+
See [`21-tabular-view-color.html`](docs/plantuml-examples/21-tabular-view-color.html) for example output.
|
|
633
667
|
|
|
634
668
|
### Complete Example Gallery
|
|
635
669
|
|
|
636
|
-
See [`docs/plantuml-examples/`](docs/plantuml-examples/) for all
|
|
670
|
+
See [`docs/plantuml-examples/`](docs/plantuml-examples/) for all rendered example images, covering every view function.
|
|
637
671
|
|
|
638
672
|
| # | Example | View Type |
|
|
639
673
|
|---|---------|-----------|
|
|
@@ -645,15 +679,19 @@ See [`docs/plantuml-examples/`](docs/plantuml-examples/) for all 16 rendered exa
|
|
|
645
679
|
| 6 | Interconnection | Interconnection View |
|
|
646
680
|
| 7 | General View (GV) | General View |
|
|
647
681
|
| 8 | Package View | Package View |
|
|
648
|
-
| 9 |
|
|
649
|
-
| 10 |
|
|
650
|
-
| 11 |
|
|
651
|
-
| 12 |
|
|
652
|
-
| 13 |
|
|
653
|
-
| 14 |
|
|
654
|
-
| 15 |
|
|
655
|
-
| 16 |
|
|
656
|
-
| 17 |
|
|
682
|
+
| 9 | Package Diagram | Package Diagram View |
|
|
683
|
+
| 10 | Block Definition Diagram (BDD) | Block Definition View |
|
|
684
|
+
| 11 | Internal Block Diagram (IBD) | Internal Block Diagram |
|
|
685
|
+
| 12 | Parametric Diagram | Parametric View |
|
|
686
|
+
| 13 | Action Flow View (AFV) | Action Flow View |
|
|
687
|
+
| 14 | State Transition View (STV) | State Transition View |
|
|
688
|
+
| 15 | Tree Diagram | Tree Diagram |
|
|
689
|
+
| 16 | Element Table | Element Table |
|
|
690
|
+
| 17 | Textual Notation | Textual Notation |
|
|
691
|
+
| 18 | Tabular View (GridView) | Tabular View |
|
|
692
|
+
| 19 | Data Value Tabular View (GridView) | Data Value View |
|
|
693
|
+
| 20 | Relationship Matrix (GridView) | Relationship Matrix |
|
|
694
|
+
| 21 | Tabular View — Color | Tabular View (color) |
|
|
657
695
|
|
|
658
696
|
## Conformance
|
|
659
697
|
|
|
@@ -14,6 +14,8 @@ The project had diverged so much from sysml2py that a new name, sysmlpy, was sel
|
|
|
14
14
|
|
|
15
15
|

|
|
16
16
|
|
|
17
|
+
**v0.28.0:** Complete Gap 4 coverage — Block Definition Diagram (BDD), Internal Block Diagram (IBD), Parametric Diagram, and Package Diagram views. All 6 specialized SysML v2 view types now implemented (144 PlantUML tests). IBD shows flow/connection arrows with endpoint extraction. Parametric view extracts constraint parameters with types. Package diagram renders nested folder-style hierarchy.
|
|
18
|
+
|
|
17
19
|
**v0.27.0:** General View (GV), Package View, and three GridView specializations (Tabular View, Data Value Tabular View, Relationship Matrix View) with PlantUML, Markdown, and HTML output. 108 PlantUML tests. All 68+ `NotImplementedError` stubs in `grammar/classes.py` replaced with graceful handling.
|
|
18
20
|
|
|
19
21
|
**v0.26.0:** Action Flow View, Interconnection View, and State Transition View with auto-include of connected elements. Grammar-level flow scanning. 101 PlantUML tests.
|
|
@@ -448,10 +450,42 @@ from sysmlpy.plantuml import as_package_view
|
|
|
448
450
|
print(as_package_view(model, style="bw"))
|
|
449
451
|
```
|
|
450
452
|
|
|
453
|
+
#### Package Diagram View — `as_package_diagram_view()`
|
|
454
|
+
Folder-style package hierarchy with elements nested inside their containing packages. Shows containment structure clearly with color-coded element types.
|
|
455
|
+
|
|
456
|
+
```python
|
|
457
|
+
from sysmlpy.plantuml import as_package_diagram_view
|
|
458
|
+
print(as_package_diagram_view(model, style="bw"))
|
|
459
|
+
```
|
|
460
|
+
|
|
461
|
+
#### Block Definition Diagram (BDD) — `as_block_definition_view()`
|
|
462
|
+
Corresponds to SysML v2 Block Definition Diagrams. Shows block definitions with compartments for attributes, ports, and part references. Displays generalization relationships.
|
|
463
|
+
|
|
464
|
+
```python
|
|
465
|
+
from sysmlpy.plantuml import as_block_definition_view
|
|
466
|
+
print(as_block_definition_view(model, style="bw"))
|
|
467
|
+
```
|
|
468
|
+
|
|
469
|
+
#### Internal Block Diagram (IBD) — `as_internal_block_diagram()`
|
|
470
|
+
Corresponds to SysML v2 Internal Block Diagrams. Shows a single block's internal structure with boundary ports, nested parts, and flow/connection arrows between endpoints.
|
|
471
|
+
|
|
472
|
+
```python
|
|
473
|
+
from sysmlpy.plantuml import as_internal_block_diagram
|
|
474
|
+
print(as_internal_block_diagram(model, style="bw"))
|
|
475
|
+
```
|
|
476
|
+
|
|
477
|
+
#### Parametric Diagram — `as_parametric_view()`
|
|
478
|
+
Shows constraint definitions with parameter compartments (including types like `Real`). Supports constraint usages and parameter bindings.
|
|
479
|
+
|
|
480
|
+
```python
|
|
481
|
+
from sysmlpy.plantuml import as_parametric_view
|
|
482
|
+
print(as_parametric_view(model, style="bw"))
|
|
483
|
+
```
|
|
484
|
+
|
|
451
485
|
#### Action Flow View (AFV) — `as_action_flow_view()`
|
|
452
486
|
Corresponds to SysML v2 ``ActionFlowView`` (short name ``afv``). Shows actions with their control and object flows. Auto-includes connected flow elements.
|
|
453
487
|
|
|
454
|
-

|
|
455
489
|
|
|
456
490
|
```python
|
|
457
491
|
from sysmlpy.plantuml import as_action_flow_view
|
|
@@ -471,7 +505,7 @@ print(as_interconnection_view(model, style="bw"))
|
|
|
471
505
|
#### State Transition View (STV) — `as_state_transition_view()`
|
|
472
506
|
Corresponds to SysML v2 ``StateTransitionView`` (short name ``stv``). State machine diagram with hierarchical states and transitions. Auto-includes connected transition elements.
|
|
473
507
|
|
|
474
|
-

|
|
475
509
|
|
|
476
510
|
```python
|
|
477
511
|
from sysmlpy.plantuml import as_state_transition_view
|
|
@@ -481,19 +515,17 @@ print(as_state_transition_view(model, style="bw"))
|
|
|
481
515
|
#### Tree Diagram — `as_tree_diagram()`
|
|
482
516
|
Hierarchical containment tree using nested PlantUML containers. Shows ownership hierarchy with sharp corners for definitions and rounded corners for usages.
|
|
483
517
|
|
|
484
|
-

|
|
485
519
|
|
|
486
520
|
```python
|
|
487
521
|
from sysmlpy.plantuml import as_tree_diagram
|
|
488
522
|
print(as_tree_diagram(model, style="bw"))
|
|
489
523
|
```
|
|
490
524
|
|
|
491
|
-
### Tabular View Rendering Functions
|
|
492
|
-
|
|
493
525
|
#### Element Table — `as_element_table()`
|
|
494
526
|
A simple tabular listing with columns Name, Type, Kind, and Parent.
|
|
495
527
|
|
|
496
|
-

|
|
497
529
|
|
|
498
530
|
```python
|
|
499
531
|
from sysmlpy.plantuml import as_element_table
|
|
@@ -503,7 +535,7 @@ print(as_element_table(model, style="bw"))
|
|
|
503
535
|
#### Textual Notation — `as_textual_notation()`
|
|
504
536
|
Indented text representation inside a PlantUML note, similar to the SysML v2 textual concrete syntax.
|
|
505
537
|
|
|
506
|
-

|
|
507
539
|
|
|
508
540
|
```python
|
|
509
541
|
from sysmlpy.plantuml import as_textual_notation
|
|
@@ -514,20 +546,22 @@ print(as_textual_notation(model, style="bw"))
|
|
|
514
546
|
|
|
515
547
|
Per the SysML v2 standard, ``GridView`` (short name ``grv``) presents exposed model elements and their relationships in a rectangular grid. It has three specializations, all supporting **three output formats**:
|
|
516
548
|
|
|
517
|
-
| Format | Use case |
|
|
518
|
-
|
|
519
|
-
| `"
|
|
520
|
-
| `"
|
|
521
|
-
| `"
|
|
549
|
+
| Format | Use case | Compatibility |
|
|
550
|
+
|--------|----------|---------------|
|
|
551
|
+
| `"markdown"` (default) | Standard pipe table — for GitHub, MkDocs, or Jupyter | ✅ Universal |
|
|
552
|
+
| `"html"` | Rich `<table>` with CSS classes — for web dashboards | ✅ Universal |
|
|
553
|
+
| `"plantuml"` | PlantUML table / salt matrix — embed in diagrams | ⚠️ PlantUML <1.2024.7 only |
|
|
554
|
+
|
|
555
|
+
**Note:** PlantUML 1.2024.7+ removed support for legacy table syntax. Use `"markdown"` or `"html"` output format for compatibility with all PlantUML versions.
|
|
522
556
|
|
|
523
557
|
#### Tabular View — `as_tabular_view()`
|
|
524
558
|
Extensible table with configurable columns. Default columns: Name, Type, Kind, Parent, Typed By, Specializes.
|
|
525
559
|
|
|
526
|
-
|
|
560
|
+
See [`18-tabular-view.md`](docs/plantuml-examples/18-tabular-view.md) for example output.
|
|
527
561
|
|
|
528
562
|
```python
|
|
529
563
|
from sysmlpy.plantuml import as_tabular_view
|
|
530
|
-
print(as_tabular_view(model
|
|
564
|
+
print(as_tabular_view(model)) # Default: markdown output
|
|
531
565
|
```
|
|
532
566
|
|
|
533
567
|
Custom columns and other output formats:
|
|
@@ -538,18 +572,18 @@ print(as_tabular_view(model,
|
|
|
538
572
|
columns=["Name", "Type", "Parent", "Typed By"],
|
|
539
573
|
output_format="html"))
|
|
540
574
|
|
|
541
|
-
# Markdown for documentation
|
|
575
|
+
# Markdown for documentation (default)
|
|
542
576
|
print(as_tabular_view(model, output_format="markdown"))
|
|
543
577
|
```
|
|
544
578
|
|
|
545
579
|
#### Data Value Tabular View — `as_data_value_tabular_view()`
|
|
546
580
|
Attribute-specific version showing Element, Attribute, Value, Unit, and Type columns. Uses `Attribute.get_value()` for pint.Quantity extraction.
|
|
547
581
|
|
|
548
|
-
|
|
582
|
+
See [`19-data-value-view.md`](docs/plantuml-examples/19-data-value-view.md) for example output.
|
|
549
583
|
|
|
550
584
|
```python
|
|
551
585
|
from sysmlpy.plantuml import as_data_value_tabular_view
|
|
552
|
-
print(as_data_value_tabular_view(model
|
|
586
|
+
print(as_data_value_tabular_view(model)) # Default: markdown output
|
|
553
587
|
```
|
|
554
588
|
|
|
555
589
|
#### Relationship Matrix View — `as_relationship_matrix_view()`
|
|
@@ -560,11 +594,11 @@ Pairwise element×element matrix showing relationship types:
|
|
|
560
594
|
- **G** = Specialization (generalization)
|
|
561
595
|
- **B** = Binding, **F** = Flow, **R** = Redefinition, etc.
|
|
562
596
|
|
|
563
|
-
|
|
597
|
+
See [`20-relationship-matrix.md`](docs/plantuml-examples/20-relationship-matrix.md) for example output.
|
|
564
598
|
|
|
565
599
|
```python
|
|
566
600
|
from sysmlpy.plantuml import as_relationship_matrix_view
|
|
567
|
-
print(as_relationship_matrix_view(model
|
|
601
|
+
print(as_relationship_matrix_view(model)) # Default: markdown output
|
|
568
602
|
```
|
|
569
603
|
|
|
570
604
|
Type filtering and HTML output:
|
|
@@ -581,14 +615,14 @@ All rendering functions accept `style="color"` for colored output with CSS-style
|
|
|
581
615
|
|
|
582
616
|
```python
|
|
583
617
|
from sysmlpy.plantuml import as_tabular_view
|
|
584
|
-
print(as_tabular_view(model, style="color"))
|
|
618
|
+
print(as_tabular_view(model, output_format="html", style="color"))
|
|
585
619
|
```
|
|
586
620
|
|
|
587
|
-
|
|
621
|
+
See [`21-tabular-view-color.html`](docs/plantuml-examples/21-tabular-view-color.html) for example output.
|
|
588
622
|
|
|
589
623
|
### Complete Example Gallery
|
|
590
624
|
|
|
591
|
-
See [`docs/plantuml-examples/`](docs/plantuml-examples/) for all
|
|
625
|
+
See [`docs/plantuml-examples/`](docs/plantuml-examples/) for all rendered example images, covering every view function.
|
|
592
626
|
|
|
593
627
|
| # | Example | View Type |
|
|
594
628
|
|---|---------|-----------|
|
|
@@ -600,15 +634,19 @@ See [`docs/plantuml-examples/`](docs/plantuml-examples/) for all 16 rendered exa
|
|
|
600
634
|
| 6 | Interconnection | Interconnection View |
|
|
601
635
|
| 7 | General View (GV) | General View |
|
|
602
636
|
| 8 | Package View | Package View |
|
|
603
|
-
| 9 |
|
|
604
|
-
| 10 |
|
|
605
|
-
| 11 |
|
|
606
|
-
| 12 |
|
|
607
|
-
| 13 |
|
|
608
|
-
| 14 |
|
|
609
|
-
| 15 |
|
|
610
|
-
| 16 |
|
|
611
|
-
| 17 |
|
|
637
|
+
| 9 | Package Diagram | Package Diagram View |
|
|
638
|
+
| 10 | Block Definition Diagram (BDD) | Block Definition View |
|
|
639
|
+
| 11 | Internal Block Diagram (IBD) | Internal Block Diagram |
|
|
640
|
+
| 12 | Parametric Diagram | Parametric View |
|
|
641
|
+
| 13 | Action Flow View (AFV) | Action Flow View |
|
|
642
|
+
| 14 | State Transition View (STV) | State Transition View |
|
|
643
|
+
| 15 | Tree Diagram | Tree Diagram |
|
|
644
|
+
| 16 | Element Table | Element Table |
|
|
645
|
+
| 17 | Textual Notation | Textual Notation |
|
|
646
|
+
| 18 | Tabular View (GridView) | Tabular View |
|
|
647
|
+
| 19 | Data Value Tabular View (GridView) | Data Value View |
|
|
648
|
+
| 20 | Relationship Matrix (GridView) | Relationship Matrix |
|
|
649
|
+
| 21 | Tabular View — Color | Tabular View (color) |
|
|
612
650
|
|
|
613
651
|
## Conformance
|
|
614
652
|
|
|
@@ -6,7 +6,7 @@ build-backend = "poetry.core.masonry.api"
|
|
|
6
6
|
|
|
7
7
|
[project]
|
|
8
8
|
name = "sysmlpy"
|
|
9
|
-
version = "0.
|
|
9
|
+
version = "0.28.1"
|
|
10
10
|
description = "SysML v2.0 Parser"
|
|
11
11
|
authors = [
|
|
12
12
|
{ name="Jon R. Fox (mycr0ft)", email="jon.fox@drfox.com" },
|
|
@@ -114,7 +114,7 @@ build_command = "pip install poetry && poetry build"
|
|
|
114
114
|
|
|
115
115
|
[tool.poetry]
|
|
116
116
|
name = "sysmlpy"
|
|
117
|
-
version = "0.
|
|
117
|
+
version = "0.28.1"
|
|
118
118
|
description = ""
|
|
119
119
|
authors = ["Jon R. Fox (mycr0ft) <jon.fox@drfox.com>"]
|
|
120
120
|
readme = "README.md"
|
|
@@ -14,12 +14,13 @@ __all__ = [
|
|
|
14
14
|
"Store", "InMemoryStore", "NetworkXStore", "KuzuStore", "CayleyStore", "create_store", "new_id",
|
|
15
15
|
"to_plantuml", "PlantUMLGenerator",
|
|
16
16
|
"as_action_flow_view", "as_interconnection_view", "as_state_transition_view",
|
|
17
|
-
"as_general_view", "as_package_view", "
|
|
17
|
+
"as_general_view", "as_package_view", "as_package_diagram_view", "as_block_definition_view", "as_internal_block_diagram",
|
|
18
|
+
"as_parametric_view", "as_requirement_view",
|
|
18
19
|
"as_tabular_view", "as_data_value_tabular_view", "as_relationship_matrix_view",
|
|
19
20
|
"analyze", "SemanticIssue", "SemanticAnalyzer",
|
|
20
21
|
]
|
|
21
22
|
__author__ = "Jon Fox"
|
|
22
|
-
__version__ = "0.
|
|
23
|
+
__version__ = "0.28.1"
|
|
23
24
|
|
|
24
25
|
from sysmlpy.usage import (
|
|
25
26
|
Item, Attribute, Part, Port, Action, Reference, UseCase, Requirement, Interface, Message,
|
|
@@ -232,7 +233,8 @@ def load_antlr(fp):
|
|
|
232
233
|
|
|
233
234
|
from sysmlpy.plantuml import (to_plantuml, PlantUMLGenerator,
|
|
234
235
|
as_action_flow_view, as_interconnection_view, as_state_transition_view,
|
|
235
|
-
as_general_view, as_package_view,
|
|
236
|
+
as_general_view, as_package_view, as_package_diagram_view, as_block_definition_view, as_internal_block_diagram,
|
|
237
|
+
as_parametric_view, as_requirement_view,
|
|
236
238
|
as_tabular_view, as_data_value_tabular_view, as_relationship_matrix_view)
|
|
237
239
|
|
|
238
240
|
from sysmlpy.semantic import analyze, SemanticIssue, SemanticAnalyzer
|
|
@@ -245,10 +245,138 @@ def _visit_comment_dict(ctx):
|
|
|
245
245
|
}
|
|
246
246
|
|
|
247
247
|
|
|
248
|
+
def _visit_textual_representation_dict(ctx):
|
|
249
|
+
"""Visit a textualRepresentation context and return a TextualRepresentation dictionary.
|
|
250
|
+
|
|
251
|
+
Grammar: (REP identification?)? LANGUAGE DOUBLE_STRING REGULAR_COMMENT
|
|
252
|
+
"""
|
|
253
|
+
identification = None
|
|
254
|
+
if ctx.identification():
|
|
255
|
+
identification = _build_identification_dict(ctx.identification())
|
|
256
|
+
|
|
257
|
+
language = ""
|
|
258
|
+
if ctx.DOUBLE_STRING():
|
|
259
|
+
language = ctx.DOUBLE_STRING().getText().strip('"')
|
|
260
|
+
|
|
261
|
+
body = ""
|
|
262
|
+
if ctx.REGULAR_COMMENT():
|
|
263
|
+
body = ctx.REGULAR_COMMENT().getText()
|
|
264
|
+
|
|
265
|
+
return {
|
|
266
|
+
"name": "TextualRepresentation",
|
|
267
|
+
"identification": identification,
|
|
268
|
+
"language": language,
|
|
269
|
+
"body": body
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
|
|
273
|
+
def _visit_metadata_feature_dict(ctx):
|
|
274
|
+
"""Visit a metadataFeature context and return a MetadataFeature dictionary.
|
|
275
|
+
|
|
276
|
+
Grammar: (prefixMetadataMember)* (AT_SIGN | METADATA) metadataFeatureDeclaration (
|
|
277
|
+
ABOUT annotation ( COMMA annotation)*
|
|
278
|
+
)? metadataBody
|
|
279
|
+
"""
|
|
280
|
+
prefix_members = []
|
|
281
|
+
for pm in ctx.prefixMetadataMember():
|
|
282
|
+
prefix_members.append(_visit_prefix_metadata_member_dict(pm))
|
|
283
|
+
|
|
284
|
+
identification = None
|
|
285
|
+
owned_feature_typing = None
|
|
286
|
+
if ctx.metadataFeatureDeclaration():
|
|
287
|
+
mfd = ctx.metadataFeatureDeclaration()
|
|
288
|
+
if mfd.identification():
|
|
289
|
+
identification = _build_identification_dict(mfd.identification())
|
|
290
|
+
if mfd.ownedFeatureTyping():
|
|
291
|
+
owned_feature_typing = _visit_owned_feature_typing_dict(mfd.ownedFeatureTyping())
|
|
292
|
+
|
|
293
|
+
annotations = []
|
|
294
|
+
if ctx.ABOUT():
|
|
295
|
+
for ann_idx in range(len(ctx.annotation())):
|
|
296
|
+
ann_ctx = ctx.annotation(ann_idx)
|
|
297
|
+
if ann_ctx and ann_ctx.qualifiedName():
|
|
298
|
+
qn_text = ann_ctx.qualifiedName().getText()
|
|
299
|
+
annotations.append({
|
|
300
|
+
"name": "Annotation",
|
|
301
|
+
"annotatedElement": {
|
|
302
|
+
"name": "QualifiedName",
|
|
303
|
+
"names": qn_text.split("::")
|
|
304
|
+
}
|
|
305
|
+
})
|
|
306
|
+
|
|
307
|
+
body = ""
|
|
308
|
+
if ctx.metadataBody() and ctx.metadataBody().SEMI():
|
|
309
|
+
body = ";"
|
|
310
|
+
|
|
311
|
+
return {
|
|
312
|
+
"name": "MetadataFeature",
|
|
313
|
+
"prefixMetadataMember": prefix_members,
|
|
314
|
+
"identification": identification,
|
|
315
|
+
"ownedFeatureTyping": owned_feature_typing,
|
|
316
|
+
"ownedRelationship_about": annotations,
|
|
317
|
+
"body": body
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
|
|
321
|
+
def _visit_prefix_metadata_member_dict(ctx):
|
|
322
|
+
"""Visit a prefixMetadataMember context."""
|
|
323
|
+
visibility = ""
|
|
324
|
+
direction = ""
|
|
325
|
+
|
|
326
|
+
if ctx.PRIVATE():
|
|
327
|
+
visibility = "private"
|
|
328
|
+
elif ctx.PROTECTED():
|
|
329
|
+
visibility = "protected"
|
|
330
|
+
elif ctx.PUBLIC():
|
|
331
|
+
visibility = "public"
|
|
332
|
+
|
|
333
|
+
if ctx.IN():
|
|
334
|
+
direction = "in"
|
|
335
|
+
elif ctx.OUT():
|
|
336
|
+
direction = "out"
|
|
337
|
+
elif ctx.INOUT():
|
|
338
|
+
direction = "inout"
|
|
339
|
+
|
|
340
|
+
return {
|
|
341
|
+
"name": "PrefixMetadataMember",
|
|
342
|
+
"visibility": visibility,
|
|
343
|
+
"direction": direction
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
|
|
347
|
+
def _visit_owned_feature_typing_dict(ctx):
|
|
348
|
+
"""Visit an ownedFeatureTyping context and return an OwnedFeatureTyping dictionary."""
|
|
349
|
+
if ctx is None:
|
|
350
|
+
return None
|
|
351
|
+
|
|
352
|
+
if hasattr(ctx, 'qualifiedName') and ctx.qualifiedName():
|
|
353
|
+
qns = ctx.qualifiedName()
|
|
354
|
+
if not isinstance(qns, list):
|
|
355
|
+
qns = [qns]
|
|
356
|
+
names = []
|
|
357
|
+
for qn in qns:
|
|
358
|
+
if qn:
|
|
359
|
+
names.append(qn.getText())
|
|
360
|
+
if names:
|
|
361
|
+
return {
|
|
362
|
+
"name": "OwnedFeatureTyping",
|
|
363
|
+
"type": {
|
|
364
|
+
"name": "FeatureType",
|
|
365
|
+
"type": {
|
|
366
|
+
"name": "QualifiedName",
|
|
367
|
+
"names": names
|
|
368
|
+
},
|
|
369
|
+
"ownedRelatedElement": []
|
|
370
|
+
},
|
|
371
|
+
"ownedRelatedElement": []
|
|
372
|
+
}
|
|
373
|
+
return None
|
|
374
|
+
|
|
375
|
+
|
|
248
376
|
def _visit_annotating_element_dict(annot_elem_ctx):
|
|
249
377
|
"""Visit an annotating element context and return an AnnotatingElement dictionary.
|
|
250
378
|
|
|
251
|
-
Dispatches to documentation
|
|
379
|
+
Dispatches to documentation, comment, textualRepresentation, or metadataFeature.
|
|
252
380
|
"""
|
|
253
381
|
if annot_elem_ctx is None:
|
|
254
382
|
return None
|
|
@@ -258,6 +386,10 @@ def _visit_annotating_element_dict(annot_elem_ctx):
|
|
|
258
386
|
inner = _visit_documentation_dict(annot_elem_ctx.documentation())
|
|
259
387
|
elif hasattr(annot_elem_ctx, 'comment') and annot_elem_ctx.comment():
|
|
260
388
|
inner = _visit_comment_dict(annot_elem_ctx.comment())
|
|
389
|
+
elif hasattr(annot_elem_ctx, 'textualRepresentation') and annot_elem_ctx.textualRepresentation():
|
|
390
|
+
inner = _visit_textual_representation_dict(annot_elem_ctx.textualRepresentation())
|
|
391
|
+
elif hasattr(annot_elem_ctx, 'metadataFeature') and annot_elem_ctx.metadataFeature():
|
|
392
|
+
inner = _visit_metadata_feature_dict(annot_elem_ctx.metadataFeature())
|
|
261
393
|
|
|
262
394
|
if inner is None:
|
|
263
395
|
return None
|