Add helpers for array type, precision, and quantity conversion#2223
Merged
sethrj merged 45 commits intoceleritas-project:developfrom Mar 10, 2026
Merged
Add helpers for array type, precision, and quantity conversion#2223sethrj merged 45 commits intoceleritas-project:developfrom
sethrj merged 45 commits intoceleritas-project:developfrom
Conversation
This reverts commit 878e4c8.
Member
Author
|
Once #2278 is in I'll pull in develop and update new usage as discussed. |
- Fix template parameter deduction in convert_from_geant for G4ThreeVector - Use deprecated overloads for C-array inputs and constexpr contexts - Update convert_to_geant calls to use specialized overloads where needed - Remove unused includes and variables Assisted-by: GitHub Copilot (Claude Sonnet 4.5)
This reverts commit 3906ed2.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 65 out of 65 changed files in this pull request and generated 7 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
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.
The existing
convert_{to/from}_geantfunctions are rather confusing because they do three things:To avoid confusion and errors i.e. the ones I originally thought were present in #2218, this defines new helper functions:
to_arrayandto_g4vectorfor type conversionarray_casttostatic_array_castto clarify what exactly is being cast (similar to the standard library)make_array_quantityand related function for creatingArray<Quantity<...>>that allows more expressive and type-safe conversion.