sysmlpy 0.30.0__tar.gz → 0.30.2__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.30.0 → sysmlpy-0.30.2}/PKG-INFO +1 -1
  2. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/pyproject.toml +2 -2
  3. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/__init__.py +41 -15
  4. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/definition.py +56 -2
  5. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/navigate.py +91 -20
  6. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/semantic.py +45 -4
  7. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/usage.py +44 -5
  8. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/LICENSE +0 -0
  9. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/README.md +0 -0
  10. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/__main__.py +0 -0
  11. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/antlr/README.md +0 -0
  12. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/antlr/SysMLv2Lexer.interp +0 -0
  13. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/antlr/SysMLv2Lexer.py +0 -0
  14. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/antlr/SysMLv2Lexer.tokens +0 -0
  15. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/antlr/SysMLv2Parser.interp +0 -0
  16. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/antlr/SysMLv2Parser.py +0 -0
  17. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/antlr/SysMLv2Parser.tokens +0 -0
  18. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/antlr/SysMLv2ParserListener.py +0 -0
  19. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/antlr/SysMLv2ParserVisitor.py +0 -0
  20. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/antlr/src/sysmlpy/grammar/antlr4/SysMLv2Lexer.interp +0 -0
  21. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/antlr/src/sysmlpy/grammar/antlr4/SysMLv2Lexer.py +0 -0
  22. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/antlr/src/sysmlpy/grammar/antlr4/SysMLv2Lexer.tokens +0 -0
  23. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/antlr_parser.py +0 -0
  24. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/antlr_visitor.py +0 -0
  25. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/examples/attribute_values.py +0 -0
  26. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/examples/part_attributes.py +0 -0
  27. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/examples/tuples_sequences.py +0 -0
  28. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/formatting.py +0 -0
  29. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/grammar/antlr4/README.md +0 -0
  30. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/grammar/antlr4/SysMLv2Lexer.g4 +0 -0
  31. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/grammar/antlr4/SysMLv2Lexer.interp +0 -0
  32. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/grammar/antlr4/SysMLv2Lexer.py +0 -0
  33. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/grammar/antlr4/SysMLv2Lexer.tokens +0 -0
  34. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/grammar/antlr4/SysMLv2Parser.g4 +0 -0
  35. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/grammar/antlr4/SysMLv2Parser.interp +0 -0
  36. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/grammar/antlr4/SysMLv2Parser.py +0 -0
  37. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/grammar/antlr4/SysMLv2Parser.tokens +0 -0
  38. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/grammar/antlr4/SysMLv2ParserListener.py +0 -0
  39. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/grammar/antlr4/SysMLv2ParserVisitor.py +0 -0
  40. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/grammar/antlr4/desc.xml +0 -0
  41. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/grammar/antlr4/examples/camera.sysml +0 -0
  42. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/grammar/antlr4/examples/toaster-system.sysml +0 -0
  43. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/grammar/antlr4/examples/vehicle-model.sysml +0 -0
  44. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/grammar/antlr4/pom.xml +0 -0
  45. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/grammar/classes.py +0 -0
  46. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/library/LICENSE +0 -0
  47. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/library/README.md +0 -0
  48. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/library/__init__.py +0 -0
  49. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/library/domain/Analysis/AnalysisTooling.sysml +0 -0
  50. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/library/domain/Analysis/SampledFunctions.sysml +0 -0
  51. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/library/domain/Analysis/StateSpaceRepresentation.sysml +0 -0
  52. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/library/domain/Analysis/TradeStudies.sysml +0 -0
  53. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/library/domain/Cause and Effect/CausationConnections.sysml +0 -0
  54. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/library/domain/Cause and Effect/CauseAndEffect.sysml +0 -0
  55. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/library/domain/Geometry/ShapeItems.sysml +0 -0
  56. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/library/domain/Geometry/SpatialItems.sysml +0 -0
  57. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/library/domain/Metadata/ImageMetadata.sysml +0 -0
  58. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/library/domain/Metadata/ModelingMetadata.sysml +0 -0
  59. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/library/domain/Metadata/ParametersOfInterestMetadata.sysml +0 -0
  60. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/library/domain/Metadata/RiskMetadata.sysml +0 -0
  61. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/library/domain/Quantities and Units/ISQ.sysml +0 -0
  62. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/library/domain/Quantities and Units/ISQAcoustics.sysml +0 -0
  63. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/library/domain/Quantities and Units/ISQAtomicNuclear.sysml +0 -0
  64. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/library/domain/Quantities and Units/ISQBase.sysml +0 -0
  65. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/library/domain/Quantities and Units/ISQCharacteristicNumbers.sysml +0 -0
  66. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/library/domain/Quantities and Units/ISQChemistryMolecular.sysml +0 -0
  67. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/library/domain/Quantities and Units/ISQCondensedMatter.sysml +0 -0
  68. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/library/domain/Quantities and Units/ISQElectromagnetism.sysml +0 -0
  69. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/library/domain/Quantities and Units/ISQInformation.sysml +0 -0
  70. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/library/domain/Quantities and Units/ISQLight.sysml +0 -0
  71. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/library/domain/Quantities and Units/ISQMechanics.sysml +0 -0
  72. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/library/domain/Quantities and Units/ISQSpaceTime.sysml +0 -0
  73. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/library/domain/Quantities and Units/ISQThermodynamics.sysml +0 -0
  74. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/library/domain/Quantities and Units/MeasurementRefCalculations.sysml +0 -0
  75. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/library/domain/Quantities and Units/MeasurementReferences.sysml +0 -0
  76. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/library/domain/Quantities and Units/Quantities.sysml +0 -0
  77. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/library/domain/Quantities and Units/QuantityCalculations.sysml +0 -0
  78. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/library/domain/Quantities and Units/SI.sysml +0 -0
  79. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/library/domain/Quantities and Units/SIPrefixes.sysml +0 -0
  80. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/library/domain/Quantities and Units/TensorCalculations.sysml +0 -0
  81. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/library/domain/Quantities and Units/Time.sysml +0 -0
  82. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/library/domain/Quantities and Units/USCustomaryUnits.sysml +0 -0
  83. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/library/domain/Quantities and Units/VectorCalculations.sysml +0 -0
  84. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/library/domain/Requirement Derivation/DerivationConnections.sysml +0 -0
  85. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/library/domain/Requirement Derivation/RequirementDerivation.sysml +0 -0
  86. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/library/kernel/Base.kerml +0 -0
  87. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/library/kernel/BaseFunctions.kerml +0 -0
  88. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/library/kernel/BooleanFunctions.kerml +0 -0
  89. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/library/kernel/Clocks.kerml +0 -0
  90. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/library/kernel/CollectionFunctions.kerml +0 -0
  91. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/library/kernel/Collections.kerml +0 -0
  92. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/library/kernel/ComplexFunctions.kerml +0 -0
  93. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/library/kernel/ControlFunctions.kerml +0 -0
  94. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/library/kernel/ControlPerformances.kerml +0 -0
  95. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/library/kernel/DataFunctions.kerml +0 -0
  96. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/library/kernel/FeatureReferencingPerformances.kerml +0 -0
  97. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/library/kernel/IntegerFunctions.kerml +0 -0
  98. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/library/kernel/KerML.kerml +0 -0
  99. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/library/kernel/Links.kerml +0 -0
  100. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/library/kernel/Metaobjects.kerml +0 -0
  101. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/library/kernel/NaturalFunctions.kerml +0 -0
  102. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/library/kernel/NumericalFunctions.kerml +0 -0
  103. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/library/kernel/Objects.kerml +0 -0
  104. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/library/kernel/Observation.kerml +0 -0
  105. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/library/kernel/OccurrenceFunctions.kerml +0 -0
  106. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/library/kernel/Occurrences.kerml +0 -0
  107. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/library/kernel/Performances.kerml +0 -0
  108. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/library/kernel/RationalFunctions.kerml +0 -0
  109. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/library/kernel/RealFunctions.kerml +0 -0
  110. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/library/kernel/ScalarFunctions.kerml +0 -0
  111. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/library/kernel/ScalarValues.kerml +0 -0
  112. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/library/kernel/SequenceFunctions.kerml +0 -0
  113. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/library/kernel/SpatialFrames.kerml +0 -0
  114. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/library/kernel/StatePerformances.kerml +0 -0
  115. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/library/kernel/StringFunctions.kerml +0 -0
  116. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/library/kernel/Transfers.kerml +0 -0
  117. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/library/kernel/TransitionPerformances.kerml +0 -0
  118. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/library/kernel/TrigFunctions.kerml +0 -0
  119. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/library/kernel/Triggers.kerml +0 -0
  120. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/library/kernel/VectorFunctions.kerml +0 -0
  121. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/library/kernel/VectorValues.kerml +0 -0
  122. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/library/systems/Actions.sysml +0 -0
  123. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/library/systems/Allocations.sysml +0 -0
  124. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/library/systems/AnalysisCases.sysml +0 -0
  125. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/library/systems/Attributes.sysml +0 -0
  126. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/library/systems/Calculations.sysml +0 -0
  127. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/library/systems/Cases.sysml +0 -0
  128. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/library/systems/Connections.sysml +0 -0
  129. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/library/systems/Constraints.sysml +0 -0
  130. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/library/systems/Flows.sysml +0 -0
  131. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/library/systems/Interfaces.sysml +0 -0
  132. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/library/systems/Items.sysml +0 -0
  133. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/library/systems/Metadata.sysml +0 -0
  134. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/library/systems/Parts.sysml +0 -0
  135. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/library/systems/Ports.sysml +0 -0
  136. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/library/systems/Requirements.sysml +0 -0
  137. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/library/systems/StandardViewDefinitions.sysml +0 -0
  138. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/library/systems/States.sysml +0 -0
  139. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/library/systems/SysML.sysml +0 -0
  140. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/library/systems/UseCases.sysml +0 -0
  141. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/library/systems/VerificationCases.sysml +0 -0
  142. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/library/systems/Views.sysml +0 -0
  143. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/plantuml.py +0 -0
  144. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/project.py +0 -0
  145. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/store.py +0 -0
  146. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/us_customary_units.txt +0 -0
  147. {sysmlpy-0.30.0 → sysmlpy-0.30.2}/src/sysmlpy/validator.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sysmlpy
