cms-sw / cmssw

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

type information is lost or obscured for proxy types (like cms.required) on assignment without type #30085

Open slava77 opened 4 years ago

slava77 commented 4 years ago

I was debugging a missing parameter replace in #30071 , which implements a fillDescriptions without specifying default values, an InputTag in this case.

This case corresponds to the default config file containing aPar = cms.required.InputTag. I expect that a normal behavior should follow after aPar = "y" is done in a clone from this default. However, in this case this x does not have a type of cms.InputTag, which leads to a failure to auto-replace it with FWCore/ParameterSet/python/MassReplace.py, which relies on the actual type info via isinstance(aPar, cms.InputTag)

I made a partial attempt for a fix for the specific use case in MassReplace https://github.com/cms-sw/cmssw/commit/f22ce098dafa18b271b8528fdbdea576f548e6d9 but this looks a bit ugly and would not cover other use cases.

There are also solutions to actually set a dummy value in fillDescriptions or to specify the type when cloning, but these are not desired for other reasons.

A cleaner solution where the required parameter can show its underlying type would be better.

cmsbuild commented 4 years ago

A new Issue was created by @slava77 Slava Krutelyov.

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

cms-bot commands are listed here

slava77 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

makortel commented 4 years ago

@Dr15Jones Could you take a look?