sysmlpy 0.25.2__tar.gz → 0.25.5__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.25.2 → sysmlpy-0.25.5}/PKG-INFO +2 -2
  2. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/README.md +1 -1
  3. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/pyproject.toml +2 -2
  4. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/__init__.py +1 -1
  5. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/semantic.py +166 -1
  6. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/LICENSE +0 -0
  7. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/__main__.py +0 -0
  8. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/antlr/README.md +0 -0
  9. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/antlr/SysMLv2Lexer.interp +0 -0
  10. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/antlr/SysMLv2Lexer.py +0 -0
  11. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/antlr/SysMLv2Lexer.tokens +0 -0
  12. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/antlr/SysMLv2Parser.interp +0 -0
  13. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/antlr/SysMLv2Parser.py +0 -0
  14. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/antlr/SysMLv2Parser.tokens +0 -0
  15. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/antlr/SysMLv2ParserListener.py +0 -0
  16. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/antlr/SysMLv2ParserVisitor.py +0 -0
  17. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/antlr/src/sysmlpy/grammar/antlr4/SysMLv2Lexer.interp +0 -0
  18. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/antlr/src/sysmlpy/grammar/antlr4/SysMLv2Lexer.py +0 -0
  19. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/antlr/src/sysmlpy/grammar/antlr4/SysMLv2Lexer.tokens +0 -0
  20. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/antlr_parser.py +0 -0
  21. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/antlr_visitor.py +0 -0
  22. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/definition.py +0 -0
  23. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/examples/attribute_values.py +0 -0
  24. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/examples/part_attributes.py +0 -0
  25. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/examples/tuples_sequences.py +0 -0
  26. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/formatting.py +0 -0
  27. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/grammar/antlr4/README.md +0 -0
  28. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/grammar/antlr4/SysMLv2Lexer.g4 +0 -0
  29. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/grammar/antlr4/SysMLv2Lexer.interp +0 -0
  30. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/grammar/antlr4/SysMLv2Lexer.py +0 -0
  31. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/grammar/antlr4/SysMLv2Lexer.tokens +0 -0
  32. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/grammar/antlr4/SysMLv2Parser.g4 +0 -0
  33. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/grammar/antlr4/SysMLv2Parser.interp +0 -0
  34. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/grammar/antlr4/SysMLv2Parser.py +0 -0
  35. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/grammar/antlr4/SysMLv2Parser.tokens +0 -0
  36. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/grammar/antlr4/SysMLv2ParserListener.py +0 -0
  37. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/grammar/antlr4/SysMLv2ParserVisitor.py +0 -0
  38. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/grammar/antlr4/desc.xml +0 -0
  39. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/grammar/antlr4/examples/camera.sysml +0 -0
  40. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/grammar/antlr4/examples/toaster-system.sysml +0 -0
  41. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/grammar/antlr4/examples/vehicle-model.sysml +0 -0
  42. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/grammar/antlr4/pom.xml +0 -0
  43. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/grammar/classes.py +0 -0
  44. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/library/LICENSE +0 -0
  45. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/library/README.md +0 -0
  46. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/library/__init__.py +0 -0
  47. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/library/domain/Analysis/AnalysisTooling.sysml +0 -0
  48. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/library/domain/Analysis/SampledFunctions.sysml +0 -0
  49. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/library/domain/Analysis/StateSpaceRepresentation.sysml +0 -0
  50. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/library/domain/Analysis/TradeStudies.sysml +0 -0
  51. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/library/domain/Cause and Effect/CausationConnections.sysml +0 -0
  52. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/library/domain/Cause and Effect/CauseAndEffect.sysml +0 -0
  53. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/library/domain/Geometry/ShapeItems.sysml +0 -0
  54. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/library/domain/Geometry/SpatialItems.sysml +0 -0
  55. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/library/domain/Metadata/ImageMetadata.sysml +0 -0
  56. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/library/domain/Metadata/ModelingMetadata.sysml +0 -0
  57. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/library/domain/Metadata/ParametersOfInterestMetadata.sysml +0 -0
  58. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/library/domain/Metadata/RiskMetadata.sysml +0 -0
  59. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/library/domain/Quantities and Units/ISQ.sysml +0 -0
  60. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/library/domain/Quantities and Units/ISQAcoustics.sysml +0 -0
  61. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/library/domain/Quantities and Units/ISQAtomicNuclear.sysml +0 -0
  62. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/library/domain/Quantities and Units/ISQBase.sysml +0 -0
  63. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/library/domain/Quantities and Units/ISQCharacteristicNumbers.sysml +0 -0
  64. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/library/domain/Quantities and Units/ISQChemistryMolecular.sysml +0 -0
  65. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/library/domain/Quantities and Units/ISQCondensedMatter.sysml +0 -0
  66. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/library/domain/Quantities and Units/ISQElectromagnetism.sysml +0 -0
  67. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/library/domain/Quantities and Units/ISQInformation.sysml +0 -0
  68. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/library/domain/Quantities and Units/ISQLight.sysml +0 -0
  69. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/library/domain/Quantities and Units/ISQMechanics.sysml +0 -0
  70. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/library/domain/Quantities and Units/ISQSpaceTime.sysml +0 -0
  71. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/library/domain/Quantities and Units/ISQThermodynamics.sysml +0 -0
  72. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/library/domain/Quantities and Units/MeasurementRefCalculations.sysml +0 -0
  73. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/library/domain/Quantities and Units/MeasurementReferences.sysml +0 -0
  74. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/library/domain/Quantities and Units/Quantities.sysml +0 -0
  75. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/library/domain/Quantities and Units/QuantityCalculations.sysml +0 -0
  76. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/library/domain/Quantities and Units/SI.sysml +0 -0
  77. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/library/domain/Quantities and Units/SIPrefixes.sysml +0 -0
  78. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/library/domain/Quantities and Units/TensorCalculations.sysml +0 -0
  79. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/library/domain/Quantities and Units/Time.sysml +0 -0
  80. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/library/domain/Quantities and Units/USCustomaryUnits.sysml +0 -0
  81. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/library/domain/Quantities and Units/VectorCalculations.sysml +0 -0
  82. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/library/domain/Requirement Derivation/DerivationConnections.sysml +0 -0
  83. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/library/domain/Requirement Derivation/RequirementDerivation.sysml +0 -0
  84. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/library/kernel/Base.kerml +0 -0
  85. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/library/kernel/BaseFunctions.kerml +0 -0
  86. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/library/kernel/BooleanFunctions.kerml +0 -0
  87. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/library/kernel/Clocks.kerml +0 -0
  88. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/library/kernel/CollectionFunctions.kerml +0 -0
  89. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/library/kernel/Collections.kerml +0 -0
  90. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/library/kernel/ComplexFunctions.kerml +0 -0
  91. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/library/kernel/ControlFunctions.kerml +0 -0
  92. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/library/kernel/ControlPerformances.kerml +0 -0
  93. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/library/kernel/DataFunctions.kerml +0 -0
  94. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/library/kernel/FeatureReferencingPerformances.kerml +0 -0
  95. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/library/kernel/IntegerFunctions.kerml +0 -0
  96. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/library/kernel/KerML.kerml +0 -0
  97. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/library/kernel/Links.kerml +0 -0
  98. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/library/kernel/Metaobjects.kerml +0 -0
  99. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/library/kernel/NaturalFunctions.kerml +0 -0
  100. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/library/kernel/NumericalFunctions.kerml +0 -0
  101. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/library/kernel/Objects.kerml +0 -0
  102. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/library/kernel/Observation.kerml +0 -0
  103. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/library/kernel/OccurrenceFunctions.kerml +0 -0
  104. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/library/kernel/Occurrences.kerml +0 -0
  105. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/library/kernel/Performances.kerml +0 -0
  106. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/library/kernel/RationalFunctions.kerml +0 -0
  107. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/library/kernel/RealFunctions.kerml +0 -0
  108. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/library/kernel/ScalarFunctions.kerml +0 -0
  109. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/library/kernel/ScalarValues.kerml +0 -0
  110. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/library/kernel/SequenceFunctions.kerml +0 -0
  111. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/library/kernel/SpatialFrames.kerml +0 -0
  112. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/library/kernel/StatePerformances.kerml +0 -0
  113. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/library/kernel/StringFunctions.kerml +0 -0
  114. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/library/kernel/Transfers.kerml +0 -0
  115. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/library/kernel/TransitionPerformances.kerml +0 -0
  116. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/library/kernel/TrigFunctions.kerml +0 -0
  117. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/library/kernel/Triggers.kerml +0 -0
  118. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/library/kernel/VectorFunctions.kerml +0 -0
  119. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/library/kernel/VectorValues.kerml +0 -0
  120. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/library/systems/Actions.sysml +0 -0
  121. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/library/systems/Allocations.sysml +0 -0
  122. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/library/systems/AnalysisCases.sysml +0 -0
  123. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/library/systems/Attributes.sysml +0 -0
  124. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/library/systems/Calculations.sysml +0 -0
  125. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/library/systems/Cases.sysml +0 -0
  126. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/library/systems/Connections.sysml +0 -0
  127. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/library/systems/Constraints.sysml +0 -0
  128. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/library/systems/Flows.sysml +0 -0
  129. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/library/systems/Interfaces.sysml +0 -0
  130. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/library/systems/Items.sysml +0 -0
  131. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/library/systems/Metadata.sysml +0 -0
  132. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/library/systems/Parts.sysml +0 -0
  133. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/library/systems/Ports.sysml +0 -0
  134. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/library/systems/Requirements.sysml +0 -0
  135. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/library/systems/StandardViewDefinitions.sysml +0 -0
  136. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/library/systems/States.sysml +0 -0
  137. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/library/systems/SysML.sysml +0 -0
  138. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/library/systems/UseCases.sysml +0 -0
  139. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/library/systems/VerificationCases.sysml +0 -0
  140. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/library/systems/Views.sysml +0 -0
  141. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/navigate.py +0 -0
  142. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/plantuml.py +0 -0
  143. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/project.py +0 -0
  144. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/store.py +0 -0
  145. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/us_customary_units.txt +0 -0
  146. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/usage.py +0 -0
  147. {sysmlpy-0.25.2 → sysmlpy-0.25.5}/src/sysmlpy/validator.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sysmlpy
