sysmlpy 0.27.2__tar.gz → 0.28.0__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.
Files changed (147) hide show
  1. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/PKG-INFO +49 -11
  2. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/README.md +48 -10
  3. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/pyproject.toml +2 -2
  4. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/__init__.py +5 -3
  5. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/antlr_parser.py +22 -4
  6. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/antlr_visitor.py +69 -79
  7. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/definition.py +4 -5
  8. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/grammar/classes.py +387 -3
  9. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/plantuml.py +1055 -0
  10. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/usage.py +111 -0
  11. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/LICENSE +0 -0
  12. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/__main__.py +0 -0
  13. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/antlr/README.md +0 -0
  14. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/antlr/SysMLv2Lexer.interp +0 -0
  15. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/antlr/SysMLv2Lexer.py +0 -0
  16. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/antlr/SysMLv2Lexer.tokens +0 -0
  17. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/antlr/SysMLv2Parser.interp +0 -0
  18. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/antlr/SysMLv2Parser.py +0 -0
  19. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/antlr/SysMLv2Parser.tokens +0 -0
  20. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/antlr/SysMLv2ParserListener.py +0 -0
  21. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/antlr/SysMLv2ParserVisitor.py +0 -0
  22. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/antlr/src/sysmlpy/grammar/antlr4/SysMLv2Lexer.interp +0 -0
  23. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/antlr/src/sysmlpy/grammar/antlr4/SysMLv2Lexer.py +0 -0
  24. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/antlr/src/sysmlpy/grammar/antlr4/SysMLv2Lexer.tokens +0 -0
  25. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/examples/attribute_values.py +0 -0
  26. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/examples/part_attributes.py +0 -0
  27. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/examples/tuples_sequences.py +0 -0
  28. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/formatting.py +0 -0
  29. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/grammar/antlr4/README.md +0 -0
  30. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/grammar/antlr4/SysMLv2Lexer.g4 +0 -0
  31. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/grammar/antlr4/SysMLv2Lexer.interp +0 -0
  32. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/grammar/antlr4/SysMLv2Lexer.py +0 -0
  33. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/grammar/antlr4/SysMLv2Lexer.tokens +0 -0
  34. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/grammar/antlr4/SysMLv2Parser.g4 +0 -0
  35. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/grammar/antlr4/SysMLv2Parser.interp +0 -0
  36. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/grammar/antlr4/SysMLv2Parser.py +0 -0
  37. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/grammar/antlr4/SysMLv2Parser.tokens +0 -0
  38. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/grammar/antlr4/SysMLv2ParserListener.py +0 -0
  39. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/grammar/antlr4/SysMLv2ParserVisitor.py +0 -0
  40. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/grammar/antlr4/desc.xml +0 -0
  41. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/grammar/antlr4/examples/camera.sysml +0 -0
  42. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/grammar/antlr4/examples/toaster-system.sysml +0 -0
  43. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/grammar/antlr4/examples/vehicle-model.sysml +0 -0
  44. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/grammar/antlr4/pom.xml +0 -0
  45. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/library/LICENSE +0 -0
  46. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/library/README.md +0 -0
  47. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/library/__init__.py +0 -0
  48. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/library/domain/Analysis/AnalysisTooling.sysml +0 -0
  49. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/library/domain/Analysis/SampledFunctions.sysml +0 -0
  50. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/library/domain/Analysis/StateSpaceRepresentation.sysml +0 -0
  51. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/library/domain/Analysis/TradeStudies.sysml +0 -0
  52. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/library/domain/Cause and Effect/CausationConnections.sysml +0 -0
  53. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/library/domain/Cause and Effect/CauseAndEffect.sysml +0 -0
  54. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/library/domain/Geometry/ShapeItems.sysml +0 -0
  55. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/library/domain/Geometry/SpatialItems.sysml +0 -0
  56. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/library/domain/Metadata/ImageMetadata.sysml +0 -0
  57. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/library/domain/Metadata/ModelingMetadata.sysml +0 -0
  58. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/library/domain/Metadata/ParametersOfInterestMetadata.sysml +0 -0
  59. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/library/domain/Metadata/RiskMetadata.sysml +0 -0
  60. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/library/domain/Quantities and Units/ISQ.sysml +0 -0
  61. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/library/domain/Quantities and Units/ISQAcoustics.sysml +0 -0
  62. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/library/domain/Quantities and Units/ISQAtomicNuclear.sysml +0 -0
  63. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/library/domain/Quantities and Units/ISQBase.sysml +0 -0
  64. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/library/domain/Quantities and Units/ISQCharacteristicNumbers.sysml +0 -0
  65. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/library/domain/Quantities and Units/ISQChemistryMolecular.sysml +0 -0
  66. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/library/domain/Quantities and Units/ISQCondensedMatter.sysml +0 -0
  67. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/library/domain/Quantities and Units/ISQElectromagnetism.sysml +0 -0
  68. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/library/domain/Quantities and Units/ISQInformation.sysml +0 -0
  69. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/library/domain/Quantities and Units/ISQLight.sysml +0 -0
  70. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/library/domain/Quantities and Units/ISQMechanics.sysml +0 -0
  71. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/library/domain/Quantities and Units/ISQSpaceTime.sysml +0 -0
  72. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/library/domain/Quantities and Units/ISQThermodynamics.sysml +0 -0
  73. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/library/domain/Quantities and Units/MeasurementRefCalculations.sysml +0 -0
  74. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/library/domain/Quantities and Units/MeasurementReferences.sysml +0 -0
  75. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/library/domain/Quantities and Units/Quantities.sysml +0 -0
  76. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/library/domain/Quantities and Units/QuantityCalculations.sysml +0 -0
  77. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/library/domain/Quantities and Units/SI.sysml +0 -0
  78. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/library/domain/Quantities and Units/SIPrefixes.sysml +0 -0
  79. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/library/domain/Quantities and Units/TensorCalculations.sysml +0 -0
  80. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/library/domain/Quantities and Units/Time.sysml +0 -0
  81. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/library/domain/Quantities and Units/USCustomaryUnits.sysml +0 -0
  82. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/library/domain/Quantities and Units/VectorCalculations.sysml +0 -0
  83. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/library/domain/Requirement Derivation/DerivationConnections.sysml +0 -0
  84. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/library/domain/Requirement Derivation/RequirementDerivation.sysml +0 -0
  85. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/library/kernel/Base.kerml +0 -0
  86. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/library/kernel/BaseFunctions.kerml +0 -0
  87. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/library/kernel/BooleanFunctions.kerml +0 -0
  88. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/library/kernel/Clocks.kerml +0 -0
  89. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/library/kernel/CollectionFunctions.kerml +0 -0
  90. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/library/kernel/Collections.kerml +0 -0
  91. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/library/kernel/ComplexFunctions.kerml +0 -0
  92. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/library/kernel/ControlFunctions.kerml +0 -0
  93. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/library/kernel/ControlPerformances.kerml +0 -0
  94. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/library/kernel/DataFunctions.kerml +0 -0
  95. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/library/kernel/FeatureReferencingPerformances.kerml +0 -0
  96. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/library/kernel/IntegerFunctions.kerml +0 -0
  97. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/library/kernel/KerML.kerml +0 -0
  98. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/library/kernel/Links.kerml +0 -0
  99. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/library/kernel/Metaobjects.kerml +0 -0
  100. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/library/kernel/NaturalFunctions.kerml +0 -0
  101. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/library/kernel/NumericalFunctions.kerml +0 -0
  102. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/library/kernel/Objects.kerml +0 -0
  103. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/library/kernel/Observation.kerml +0 -0
  104. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/library/kernel/OccurrenceFunctions.kerml +0 -0
  105. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/library/kernel/Occurrences.kerml +0 -0
  106. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/library/kernel/Performances.kerml +0 -0
  107. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/library/kernel/RationalFunctions.kerml +0 -0
  108. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/library/kernel/RealFunctions.kerml +0 -0
  109. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/library/kernel/ScalarFunctions.kerml +0 -0
  110. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/library/kernel/ScalarValues.kerml +0 -0
  111. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/library/kernel/SequenceFunctions.kerml +0 -0
  112. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/library/kernel/SpatialFrames.kerml +0 -0
  113. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/library/kernel/StatePerformances.kerml +0 -0
  114. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/library/kernel/StringFunctions.kerml +0 -0
  115. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/library/kernel/Transfers.kerml +0 -0
  116. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/library/kernel/TransitionPerformances.kerml +0 -0
  117. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/library/kernel/TrigFunctions.kerml +0 -0
  118. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/library/kernel/Triggers.kerml +0 -0
  119. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/library/kernel/VectorFunctions.kerml +0 -0
  120. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/library/kernel/VectorValues.kerml +0 -0
  121. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/library/systems/Actions.sysml +0 -0
  122. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/library/systems/Allocations.sysml +0 -0
  123. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/library/systems/AnalysisCases.sysml +0 -0
  124. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/library/systems/Attributes.sysml +0 -0
  125. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/library/systems/Calculations.sysml +0 -0
  126. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/library/systems/Cases.sysml +0 -0
  127. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/library/systems/Connections.sysml +0 -0
  128. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/library/systems/Constraints.sysml +0 -0
  129. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/library/systems/Flows.sysml +0 -0
  130. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/library/systems/Interfaces.sysml +0 -0
  131. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/library/systems/Items.sysml +0 -0
  132. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/library/systems/Metadata.sysml +0 -0
  133. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/library/systems/Parts.sysml +0 -0
  134. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/library/systems/Ports.sysml +0 -0
  135. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/library/systems/Requirements.sysml +0 -0
  136. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/library/systems/StandardViewDefinitions.sysml +0 -0
  137. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/library/systems/States.sysml +0 -0
  138. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/library/systems/SysML.sysml +0 -0
  139. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/library/systems/UseCases.sysml +0 -0
  140. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/library/systems/VerificationCases.sysml +0 -0
  141. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/library/systems/Views.sysml +0 -0
  142. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/navigate.py +0 -0
  143. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/project.py +0 -0
  144. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/semantic.py +0 -0
  145. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/store.py +0 -0
  146. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/us_customary_units.txt +0 -0
  147. {sysmlpy-0.27.2 → sysmlpy-0.28.0}/src/sysmlpy/validator.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sysmlpy