3
- Version: 0.30.0
3
+ Version: 0.30.2
4
4
  Summary: SysML v2.0 Parser
5
5
  License: MIT License
6
6
 
@@ -6,7 +6,7 @@ build-backend = "poetry.core.masonry.api"
6
6
 
7
7
  [project]
8
8
  name = "sysmlpy"
9
- version = "0.30.0"
9
+ version = "0.30.2"
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.30.0"
117
+ version = "0.30.2"
118
118
  description = ""
119
119
  authors = ["Jon R. Fox (mycr0ft) <jon.fox@drfox.com>"]
120
120
  readme = "README.md"
@@ -8,7 +8,7 @@ Uses the ANTLR4 parser for full SysML v2 grammar support.
8
8
  """
9
9
 
10
10
  __all__ = [
11
- "load", "loads", "load_grammar", "load_antlr", "load_grammar_antlr",
11
+ "load", "loads", "parse", "load_grammar", "load_antlr", "load_grammar_antlr",
12
12
  "load_files", "load_project", "load_with_dependencies",
13
13
  "Searchable",
14
14
  "Store", "InMemoryStore", "NetworkXStore", "KuzuStore", "CayleyStore", "create_store", "new_id",
@@ -17,10 +17,11 @@ __all__ = [
17
17
  "as_general_view", "as_package_view", "as_package_diagram_view", "as_block_definition_view", "as_internal_block_diagram",
18
18
  "as_parametric_view", "as_requirement_view",
19
19
  "as_tabular_view", "as_data_value_tabular_view", "as_relationship_matrix_view",
20
- "analyze", "SemanticIssue", "SemanticAnalyzer",
20
+ "analyze", "AnalysisResult", "SemanticIssue", "SemanticAnalyzer",
21
+ "SysMLSyntaxError",
21
22
  ]
22
23
  __author__ = "Jon Fox"
23
- __version__ = "0.30.0"
24
+ __version__ = "0.30.2"
24
25
 
25
26
  from sysmlpy.usage import (
26
27
  Item, Attribute, Part, Port, Action, Reference, UseCase, Requirement, Interface, Message,
@@ -35,6 +36,7 @@ from sysmlpy.navigate import Searchable
35
36
  from sysmlpy.store import Store, InMemoryStore, NetworkXStore, KuzuStore, CayleyStore, create_store, new_id
36
37
 
37
38
  from sysmlpy.usage import ureg
39
+ from sysmlpy.antlr_parser import SysMLSyntaxError
38
40
 
39
41
 
40
42
  def load_grammar(s, debug=False):
@@ -95,15 +97,14 @@ def load_grammar(s, debug=False):
95
97
 
96
98
  return result
97
99
  except antlr_parser.SysMLSyntaxError as e:
98
- print("ANTLR4 returned the following error: {}".format(e))
99
100
  raise
100
101
 
101
102
 
102
- def load(fp):
103
+ def load(fp) -> Model:
103
104
  """SysML load from file pointer