3
- Version: 0.25.2
3
+ Version: 0.25.5
4
4
  Summary: SysML v2.0 Parser
5
5
  License: MIT License
6
6
 
@@ -59,7 +59,7 @@ 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.25.2:** View rendering convenience functions: `as_graphical_rendering()`, `as_interconnection_diagram()`, `as_tree_diagram()`, `as_element_table()`, `as_textual_notation()`. Black-and-white default style for journal article rendering. Custom style support via `custom_style` parameter. Views render as folder elements. 39 PlantUML tests passing.
62
+ **v0.25.5:** Stylistic checks: naming conventions (PascalCase defs, camelCase usages), file-package name matching. `analyze()` now accepts `filename` and `style_checks` parameters. 17 new semantic tests.
63
63
 
64
64
  **v0.19.0:** Semantic analysis engine with undefined symbol detection. Import resolution (namespace `::*`, membership, recursive `::*::**`). 530 tests passing. Symbol table with hierarchical scope resolution and qualified name lookup.
65
65
 
@@ -14,7 +14,7 @@ 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.25.2:** View rendering convenience functions: `as_graphical_rendering()`, `as_interconnection_diagram()`, `as_tree_diagram()`, `as_element_table()`, `as_textual_notation()`. Black-and-white default style for journal article rendering. Custom style support via `custom_style` parameter. Views render as folder elements. 39 PlantUML tests passing.
17
+ **v0.25.5:** Stylistic checks: naming conventions (PascalCase defs, camelCase usages), file-package name matching. `analyze()` now accepts `filename` and `style_checks` parameters. 17 new semantic tests.
18
18
 