3
- Version: 0.27.2
3
+ Version: 0.28.0
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
  ![Lines of Code Over Time](loc_history.svg)
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,6 +495,38 @@ 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
 
@@ -633,7 +667,7 @@ print(as_tabular_view(model, style="color"))
633
667
 
634
668
  ### Complete Example Gallery
635
669
 
636
- See [`docs/plantuml-examples/`](docs/plantuml-examples/) for all 16 rendered example images, covering every view function.
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 | Action Flow View (AFV) | Action Flow View |
649
- | 10 | State Transition View (STV) | State Transition View |
650
- | 11 | Tree Diagram | Tree Diagram |
651
- | 12 | Element Table | Element Table |
652
- | 13 | Textual Notation | Textual Notation |
653
- | 14 | Tabular View (GridView) | Tabular View |
654
- | 15 | Data Value Tabular View (GridView) | Data Value View |
655
- | 16 | Relationship Matrix (GridView) | Relationship Matrix |
656
- | 17 | Tabular View — Color | Tabular View (color) |
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
  ![Lines of Code Over Time](loc_history.svg)
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,6 +450,38 @@ 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
 
@@ -588,7 +622,7 @@ print(as_tabular_view(model, style="color"))
588
622
 
589
623
  ### Complete Example Gallery
590
624
 