104
105
 
105
106
  Deserialize ``fp`` (a ``.read()``-supporting file-like object containing
106
- a SysML v2.0 document) to a Python dictionary object.
107
+ a SysML v2.0 document) to a Model object.
107
108
 
108
109
  Parameters
109
110
  ----------
@@ -112,8 +113,8 @@ def load(fp):
112
113
 
113
114
  Returns
114
115
  -------
115
- dict
116
- Dictionary version structured utilizing SysML v2.0 grammar
116
+ Model
117
+ Model instance structured utilizing SysML v2.0 grammar
117
118
 
118
119
  Raises
119
120
  ------
@@ -131,7 +132,7 @@ def load(fp):
131
132
  return loads(fp.read())
132
133
 
133
134
 
134
- def loads(s: str, library=None):
135
+ def loads(s: str, library=None) -> Model:
135
136
  """Loads a model from string.
136
137
 
137
138
  This shortcut function allows a user to build a model from a string by
@@ -146,10 +147,36 @@ def loads(s: str, library=None):
146
147
  The SysML v2 source code to parse.
147
148
  library : str or Path, optional
148
149
  Path to SysML v2 library files for resolving imports.
150
+
151
+ Returns
152
+ -------
153
+ Model
154
+ Model instance built from the SysML source.
149
155
  """
