-
Notifications
You must be signed in to change notification settings - Fork 60
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
Add an static_assert for the GenericParameters and remove the EnableIf #676
Changes from 1 commit
f411e01
7a22860
7593bd6
103b1ac
8c20100
54c682d
e899f11
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -264,7 +264,7 @@ def put_parameter(self, key, value, as_type=None): | |
cpp_types = _get_cpp_types(as_type) | ||
if len(cpp_types) == 0: | ||
raise ValueError(f"Cannot put a parameter of type {as_type} into a Frame") | ||
self._frame.putParameter[cpp_types[0]](key, value) | ||
self._frame.putParameter[cpp_types[0][0]](key, value) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is this change necessary? Was this a pre-existing bug? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
# If we have a single integer, a std::string overload kicks in with higher | ||
# priority than the template for some reason. So we explicitly select the | ||
|
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 think
GenericParameters
is too much of an implementation detail here, especially if users get this message from their algorithms, they will not know what it is and where to look. I would change this message at least for the cases inFrame
. Not sure if we should also put the supported types in, because this message is likely to become outdated if we have to add more types.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.
For the same reason
T
doesn't tell you much where to look or what to do. But showing the type isn't completely trivial 🤷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.
We need to have documentation where we state the supported datatypes (not sure if we already have). I think we could also drop the
T
from the message. In the end the compiler error will contain the type they tried to use in some form.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.
The docs mention int, float, strong and vectors of those https://github.com/AIDASoft/podio/blob/master/doc/frame.md#usage-for-parameters
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.
Ah right, I knew it was somewhere :D. But it's missing a
double
🙈