591
- See [`docs/plantuml-examples/`](docs/plantuml-examples/) for all 16 rendered example images, covering every view function.
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 | Action Flow View (AFV) | Action Flow View |
604
- | 10 | State Transition View (STV) | State Transition View |
605
- | 11 | Tree Diagram | Tree Diagram |
606
- | 12 | Element Table | Element Table |
607
- | 13 | Textual Notation | Textual Notation |
608
- | 14 | Tabular View (GridView) | Tabular View |
609
- | 15 | Data Value Tabular View (GridView) | Data Value View |
610
- | 16 | Relationship Matrix (GridView) | Relationship Matrix |
611
- | 17 | Tabular View — Color | Tabular View (color) |
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.27.2"
9
+ version = "0.28.0"
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.27.2"
117
+ version = "0.28.0"
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", "as_requirement_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.27.2"
23
+ __version__ = "0.28.0"
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, as_requirement_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
@@ -59,16 +59,34 @@ def parse(source, library=None):
59
59
  SysMLSyntaxError
60
60
  If the source contains syntax errors.
61
61
  """
62
+ from pathlib import Path
63
+
62
64
  # Handle string or file input
63
65
  if hasattr(source, 'read'):
64
66
  content = source.read()
65
67
  else:
66
68
  content = source
67
69
 
68
- # TODO: If library path is provided, load library files and prepend to content
69
- # For now, just parse the source directly
70
- # Library loading would involve reading .sysml files from the library path
71
- # and making them available for import resolution
70
+ # Load library files if library path is provided
71
+ if library is not None:
72
+ library_paths = [library] if isinstance(library, (str, Path)) else library
73
+ library_content = []
74
+
75
+ for lib_path in library_paths:
76
+ lib_path = Path(lib_path)
77
+ if lib_path.exists() and lib_path.is_dir():
78
+ # Load all .sysml and .kerml files from library directory
79
+ for ext in ['*.sysml', '*.kerml']:
80
+ for lib_file in lib_path.glob(f'**/{ext}'):
81
+ try:
82
+ lib_content = lib_file.read_text(encoding='utf-8')
83
+ library_content.append(lib_content)
84
+ except Exception:
85
+ pass # Skip files that can't be read
86
+
87
+ # Prepend library content to main content
88
+ if library_content:
89
+ content = '\n\n'.join(library_content) + '\n\n' + content
72
90
 
73
91
  # Create input stream
74
92
  input_stream = InputStream(content)
@@ -18,6 +18,46 @@ def _extract_name_shortname(name_text):
18
18
  return name_text, None
19
19
 
20
20
 
21
+ def _extract_name_from_ident(ident):
22
+ """Extract (name, shortname) from an Identification context.
23
+
24
+ Parameters
25
+ ----------
26
+ ident : antlr4 ParserRuleContext
27
+ Identification context from ANTLR parser.
28
+
29
+ Returns
30
+ -------
31
+ tuple
32
+ (name, shortname) tuple. Returns (None, None) if no name found.
33
+
34
+ Handles:
35
+ - `name` → (name, None)
36
+ - `<shortname> name` → (name, shortname)
37
+ """
38
+ name = None
39
+ shortname = None
40
+ if ident is None:
41
+ return name, shortname
42
+
43
+ if hasattr(ident, 'name'):
44
+ name_list = ident.name()
45
+ if name_list and isinstance(name_list, list):
46
+ if len(name_list) == 2:
47
+ # <shortname> name pattern
48
+ shortname = name_list[0].getText()
49
+ name = name_list[1].getText()
50
+ elif len(name_list) == 1:
51
+ name_text = name_list[0].getText()
52
+ # Check for explicit angle brackets: <name> → shortname only
53
+ if hasattr(ident, 'LT') and ident.LT() is not None:
54
+ shortname = name_text
55
+ else:
56
+ name = name_text
57
+
58
+ return name, shortname
59
+
60
+
21
61
  def _get_usage_identification(ctx):
22
62
  """Extract (name, shortname) from a usage context by navigating to usageDeclaration().identification().
