-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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 replacement of OutputModule
s in HLT ConfDB
utilities
#39177
Conversation
), | ||
\g<8> | ||
""", self.data, 0, re.DOTALL) | ||
|
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 used regular strings as it seemed more readable. It can be reverted to raw strings if this is preferred.
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.
Raw strings tend to be easier to use with regexp because of the escape sequences, but if those are not a problem, regular strings are fine.
Note that IIRC we can also have multi-line raw strings, e.g.
r"""
...
"""
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.
Just a wish, not even a feature request... could you look into reusing the same compression algorithm and level also in the root output ?
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-39177/31770
|
A new Pull Request was created by @missirol (Marino Missiroli) for master. It involves the following packages:
@cmsbuild, @missirol, @Martin-Grunewald can you please review it and eventually sign? Thanks. cms-bot commands are listed here |
please test After more checks, I didn't find issues, so I'll start moving forward. |
+1 Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-b9f2e9/27093/summary.html Comparison SummarySummary:
|
+hlt |
This pull request is fully signed and it will be integrated in one of the next master IBs (tests are also fine). This pull request will now be reviewed by the release team before it's merged. @perrotta, @dpiparo, @qliphy, @rappoccio (and backports should be raised in the release meeting by the corresponding L2) |
+1 |
self.data = re.sub("""\ | ||
\\b(process\.)?hltOutput(\w+) *= *cms\.OutputModule\( *"(EvFOutputModule|GlobalEvFOutputModule)" *, | ||
use_compression = cms.untracked.bool\( (True|False) \), | ||
compression_algorithm = cms.untracked.string\( "(.+?)" \), |
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'd change "
to ['"]
since '
is a valid delimiter for strings
@fwyzard , thanks for having a look. Trying to address your comments at once, we could do the following: diff --git a/HLTrigger/Configuration/python/Tools/confdb.py b/HLTrigger/Configuration/python/Tools/confdb.py
index 18c5db0610b..d8ef59d7da5 100644
--- a/HLTrigger/Configuration/python/Tools/confdb.py
+++ b/HLTrigger/Configuration/python/Tools/confdb.py
@@ -479,16 +479,18 @@ from HLTrigger.Configuration.CustomConfigs import L1REPACK
)
self.data = re.sub("""\
-\\b(process\.)?hltOutput(\w+) *= *cms\.OutputModule\( *"(EvFOutputModule|GlobalEvFOutputModule)" *,
+\\b(process\.)?hltOutput(\w+) *= *cms\.OutputModule\( *['"](EvFOutputModule|GlobalEvFOutputModule)['"] *,
use_compression = cms.untracked.bool\( (True|False) \),
- compression_algorithm = cms.untracked.string\( "(.+?)" \),
+ compression_algorithm = cms.untracked.string\( ['"](.+?)['"] \),
compression_level = cms.untracked.int32\( (-?\d+) \),
lumiSection_interval = cms.untracked.int32\( (-?\d+) \),
(.+?),
- psetMap = cms.untracked.InputTag\( "hltPSetMap" \)
+ psetMap = cms.untracked.InputTag\( ['"]hltPSetMap['"] \)
""","""\
-\g<1>hltOutput\g<2> = cms.OutputModule( "PoolOutputModule",
+%(process)s.hltOutput\g<2> = cms.OutputModule( "PoolOutputModule",
fileName = cms.untracked.string( "output\g<2>.root" ),
+ compressionAlgorithm = cms.untracked.string( "\g<5>" ),
+ compressionLevel = cms.untracked.int32( \g<6> ),
fastCloning = cms.untracked.bool( False ),
dataset = cms.untracked.PSet(
filterName = cms.untracked.string( "" ), A couple of notes:
[*] IIrc, |
Unless there are other comments, I will make PRs for |
Sorry, why would you use |
I would use
|
Ah ok! |
PR description:
This PR suggests a small improvement in how HLT utilities customise for offline usage the
OutputModule
s defined inConfDB
configurations. The current implementation assumes certain values for module parameters likecompression_algorithm
(and others), and this is not necessary.Merely technical. Intended to be fully backward compatible. No changes expected in outputs of PR tests.
Tagging @fwyzard and @Sam-Harper to review.
PR validation:
Manual tests on a limited number of HLT menus.
If this PR is a backport, please specify the original PR and why you need to backport that PR. If this PR will be backported, please specify to which release cycle the backport is meant for:
CMSSW_12_4_X