-
Notifications
You must be signed in to change notification settings - Fork 59
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
improve fillDescriptions
section in cms coding rules
#118
Conversation
I would go further and simply require that all modules have a working |
In a sense the code rules already say that:
|
I think there is a difference. The current wording allows a If would be serious about requiring every module to have a |
I agree that this would be great. On the other hand that would not be sufficient: all the other conditions still apply. |
We can in any case discuss about this in Core Software meeting tomorrow (although I would not make conclusions yet). |
is there any showstopper in merging this as is? |
To begin with, we could use a similar approach to the coding rules: we keep the current code as it is, but we require all new modules to have a proper In addition, changing all By the way, for the |
what happens when there is nothing added to the descriptions (e.g. in the plugins that have been written via the skeleton and get the boiler-plate: //The following says we do not know what parameters are allowed so do no validation
// Please change this to state exactly what you do use, even if it is no parameters
edm::ParameterSetDescription desc;
desc.setUnknown();
descriptions.addDefault(desc); ? |
I'd expect replacing the fooModule = cms.EDProducer('FooModule') |
I just checked and it contains actually: import FWCore.ParameterSet.Config as cms
fooModule = cms.EDProducer('FooModule',
mightGet = cms.optional.untracked.vstring
) |
In absence of wider discussion I would organize the content a bit differently, e.g. along 14. The `_cfi` file should be left to be generated automatically with the `fillDescriptions()`. When Modifier customizations are needed, the auto-generated label should have e.g. "Default" postfix and be imported+cloned to the desired name.
Whenever the plugin needs to be included in a HLT configuration, it is mandatory (for confDB parsing purposes) that a default value is provided for all the configurable parameters. In general it is preferable to use `addWithDefaultLabel()`, such that the auto-generated cfi file bears the same name as the plugin, starting with a lower case character. and leave out the comment about |
Ah right, I forgot the |
we certainly do want to discourage it for HLT purposes. |
No, but about 150 cases seem to have a non-empty description (at least, they do do not call |
We could. That would likely leave the enforcement to the PR reviewers (which means likely something will slip through).
True. I was thinking more the cases that don't implement a meaningful |
I'd be fine if the comment on |
I opened cms-sw/cmssw#44372 to play with this. |
4652097
to
c449710
Compare
this is implemented in the last push. |
Hmm, I am not so keen on this automatic replacement/change: ConfDB parsing gives precedence to the generated cfi files in ../cfipython, but if now with this change there are newly generated cfi files which are only rudimentary/incomplete/partially complete (compared to explicit python files in ../python), because fillDescriptions is incomplete/permissive, then ConfDb parsing will pick up the wrong templates. For existing usage, I am afraid this would have to be looked at case by case. For new plugins, however, it could be enforced. |
Indeed, let's do that. But first let's see if change breaks something else. |
for the record (and for lack of a better place where to put it), here's the list of all the List of modules
|
c449710
to
1df4d2c
Compare
1df4d2c
to
946a278
Compare
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'm fine with merging this PR.
@Martin-Grunewald @fwyzard do you agree with the current wording as well? |
It's ok with me! |
given the consensus above can this PR be merged? |
@makortel @smuzaffar |
ok, merging it now |
I disagree with this idea, especially since we now have constructors in python for each module that uses a fillDescription (see cms-sw/cmssw#43955 ) The As for the ConfDB problem, I have a [RFC] PR which demonstrates how we can generated dummy CFI files based on the new constructor files which has the added bonus of injecting dummy values for types ConfDB can't handle. cms-sw/cmssw#44424. In this way we do not inject dummy default values into the C++ code which could lead to problems if those values are forgotten to be overridden in the python code. [Now if you forget to override them we have a failure during python processing rather than failure after we've run the job and someone notices the output of the job is wrong]. In this way we only generate the dummy cfi files temporarily when ConfDB wants to be updated and we do not keep those around (as the |
This is simply wrong. |
I don't see why - in fact, everything you wrote seems completely orthogonal with respect to writing a cfi file or not. |
As the designer of the system, I can unequivocally state that was always the design intent. The reason is as follows: Say you have a generated cfi.py (e.g. foo_cfi.py) which creates a description incompatible with the default (regardless on if the default is from from .foo_cfi import foo
bar = foo.clone() as the label This inconsistency in validation would be a very bad behavior. Hence why we want to move to a system where the default must be able to validate all autogenerated cfis. |
This eliminates the possibility of having different, incompatible configurations - which the current system supports. |
I'm afraid I don't see how. Please elaborate? |
As you wrote, the current system supports using a non-default validation for a specific label. So, IIUC, you plan to change the design of the system from "support different configurations with different validators" to "support different configurations with a single validator". |
Ah, I was confused by what the
Nearly so. We still want to be able to allow Now for the vast majority of modules, this point is mote as they declare 1 and only 1 entry to |
This might help in getting developers producing code that results in configurations parsable in confDB.
@cms-sw/hlt-l2 @fwyzard @missirol FYI