23
63
 
@@ -40,18 +80,7 @@ def _get_usage_identification(ctx):
40
80
 
41
81
  if usage_decl and hasattr(usage_decl, 'identification') and usage_decl.identification():
42
82
  ident = usage_decl.identification()
43
- if hasattr(ident, 'name'):
44
- name_list = ident.name()
45
- if name_list and isinstance(name_list, list):
46
- if len(name_list) == 2:
47
- shortname = name_list[0].getText()
48
- name = name_list[1].getText()
49
- elif len(name_list) == 1:
50
- name_text = name_list[0].getText()
51
- if hasattr(ident, 'LT') and ident.LT() is not None:
52
- shortname = name_text
53
- else:
54
- name = name_text
83
+ name, shortname = _extract_name_from_ident(ident)
55
84
 
56
85
  return name, shortname
57
86
 
@@ -127,19 +156,7 @@ def _get_definition_identification(ctx):
127
156
 
128
157
  if dd and hasattr(dd, 'identification') and dd.identification():
129
158
  ident = dd.identification()
130
- if hasattr(ident, 'name'):
131
- name_list = ident.name()
132
- if name_list and isinstance(name_list, list):
133
- if len(name_list) == 2:
134
- # LT name GT name: first is short name, second is long name
135
- shortname = name_list[0].getText()
136
- name = name_list[1].getText()
137
- elif len(name_list) == 1:
138
- name_text = name_list[0].getText()
139
- if hasattr(ident, 'LT') and ident.LT() is not None:
140
- shortname = name_text
141
- else:
142
- name = name_text
159
+ name, shortname = _extract_name_from_ident(ident)
143
160
 