150
156
  return Model().load(s, library=library)
151
157
 
152
158
 
159
+ def parse(s: str, library=None):
160
+ """Parse SysML source, returning (model, errors) rather than raising.
161
+
162
+ Parameters
163
+ ----------
164
+ s : str
165
+ The SysML v2 source code to parse.
166
+ library : str or Path, optional
167
+ Path to SysML v2 library files for resolving imports.
168
+
169
+ Returns
170
+ -------
171
+ tuple[Model | None, list[str]]
172
+ ``(Model, [])`` on success, ``(None, [error_lines])`` on syntax error.
173
+ """
174
+ try:
175
+ return loads(s, library=library), []
176
+ except SysMLSyntaxError as e:
177
+ return None, str(e).splitlines()
178
+
179
+
153
180
  def load_grammar_antlr(fp, debug=False, library=None):
154
181
  """SysML load from file pointer using ANTLR4 parser.
155
182
 
@@ -195,15 +222,14 @@ def load_grammar_antlr(fp, debug=False, library=None):
195
222
  try:
196
223
  return antlr_visitor.parse_to_dict(s, library=library)
197
224
  except antlr_parser.SysMLSyntaxError as e:
198
- print("ANTLR4 returned the following error: {}".format(e))
199
225
  raise
200
226
 
201
227
 
202
- def load_antlr(fp):
228
+ def load_antlr(fp) -> Model:
203
229
  """SysML load from file pointer using ANTLR4 parser.
