Repository navigation
Add converters between C# and Python - #2
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
NOTE: Depends on
Issues addressed by this PR
This pull request introduces several new utilities and enhancements to the Python schema generation tooling, focusing on improved default value formatting, cycle detection in type references, and manifest generation for rendered types. The changes add new files and functionality to support more robust and maintainable code generation.
New utilities and enhancements:
Cycle detection:
CycleDetectorutility (.ci/generation/PythonSchemaGeneration.Core/CycleDetector.cs) to identify strongly connected components (cycles) in type reference graphs using Tarjan's algorithm, which helps manage type imports during code generation.Default value formatting:
DefaultFormatterclass (.ci/generation/PythonSchemaGeneration.Core/Emission/DefaultFormatter.cs) to convert C# property default values into appropriate Python source code, handling primitives, collections, enums, special types (e.g.,Guid,DateTime,Color), and reporting when defaults cannot be represented.Manifest generation:
ManifestWriterutility (.ci/generation/PythonSchemaGeneration.Core/Emission/ManifestWriter.cs) to serialize rendered types into a language-neutral JSON manifest, including detailed type, property, and enum metadata for testing and cross-language comparison.Build configuration:
References management:
.ci/BHoMReferences.propsto centralize and standardize the reference path for BHoM assemblies used during builds.Test files
Changelog
Additional comments