144
161
  return name, shortname
145
162
 
@@ -157,20 +174,7 @@ def _build_identification_dict(ident_ctx):
157
174
  shortname = None
158
175
 
159
176
  if hasattr(ident_ctx, 'name'):
160
- name_list = ident_ctx.name()
161
- if name_list and isinstance(name_list, list):
162
- if len(name_list) == 2:
163
- # LT name GT name: first is short name, second is long name
164
- shortname = name_list[0].getText()
165
- name = name_list[1].getText()
166
- elif len(name_list) == 1:
167
- name_text = name_list[0].getText()
168
- # Check for explicit angle brackets: <name> → shortname only
169
- has_lt = hasattr(ident_ctx, 'LT') and ident_ctx.LT() is not None
170
- if has_lt:
171
- shortname = name_text
172
- else:
173
- name = name_text
177
+ name, shortname = _extract_name_from_ident(ident_ctx)
174
178
 
175
179
  if name is None and shortname is None:
176
180
  return None
@@ -314,21 +318,7 @@ def _visit_package_dict(tree):
314
318
  ident = decl.identification()
315
319
  if ident:
316
320
  # Handle identification: LT name GT name | LT name GT | name
317
- if hasattr(ident, 'name'):
318
- name_list = ident.name()
319
- if name_list and isinstance(name_list, list):
320
- if len(name_list) == 2:
321
- # LT name GT name: first is short name, second is long name
322
- pkg_shortname = name_list[0].getText()
323
- pkg_name = name_list[1].getText()
324
- elif len(name_list) == 1:
325
- name_text = name_list[0].getText()
326
- # Check for explicit < > angle brackets
327
- if hasattr(ident, 'LT') and ident.LT() is not None:
328
- pkg_shortname = name_text
329
- else:
330
- pkg_name = name_text
331
- # If len(name_list) == 0, leave both as None
321
+ pkg_name, pkg_shortname = _extract_name_from_ident(ident)
332
322
 
333
323
  # Build package body elements
334
324
  body_elements = []
@@ -828,19 +818,8 @@ def _make_nested_package_dict(ctx, prefix=None):
828
818
  decl = ctx.packageDeclaration()
829
819
  if hasattr(decl, 'identification'):
830
820
  ident = decl.identification()