204
230
 
205
231
  Deserialize ``fp`` (a ``.read()``-supporting file-like object containing
206
- a SysML v2.0 document) to a Python dictionary object.
232
+ a SysML v2.0 document) to a Model object.
207
233
 
208
234
  Parameters
209
235
  ----------
@@ -212,8 +238,8 @@ def load_antlr(fp):
212
238
 
213
239
  Returns
214
240
  -------
215
- dict
216
- Dictionary version structured utilizing SysML v2.0 grammar
241
+ Model
242
+ Model instance structured utilizing SysML v2.0 grammar
217
243
 
218
244
  Raises
219
245
  ------
@@ -237,7 +263,7 @@ from sysmlpy.plantuml import (to_plantuml, PlantUMLGenerator,
237
263
  as_parametric_view, as_requirement_view,
238
264
  as_tabular_view, as_data_value_tabular_view, as_relationship_matrix_view)
239
265
 
240
- from sysmlpy.semantic import analyze, SemanticIssue, SemanticAnalyzer
266
+ from sysmlpy.semantic import analyze, AnalysisResult, SemanticIssue, SemanticAnalyzer
241
267
 
242
268
  from sysmlpy.project import load_files, load_project, load_with_dependencies
243
269
 
@@ -203,7 +203,7 @@ class Model(Searchable):
203
203
  """
204
204
  return self.grammar.get_definition()
205
205
 
206
- def dump(self):
206
+ def dump(self) -> str:
207
207
  """Serialize the model to SysML v2 textual notation.
208
208
 
209
209
  Returns
@@ -230,6 +230,13 @@ class Model(Searchable):
230
230
  self._ensure_body()
231
231
  return classtree(self._get_definition()).dump()
232
232
 
233
+ def __str__(self) -> str:
234
+ """Return the SysML v2 text representation of the model."""
235
+ try:
236
+ return self.dump()
237
+ except Exception:
238
+ return repr(self)
239
+
233
240
  def _set_child(self, child):
234
241
  """Add a child package or element to the model.
235
242
 
@@ -247,6 +254,23 @@ class Model(Searchable):
247
254
  child.parent = self
248
255
  return self
249
256
 
257
+ add_child = _set_child
258
+
259
+ def _get_child(self, featurechain):
260
+ """Retrieve a nested child by dot-separated name path.
261
+
262
+ Parameters
263
+ ----------
264
+ featurechain : str
265
+ Dot-separated path like "pkg.element".
266
+
267
+ Returns
268
+ -------
269
+ element or None
270
+ The matching child element, or None if not found.
271
+ """
272
+ return self
273
+
250
274
  def _get_child(self, featurechain):
251
275
  """Retrieve a nested child by dot-separated name path.
252
276
 
@@ -276,6 +300,8 @@ class Model(Searchable):
276
300
  else:
277
301
  return child._get_child(featurechain)
278
302
 
303
+ get_child = _get_child
304
+
279
305
  # ── Convenience functions ───────────────────────────────────────────
280
306
 
281
307
  def find_all(self, type=None, name=None):
@@ -452,6 +478,8 @@ class Package(Searchable):
452
478
 
453
479
  return self
454
480
 
481
+ set_name = _set_name
482
+
455
483
  def _get_name(self):
456
484
  """Retrieve the declared name from the package grammar.
457
485
 
@@ -479,6 +507,23 @@ class Package(Searchable):
479
507
  child.parent = self
480
508
  return self
481
509
 
510
+ add_child = _set_child
511
+
512
+ def _get_child(self, featurechain):
513
+ """Retrieve a nested child by dot-separated name path.
514
+
515
+ Parameters
516
+ ----------
517
+ featurechain : str
518
+ Dot-separated path like "pkg.element".
519
+
520
+ Returns
521
+ -------
522
+ element or None
523
+ The matching child element, or None if not found.
524
+ """
525
+ return self
526
+
482
527
  def _get_child(self, featurechain):
483
528
  """Retrieve a nested child by dot-separated name path.
