Use Jinja templates in csharp sourcegen#1785
Merged
speth merged 4 commits intoCantera:mainfrom Nov 2, 2024
Merged
Conversation
dc554f5 to
0a9aa24
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1785 +/- ##
==========================================
+ Coverage 73.23% 73.26% +0.02%
==========================================
Files 381 383 +2
Lines 54375 54620 +245
Branches 9251 9099 -152
==========================================
+ Hits 39823 40016 +193
- Misses 11580 11601 +21
- Partials 2972 3003 +31 ☔ View full report in Codecov by Sentry. |
cb0c58b to
036a225
Compare
This comment was marked as outdated.
This comment was marked as outdated.
Member
Author
|
While this PR is not essential for 3.1, it is nevertheless ready for a review. Edit: I marked it as 'deferred' in the release plan for 3.1. PS: as release of 3.1 is pushed back, I am re-adding to release plan. |
036a225 to
16e95db
Compare
speth
requested changes
Nov 1, 2024
interfaces/sourcegen/sourcegen/csharp/_CSharpSourceGenerator.py
Outdated
Show resolved
Hide resolved
16e95db to
2f97fbc
Compare
Member
Author
|
Thanks, @speth! I took care of all your suggestions. |
3f20c84 to
3043536
Compare
3043536 to
853af77
Compare
speth
approved these changes
Nov 2, 2024
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.
Changes proposed in this pull request
This PR is a preamble to a potential solution for Cantera/enhancements#39 , which replaces f-string based code blocks used for the .NET interface by corresponding Jinja templates. In addition, it adds logging as well as service methods to data classes. The PR anticipates/backports some changes envisioned by a development branch that targets an autogenerated version of CLib (ischoegl:sourcegen-doxygen-comments) and should reduce the size of upcoming PRs.
The template approach makes for more readable code, and should both simplify future enhancements and help with long-term maintenance of various generated API's.
Illustration
C# code blocks are defined as templates that are added in a single
templates.yamlfile, e.g.Checklist
scons build&scons test) and unit tests address code coverage