cms-sw / cmssw

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

cms.Process.process cannot set the process name #29507

Open fwyzard opened 4 years ago

fwyzard commented 4 years ago

The python cms.Process object defines the property process to get and set the process name.

Getting the name works:

>>> process = cms.Process('TEST')
>>> process.process
'TEST'

Setting it doesn't work:

>>> process.process = 'TEST2'
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/cvmfs/cms.cern.ch/slc7_amd64_gcc820/cms/cmssw/CMSSW_11_1_0_pre6/python/FWCore/ParameterSet/Config.py", line 392, in __setattr__
    +"an instance of "+str(type(value))+" will not work - requested label is "+name)
TypeError: can only assign labels to an object that inherits from '_ConfigureComponent'
an instance of <type 'str'> will not work - requested label is process

Setting the name directly or via the setter does work:

>>> process._Process__name = 'TEST3'
>>> process.process
'TEST3'
>>> process.setName_('TEST4')
>>> process.process
'TEST4'
fwyzard 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

cmsbuild commented 4 years ago

A new Issue was created by @fwyzard Andrea Bocci.

@Dr15Jones, @silviodonato, @dpiparo, @smuzaffar, @makortel can you please review it and eventually sign/assign? Thanks.

cms-bot commands are listed here