484
529
 
@@ -509,6 +554,8 @@ class Package(Searchable):
509
554
  else:
510
555
  return child._get_child(featurechain)
511
556
 
557
+ get_child = _get_child
558
+
512
559
  def _ensure_body(self):
513
560
  """Rebuild the package grammar body from current children and imports.
514
561
 
@@ -572,7 +619,7 @@ class Package(Searchable):
572
619
 
573
620
  return package
574
621
 
575
- def dump(self, child=None):
622
+ def dump(self, child=None) -> str:
576
623
  """Serialize the package to SysML v2 textual notation.
577
624
 
578
625
  Parameters
@@ -587,6 +634,13 @@ class Package(Searchable):
587
634
  """
588
635
  return classtree(self._get_definition(child=False)).dump()
589
636
 
637
+ def __str__(self) -> str:
638
+ """Return the SysML v2 text representation of the package."""
639
+ try:
640
+ return self.dump()
641
+ except Exception:
642
+ return repr(self)
643
+
590
644
  def add_import(self, namespace, visibility="private", recursive=False, membership=None):
591
645
  """Add an import declaration to this package.
592
646
 
@@ -16,12 +16,12 @@ After parsing, every node in the public-API tree supports::
16
16
  model.actions # direct Action children
17
17
 
18
18
  model.find('Focus') # by name, any depth
19
- model.find(type='action') # by type keyword, any depth
20
- model.find('Focus', type='action') # name + type
21
- model.find(type=Action) # by class
22
- model.find('Focus', recursive=False) # direct children only
19
+ model.find(sysml_type='action') # by type keyword, any depth
20
+ model.find('Focus', sysml_type='action') # name + type
21
+ model.find(sysml_type=Action) # by class
22
+ model.find('Focus', recursive=False) # direct children only
23
23
 
24
- model.all('part') # shorthand for find(type='part')
24
+ model.all('part') # shorthand for find(sysml_type='part')
25
25
 
26
26
  Type strings
27
27
  ------------
@@ -188,17 +188,19 @@ class Searchable:
188
188
  # Search methods
189
189
  # ------------------------------------------------------------------
190
190
 
191
- def find(self, name=None, *, type=None, recursive=True):
191
+ def find(self, name=None, *, sysml_type=None, type=None, recursive=True) -> "list[Searchable]":
192
192
  """Find model elements by name and/or SysML type.
193
193
 
194
194
  Parameters
195
195
  ----------
196
196
  name : str, optional
197
197
  Declared element name to match exactly. ``None`` matches any name.
198
- type : str or class, optional
198
+ sysml_type : str or class, optional
199
199
  SysML type to filter by. Pass a string keyword (``'part'``,
200
200
  ``'action'``, …) or the corresponding class (``Part``,
201
201
  ``Action``, …). ``None`` matches any type.
202
+ type : str or class, optional
203
+ Deprecated alias for ``sysml_type``.
202
204
  recursive : bool
203
205
  When ``True`` (default) the search descends recursively into
204
206
  every child that itself exposes a ``find`` method.
@@ -216,17 +218,25 @@ class Searchable:
216
218
 
217
219
  Find every action, top-level only::
218
220
 
219
- model.find(type='action', recursive=False)
221
+ model.find(sysml_type='action', recursive=False)
220
222
 
221
223
  Find by class instead of string::
222
224
 
223
225
  from sysmlpy import Part
224
- model.find(type=Part)
226
+ model.find(sysml_type=Part)
225
227
 
226
228
  Combine name and type::
227
229
 
228
- model.find('engine', type='part')
230
+ model.find('engine', sysml_type='part')
229
231
  """
232
+ if type is not None and sysml_type is None:
233
+ import warnings
234
+ warnings.warn(
235
+ "find(type=...) is deprecated; use find(sysml_type=...) instead",
236
+ DeprecationWarning, stacklevel=2
237
+ )
238
+ sysml_type = type
239
+
230
240
  results = []
