cms-sw / cmssw

CMS Offline Software
http://cms-sw.github.io/
Apache License 2.0
1.09k stars 4.33k forks source link

Prevent adding arbitrary types to Schedule #28179

Open makortel opened 5 years ago

makortel commented 5 years ago

It is possible to add e.g. integer to a cms.Schedule by

import FWCore.ParameterSet.Config as cms
p = cms.Process("foo") 
p.a = cms.EDProducer("Foo") 
p.p = cms.Path(p.a)
p.s = cms.Schedule(p.p)
p.s += [3]

after which the Schedule is in a weird state

print(p.s)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File ".../CMSSW_11_0_0_pre10/python/FWCore/ParameterSet/SequenceTypes.py", line 693, in __str__
    return self.dumpPython() 
  File  ".../CMSSW_11_0_0_pre10/python/FWCore/ParameterSet/SequenceTypes.py", line 669, in dumpPython
    pathNames = ['process.'+p.label_() for p in self]
AttributeError: 'int' object has no attribute 'label_'

We should find a way to prevent adding unsupported objects into Schedule (or FWCore.ParameterSet.Mixins._ValidatingListBase).

cmsbuild commented 5 years ago

A new Issue was created by @makortel Matti Kortelainen.

@davidlange6, @Dr15Jones, @smuzaffar, @fabiocos, @kpedro88 can you please review it and eventually sign/assign? Thanks.

cms-bot commands are listed here

makortel commented 4 years ago

assign core

cmsbuild commented 4 years ago

New categories assigned: core

@Dr15Jones,@smuzaffar,@makortel you have been requested to review this Pull request/Issue and eventually sign? Thanks