-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
drop type specs in RecoTracker/{DeDx,FinalTrackSelectors} #30556
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
Oops, something went wrong.
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.
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.
this still works.
I'd think that a nameless tuple like could still work for PSet, like
[ ( tLists=cms.vint32(1), pQual=cms.bool(True) ]
, but this is apparently not supported.@makortel do you think it would be practical to add?
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 don't think
( tLists=cms.vint32(1), pQual=cms.bool(True) )
would be legal syntaxSo using a keyword argument would require
dict(foo=2)
, which is already used for modifying an existing PSet.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.
dict does not really apply here because full contents of
setsToMerge
are replaced (we are not modifying just one of the elements of this array.Just to reiterate, my question was, if we have support for VInputTag to be initialized from
[ "a", b", ("c", "d") ]
, can we also get a VPSet to be initialized without listing the element type?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.
With
VInputTag
a compact (maybe event too compact) is possible because the meaning of each element of the sequence of strings is known by its position in the sequence. InPSet
the element keys are the parameter names, sodict
would be a natural "shortcut". But we already usedict
for something else, and I'd think anything along("tlists", cms.vint32(1), "pQual", cms.bool(True))
would be (much) less clear than just using thecms.PSet
.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.
sorry, I meant
instead of
cms.VPSet( cms.PSet( tLists=cms.vint32(1), pQual=cms.bool(True) ) )
to be able to say
[ ( tLists=cms.vint32(1), pQual=cms.bool(True) ) ]
this is not serving the full goal of "drop type specs", but it would at least allow to insert elements to a container of a known type (vector of cms.PSet) without need to explicitly specify the type of the element (cms.PSet)
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.
how about
[ { 'tLists' : cms.vint32(1), 'pQual' : cms.bool(True) } ]
?it would be a valid syntax, but it comes out with
raise TypeError("wrong type being extended to container "+self._labelIfAny())
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
{ 'tLists' : cms.vint32(1), 'pQual' : cms.bool(True) }
is a dictionary equivalent todict(tLists = cms.vint32(1), pQual = cms.bool(True))
.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.
OK, syntactically , this
dict(
may be more transparent.I guess from the above the point is that
dict
doesn't do the right thing here (yet?).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.
OTOH, the difference to type
cms.PSet
vsdict(
is rather minor; IIRC this is also the only vector type that needs this. So, we may just live with it for now.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 already use
dict()
to modify an existing PSet. I think using it to denote new PSet in one context would be confusing.