231
241
  for child in getattr(self, "children", []):
232
242
  # --- name gate ---
@@ -236,32 +246,34 @@ class Searchable:
236
246
  name_ok = True
237
247
 
238
248
  # --- type gate ---
239
- if type is None:
249
+ if sysml_type is None:
240
250
  type_ok = True
241
- elif isinstance(type, str):
242
- type_ok = getattr(child, "sysml_type", None) == type
251
+ elif isinstance(sysml_type, str):
252
+ type_ok = getattr(child, "sysml_type", None) == sysml_type
243
253
  else:
244
- type_ok = isinstance(child, type)
254
+ type_ok = isinstance(child, sysml_type)
245
255
 
246
256
  if name_ok and type_ok:
247
257
  results.append(child)
248
258
 
249
259
  # --- recurse ---
250
260
  if recursive and hasattr(child, "find"):
251
- results.extend(child.find(name=name, type=type, recursive=True))
261
+ results.extend(child.find(name=name, sysml_type=sysml_type, recursive=True))
252
262
 
253
263
  return results
254
264
 
255
- def all(self, type, recursive=True):
256
- """Return all elements of *type*, searching recursively by default.
265
+ def all(self, sysml_type, type=None, recursive=True) -> "list[Searchable]":
266
+ """Return all elements of *sysml_type*, searching recursively by default.
257
267
 
258
- This is a convenience alias for ``find(type=type, recursive=recursive)``.
268
+ This is a convenience alias for ``find(sysml_type=sysml_type, recursive=recursive)``.
259
269
 
260
270
  Parameters
261
271
  ----------
262
- type : str or class
272
+ sysml_type : str or class
263
273
  SysML type string (``'part'``, ``'action'``, …) or the
264
274
  corresponding class.
275
+ type : str or class, optional
276
+ Deprecated alias for ``sysml_type``.
265
277
  recursive : bool
266
278
  When ``True`` (default) the search descends into every child.
267
279
 
@@ -269,4 +281,63 @@ class Searchable:
269
281
  -------
270
282
  list
271
283
  """
272
- return self.find(type=type, recursive=recursive)
284
+ if type is not None and sysml_type is None:
285
+ import warnings
286
+ warnings.warn(
287
+ "all(type=...) is deprecated; use all(sysml_type=...) instead",
288
+ DeprecationWarning, stacklevel=2
289
+ )
290
+ sysml_type = type
291
+ return self.find(sysml_type=sysml_type, recursive=recursive)
292
+
293
+ def find_one(self, name=None, *, sysml_type=None) -> "Searchable | None":
294
+ """Return the single matching element, or None if not found.
295
+
296
+ Raises LookupError if more than one match is found.
297
+ Use find() if you expect multiple results.
298
+ """
299
+ results = self.find(name, sysml_type=sysml_type)
300
+ if not results:
301
+ return None
302
+ if len(results) > 1:
303
+ raise LookupError(
304
+ f"find_one: {len(results)} matches for {name!r}, expected at most 1"
305
+ )
306
+ return results[0]
307
+
308
+ # ------------------------------------------------------------------
309
+ # Container protocol (__iter__, __len__, __contains__)
310
+ # ------------------------------------------------------------------
311
+
312
+ def __iter__(self):
313
+ """Iterate over direct children."""
314
+ return iter(self.children)
315
+
316
+ def __len__(self) -> int:
317
+ """Return the number of direct children."""
318
+ return len(self.children)
319
+
320
+ def __contains__(self, item) -> bool:
321
+ """True if item is a direct child, or if a string matches any child's name."""
322
+ if isinstance(item, str):
323
+ return any(getattr(c, 'name', None) == item for c in self.children)
324
+ return item in self.children
325
+
326
+ # ------------------------------------------------------------------
327
+ # Jupyter HTML representation
328
+ # ------------------------------------------------------------------
329
+
330
+ def _repr_html_(self) -> str:
331
+ """Jupyter-friendly collapsible HTML tree."""
332
+ def _render(elem, depth=0):
333
+ name = getattr(elem, 'name', '?')
334
+ stype = getattr(elem, 'sysml_type', type(elem).__name__)
335
+ is_def = getattr(elem, 'is_definition', False)
336
+ badge = f'<code style="color:#888;font-size:0.8em">{stype}{"_def" if is_def else ""}</code>'
337
+ children = getattr(elem, 'children', [])
338
+ if children:
339
+ inner = ''.join(_render(c, depth + 1) for c in children)
340
+ return (f'<details open><summary>{badge} <b>{name}</b></summary>'
341
+ f'<div style="margin-left:1em">{inner}</div></details>')
342
+ return f'<div>{badge} {name}</div>'
343
+ return f'<div style="font-family:monospace">{_render(self)}</div>'
@@ -28,6 +28,38 @@ class SemanticIssue:
28
28
  reference: str = ""