831
- if ident and hasattr(ident, 'name'):
832
- name_list = ident.name()
833
- if name_list and isinstance(name_list, list):
834
- if len(name_list) == 2:
835
- pkg_shortname = name_list[0].getText()
836
- pkg_name = name_list[1].getText()
837
- elif len(name_list) == 1:
838
- name_text = name_list[0].getText()
839
- # Explicit angle brackets <name> → shortname; bare name → declaredName
840
- if hasattr(ident, 'LT') and ident.LT() is not None:
841
- pkg_shortname = name_text
842
- else:
843
- pkg_name = name_text
821
+ if ident:
822
+ pkg_name, pkg_shortname = _extract_name_from_ident(ident)
844
823
 
845
824
  # Process body elements
846
825
  body_elements = []
@@ -2497,6 +2476,28 @@ def _visit_send_node(ctx):
2497
2476
  "specialization": None
2498
2477
  }
2499
2478
  }
2479
+ elif hasattr(ctx, 'actionUsageDeclaration') and ctx.actionUsageDeclaration():
2480
+ aud = ctx.actionUsageDeclaration()
2481
+ action_node_decl = {
2482
+ "name": "ActionNodeUsageDeclaration",
2483
+ "declaration": None
2484
+ }
2485
+ if hasattr(aud, 'usageDeclaration') and aud.usageDeclaration():
2486
+ ud = aud.usageDeclaration()
2487
+ if ud:
2488
+ name, shortname = _get_usage_identification_from_ud(ud)
2489
+ action_node_decl["declaration"] = {
2490
+ "name": "UsageDeclaration",
2491
+ "declaration": {
2492
+ "name": "FeatureDeclaration",
2493
+ "identification": {
2494
+ "name": "Identification",
2495
+ "declaredShortName": shortname,
2496
+ "declaredName": name
2497
+ },
2498
+ "specialization": None
2499
+ }
2500
+ }
2500
2501
 
2501
2502
  node_param = None
2502
2503
  if hasattr(ctx, 'nodeParameterMember') and ctx.nodeParameterMember():
@@ -4055,18 +4056,7 @@ def _get_usage_identification_from_ud(ud):
4055
4056
  shortname = None
4056
4057
  if ud and hasattr(ud, 'identification') and ud.identification():
4057
4058
  ident = ud.identification()
4058
- if hasattr(ident, 'name'):
4059
- name_list = ident.name()
4060
- if name_list and isinstance(name_list, list):
4061
- if len(name_list) == 2:
4062
- shortname = name_list[0].getText()
4063
- name = name_list[1].getText()
4064
- elif len(name_list) == 1:
4065
- name_text = name_list[0].getText()
4066
- if hasattr(ident, 'LT') and ident.LT() is not None:
4067
- shortname = name_text
4068
- else:
4069
- name = name_text
4059
+ name, shortname = _extract_name_from_ident(ident)
4070
4060
  return name, shortname
4071
4061
 
4072
4062
 
@@ -559,10 +559,10 @@ class Package(Searchable):
559
559
  "prefix": None,
560
560
  }
561
561
 
562
- # Add the typed by definition to the package output
562
+ # Packages cannot be typed; they should import from other packages.
563
+ # If typedby is set, print a warning and ignore it.
563
564
  if self.typedby is not None:
564
- # Packages cannot be typed, they should import from other packages
565
- raise NotImplementedError
565
+ print(f"[Package] Warning: Packages cannot be typed. Ignoring typedby '{self.typedby.name}'. Use imports instead.") # pragma: no cover
566
566
 
567
567
  return package
568
568
 
@@ -1221,8 +1221,7 @@ class Package(Searchable):
1221
1221
  r.parent = self
1222
1222
  self.children.append(r)
1223
1223
  else:
1224
- print(f"Unknown class: {inner_class}")
1225
- raise NotImplementedError
1224
+ print(f"[Package.load_from_grammar] Unknown class: {inner_class} - skipping") # pragma: no cover
1226
1225
 
1227
1226
  return self
1228
1227