-
Notifications
You must be signed in to change notification settings - Fork 178
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Track parameters json converter #3724
Merged
paulgessinger
merged 14 commits into
acts-project:main
from
ssdetlab:track-parameters-json-converter
Oct 18, 2024
Merged
feat: Track parameters json converter #3724
paulgessinger
merged 14 commits into
acts-project:main
from
ssdetlab:track-parameters-json-converter
Oct 18, 2024
Conversation
This file contains 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
paulgessinger
approved these changes
Oct 17, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this! I agree that we should try to do as much as possible with the conventional pattern used by nlohmann::json
.
|
Rosie-Hasan
pushed a commit
to Rosie-Hasan/acts
that referenced
this pull request
Nov 13, 2024
Adding json converter for the different track parameters types. The converter follows the pattern outlined in [nlohmann::json documentation](https://json.nlohmann.me/features/arbitrary_types/#how-can-i-use-get-for-non-default-constructiblenon-copyable-types), rather than the one present in the codebase due to the a) track parameters types not being default constructible, b) use cases connected to the grid-of-of-track-parameters conversion. To keep the converter to one implementation of the json serializer, the liberty was taken to add one more constructor to the `FreeTrackParameters`. The `GridJsonConverter` code was modified a bit to be able to handle non-default constructible types. Header for the track parameters json converter in `GridJsonConverter.hpp` is required for the grid-of-of-track-parameters conversion to be possible by the `nlohmann::json` standard. As a side note, all the types in the framework that have `to_json`/`from_json` overloaded can have grid-of-type json conversion implemented for free, if the respective headers are added to the `GridJsonConverter.hpp`. --------- Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Breaks Athena build
This PR breaks the Athena build
Component - Core
Affects the Core module
Component - Plugins
Affects one or more Plugins
Event Data Model
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.
Adding json converter for the different track parameters types. The converter follows the pattern outlined in nlohmann::json documentation, rather than the one present in the codebase due to the a) track parameters types not being default constructible, b) use cases connected to the grid-of-of-track-parameters conversion.
To keep the converter to one implementation of the json serializer, the liberty was taken to add one more constructor to the
FreeTrackParameters
. TheGridJsonConverter
code was modified a bit to be able to handle non-default constructible types.Header for the track parameters json converter in
GridJsonConverter.hpp
is required for the grid-of-of-track-parameters conversion to be possible by thenlohmann::json
standard. As a side note, all the types in the framework that haveto_json
/from_json
overloaded can have grid-of-type json conversion implemented for free, if the respective headers are added to theGridJsonConverter.hpp
.