19
19
  **v0.19.0:** Semantic analysis engine with undefined symbol detection. Import resolution (namespace `::*`, membership, recursive `::*::**`). 530 tests passing. Symbol table with hierarchical scope resolution and qualified name lookup.
20
20
 
@@ -6,7 +6,7 @@ build-backend = "poetry.core.masonry.api"
6
6
 
7
7
  [project]
8
8
  name = "sysmlpy"
9
- version = "0.25.2"
9
+ version = "0.25.5"
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.25.2"
117
+ version = "0.25.5"
118
118
  description = ""
119
119
  authors = ["Jon R. Fox (mycr0ft) <jon.fox@drfox.com>"]
120
120
  readme = "README.md"
@@ -16,7 +16,7 @@ __all__ = [
16
16
  "analyze", "SemanticIssue", "SemanticAnalyzer",
17
17
  ]
18
18
  __author__ = "Jon Fox"
19
- __version__ = "0.25.2"
19
+ __version__ = "0.25.5"
20
20
 
21
21
  from sysmlpy.usage import (
22
22
  Item, Attribute, Part, Port, Action, Reference, UseCase, Requirement, Interface, Message,
@@ -14,6 +14,8 @@ import re
14
14
  from pathlib import Path
15
15
  from typing import Any, Optional
16
16
 
17
+ from sysmlpy.definition import Model, Package
18
+
17
19
 
18
20
  @dataclasses.dataclass
19
21
  class SemanticIssue:
@@ -937,6 +939,8 @@ class SemanticAnalyzer:
937
939
  model: Any,
938
940
  *,
939
941
  library: Path | Sequence[Path] | str | Sequence[str] | None = None,
942
+ filename: str | Path | None = None,
943
+ style_checks: bool = True,
940
944
  ) -> list[SemanticIssue]:
941
945
  """Run semantic analysis on *model* and return a list of issues."""
942
946
  issues: list[SemanticIssue] = []
@@ -978,6 +982,12 @@ class SemanticAnalyzer:
978
982
  issues.extend(self._check_connector_ends_compatible(model))
979
983
  issues.extend(self._check_multiplicity_bounds_valid(model))
980
984
 
985
+ # Step 6: Stylistic checks (warnings, not errors)
986
+ if style_checks:
987
+ issues.extend(self._check_naming_conventions(model))
988
+ if filename is not None:
989
+ issues.extend(self._check_file_package_match(model, filename))
990
+
981
991
  return issues
982
992
 
983
993
  @staticmethod
@@ -1912,6 +1922,152 @@ class SemanticAnalyzer:
1912
1922
  # FeatureReferenceExpression (variable) - can't compare
1913
1923
  return None
1914
1924
 
1925
+ # -----------------------------------------------------------------------
1926
+ # Stylistic Checks (warnings, not errors)
1927
+ # -----------------------------------------------------------------------
1928
+
1929
+ def _check_naming_conventions(self, model: Any) -> list[SemanticIssue]:
1930
+ """Check naming conventions across the model.
1931
+
1932
+ Conventions:
1933
+ - Definitions (defs) should be CamelCase/PascalCase
1934
+ - Usages should be camelCase
1935
+ - Packages should be PascalCase
1936
+ - Attributes should be camelCase
1937
+ - Ports should be camelCase
1938
+ """
1939
+ issues: list[SemanticIssue] = []
1940
+ self._traverse_for_naming(model, [], issues)
1941
+ return issues
1942
+
1943
+ def _traverse_for_naming(
1944
+ self, element: Any, path: list[str], issues: list[SemanticIssue]
1945
+ ) -> None:
1946
+ """Recursively traverse and check naming conventions."""
1947
+ name = getattr(element, "name", None)
1948
+ if name is None or len(name) > 30: # Skip UUIDs
1949
+ children = getattr(element, "children", [])
1950
+ for child in children:
1951
+ self._traverse_for_naming(child, path, issues)
1952
+ return
1953
+
1954
+ is_def = getattr(element, "is_definition", False)
1955
+ sysml_type = getattr(element, "sysml_type", "")
1956
+
1957
+ if isinstance(element, Package):
1958
+ # Packages should be PascalCase
1959
+ if not self._is_pascal_case(name):
1960
+ issues.append(SemanticIssue(
1961
+ severity="warning",
1962
+ code="NAMING_CONVENTION",
1963
+ message=f"Package '{name}' should be PascalCase (e.g., '{self._to_pascal_case(name)}')",
1964
+ element=element,
1965
+ reference=name,
1966
+ ))
1967
+ elif is_def:
1968
+ # Definitions should be PascalCase
1969
+ if not self._is_pascal_case(name):
1970
+ issues.append(SemanticIssue(
1971
+ severity="warning",
1972
+ code="NAMING_CONVENTION",
1973
+ message=f"Definition '{name}' should be PascalCase (e.g., '{self._to_pascal_case(name)}')",
1974
+ element=element,
1975
+ reference=name,
1976
+ ))
1977
+ elif sysml_type == "attribute":
1978
+ # Attributes should be camelCase
1979
+ if not self._is_camel_case(name):
1980
+ issues.append(SemanticIssue(
1981
+ severity="warning",
1982
+ code="NAMING_CONVENTION",
1983
+ message=f"Attribute '{name}' should be camelCase (e.g., '{self._to_camel_case(name)}')",
1984
+ element=element,
1985
+ reference=name,
1986
+ ))
1987
+ elif sysml_type == "port":
1988
+ # Ports should be camelCase
1989
+ if not self._is_camel_case(name):
1990
+ issues.append(SemanticIssue(
1991
+ severity="warning",
1992
+ code="NAMING_CONVENTION",
1993
+ message=f"Port '{name}' should be camelCase (e.g., '{self._to_camel_case(name)}')",
1994
+ element=element,
1995
+ reference=name,
1996
+ ))
1997
+ else:
1998
+ # Other usages should be camelCase
1999
+ if not self._is_camel_case(name):
2000
+ issues.append(SemanticIssue(
2001
+ severity="warning",
2002
+ code="NAMING_CONVENTION",
2003
+ message=f"Usage '{name}' should be camelCase (e.g., '{self._to_camel_case(name)}')",
2004
+ element=element,
2005
+ reference=name,
2006
+ ))
2007
+
2008
+ children = getattr(element, "children", [])
2009
+ for child in children:
2010
+ self._traverse_for_naming(child, path + [name], issues)
2011
+
2012
+ @staticmethod
2013
+ def _is_pascal_case(name: str) -> bool:
2014
+ """Check if a name is PascalCase (starts with uppercase, no leading underscore)."""
2015
+ if not name:
2016
+ return False
2017
+ return name[0].isupper() and not name.startswith("_")
2018
+
2019
+ @staticmethod
2020
+ def _is_camel_case(name: str) -> bool:
2021
+ """Check if a name is camelCase (starts with lowercase, no leading underscore)."""
2022
+ if not name:
2023
+ return False
2024
+ return name[0].islower() and not name.startswith("_")
2025
+
2026
+ @staticmethod
2027
+ def _to_pascal_case(name: str) -> str:
2028
+ """Convert a name to PascalCase suggestion."""
2029
+ # Simple conversion: capitalize first letter
2030
+ if not name:
2031
+ return name
2032
+ return name[0].upper() + name[1:]
2033
+
2034
+ @staticmethod
2035
+ def _to_camel_case(name: str) -> str:
2036
+ """Convert a name to camelCase suggestion."""
2037
+ # Simple conversion: lowercase first letter
2038
+ if not name:
2039
+ return name
2040
+ return name[0].lower() + name[1:]
2041
+
2042
+ def _check_file_package_match(
2043
+ self, model: Any, filename: str | Path
2044
+ ) -> list[SemanticIssue]:
2045
+ """Check that the top-level package name matches the filename.
2046
+
2047
+ Per SysML v2 convention, a file named ``MyPackage.sysml`` should
2048
+ contain a top-level package named ``MyPackage``.
2049
+ """
2050
+ issues: list[SemanticIssue] = []
2051
+ filename = Path(filename)
2052
+ expected_name = filename.stem # e.g., "MyPackage" from "MyPackage.sysml"
2053
+
2054
+ # Find top-level packages
2055
+ for child in getattr(model, "children", []):
2056
+ if isinstance(child, Package):
2057
+ pkg_name = getattr(child, "name", None)
2058
+ if pkg_name is not None and pkg_name != expected_name:
2059
+ issues.append(SemanticIssue(
2060
+ severity="warning",
2061
+ code="FILE_PACKAGE_MISMATCH",
2062
+ message=f"Top-level package '{pkg_name}' does not match filename '{filename.name}'. "
2063
+ f"Expected package name '{expected_name}'.",
2064
+ element=child,
2065
+ reference=pkg_name,
2066
+ ))
2067
+
2068
+ return issues
2069
+
2070
+
1915
2071
  def _find_child_scope(self, root: SymbolTable, path: list[str]) -> Optional[SymbolTable]:
1916
2072
  """Find the symbol table scope for a qualified path from the root."""
1917
2073
  current = root
@@ -1931,6 +2087,8 @@ def analyze(
1931
2087
  model: Any,
1932
2088
  *,
1933
2089
  library: Path | Sequence[Path] | str | Sequence[str] | None = None,
2090
+ filename: str | Path | None = None,
2091
+ style_checks: bool = True,
1934
2092
  ) -> list[SemanticIssue]:
1935
2093
  """Run semantic analysis on *model* and return issues.
1936
2094
 
@@ -1941,10 +2099,17 @@ def analyze(
1941
2099
  library : Path, str, sequence, or None, optional
1942
2100
  Path(s) to library directories for resolving standard library symbols.
1943
2101
  Defaults to the bundled library shipped with sysmlpy.
2102
+ filename : str or Path, optional
2103
+ Source filename for file-package name matching checks.
2104
+ style_checks : bool
2105
+ If True (default), run stylistic checks (naming conventions,
2106
+ file-package matching). Set to False to skip warnings.
1944
2107
 
1945
2108
  Returns
1946
2109
  -------
1947
2110
  list[SemanticIssue]
1948
2111
  List of semantic issues found.
1949
2112
  """
1950
- return SemanticAnalyzer().analyze(model, library=library)
2113
+ return SemanticAnalyzer().analyze(
2114
+ model, library=library, filename=filename, style_checks=style_checks
2115
+ )
File without changes
File without changes
File without changes