29
29
 
30
30
 
31
+ class AnalysisResult(list):
32
+ """A list of SemanticIssue with convenience accessors.
33
+
34
+ Backward-compatible with ``list[SemanticIssue]`` — existing code that
35
+ iterates or checks ``isinstance(result, list)`` continues to work.
36
+ """
37
+
38
+ @property
39
+ def errors(self) -> list[SemanticIssue]:
40
+ """Return only error-severity issues."""
41
+ return [i for i in self if i.severity == "error"]
42
+
43
+ @property
44
+ def warnings(self) -> list[SemanticIssue]:
45
+ """Return only warning-severity issues."""
46
+ return [i for i in self if i.severity == "warning"]
47
+
48
+ def raise_on_errors(self, message: str = "Semantic errors found") -> "AnalysisResult":
49
+ """Raise ValueError if any error-severity issues exist.
50
+
51
+ Returns self for chaining when no errors are present.
52
+ """
53
+ if self.errors:
54
+ details = "\n".join(f" [{i.code}] {i.message}" for i in self.errors)
55
+ raise ValueError(f"{message}:\n{details}")
56
+ return self
57
+
58
+ def __bool__(self) -> bool:
59
+ """True when there are no errors (warnings are acceptable)."""
60
+ return len(self.errors) == 0
61
+
62
+
31
63
  # ---------------------------------------------------------------------------
32
64
  # Library Symbol Index
33
65
  # ---------------------------------------------------------------------------
@@ -2096,7 +2128,8 @@ def analyze(
2096
2128
  library: Path | Sequence[Path] | str | Sequence[str] | None = None,
2097
2129
  filename: str | Path | None = None,
2098
2130
  style_checks: bool = True,
2099
- ) -> list[SemanticIssue]:
2131
+ strict: bool = False,
2132
+ ) -> AnalysisResult:
2100
2133
  """Run semantic analysis on *model* and return issues.
2101
2134
 
2102
2135
  Parameters
@@ -2111,12 +2144,20 @@ def analyze(
2111
2144
  style_checks : bool
2112
2145
  If True (default), run stylistic checks (naming conventions,
2113
2146
  file-package matching). Set to False to skip warnings.
2147
+ strict : bool
2148
+ If True, raises ValueError when any error-severity issues are found.
2149
+ Default False.
2114
2150
 
2115
2151
  Returns
2116
2152
  -------
2117
- list[SemanticIssue]
2118
- List of semantic issues found.
2153
+ AnalysisResult
2154
+ List of semantic issues found, wrapped in AnalysisResult for
2155
+ convenient access to ``.errors`` and ``.warnings`` properties.
2119
2156
  """
2120
- return SemanticAnalyzer().analyze(
2157
+ issues = SemanticAnalyzer().analyze(
2121
2158
  model, library=library, filename=filename, style_checks=style_checks
2122
2159
  )
2160
+ result = AnalysisResult(issues)
2161
+ if strict:
2162
+ result.raise_on_errors()
2163
+ return result