Skip to content
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

Allow edmodule.clone(pset) for PSet to override parameters #33673

Merged
merged 1 commit into from May 11, 2021

Conversation

makortel
Copy link
Contributor

PR description:

This PR allows edmodule.clone(pset) to work in the python configuration (previously it could lead to "duplicate parameter" errors if pset had parameters already defined in edmodule). Motivation to allow it is that clone() is (similar to) a constructor call with defaults taken from the cloned-from module. Semantics is that the parameters in pset override those in edmodule. Passing multiple PSets along edmodule.clone(pset1, pset2) is allowed as long as pset1 and pset2 have distinct parameters, similar to EDModule constructors.

Original discussion was in #33354 (comment).

Resolves cms-sw/framework-team#124

PR validation:

Framework unit tests pass.

@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-33673/22574

  • This PR adds an extra 20KB to repository

@cmsbuild
Copy link
Contributor

A new Pull Request was created by @makortel (Matti Kortelainen) for master.

It involves the following packages:

FWCore/ParameterSet

@makortel, @smuzaffar, @cmsbuild, @Dr15Jones can you please review it and eventually sign? Thanks.
@wddgit this is something you requested to watch as well.
@silviodonato, @dpiparo, @qliphy you are the release manager for this.

cms-bot commands are listed here

@makortel
Copy link
Contributor Author

@cmsbuild, please test

@makortel
Copy link
Contributor Author

@perrotta Here is what we discussed in #33354 (comment) (sorry it took a bit more than "few days in wall clock time")

@Dr15Jones
Copy link
Contributor

As a side note, do you think we should support unnamed dict as inputs as well?

@makortel
Copy link
Contributor Author

As a side note, do you think we should support unnamed dict as inputs as well?

We kind of do already with edmodule.clone(**dict), although that has a limit of one dict. At this point I would not proceed for direct edmodule.clone(dict), but this is not a strong feeling.

@cmsbuild
Copy link
Contributor

+1

Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-040d54/14963/summary.html
COMMIT: 880d5d4
CMSSW: CMSSW_12_0_X_2021-05-10-1100/slc7_amd64_gcc900
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week0/cms-sw/cmssw/33673/14963/install.sh to create a dev area with all the needed externals and cmssw changes.

Comparison Summary

Summary:

  • No significant changes to the logs found
  • Reco comparison results: 0 differences found in the comparisons
  • DQMHistoTests: Total files compared: 37
  • DQMHistoTests: Total histograms compared: 2663174
  • DQMHistoTests: Total failures: 1
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 2663151
  • DQMHistoTests: Total skipped: 22
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 36 files compared)
  • Checked 155 log files, 37 edm output root files, 37 DQM output files
  • TriggerResults: no differences found

@perrotta
Copy link
Contributor

@perrotta Here is what we discussed in #33354 (comment) (sorry it took a bit more than "few days in wall clock time")

Thank you @makortel

@makortel makortel changed the title Allow edmodule.clone(pset) for pset to override parameters Allow edmodule.clone(pset) for PSet to override parameters May 11, 2021
@makortel
Copy link
Contributor Author

+1

@cmsbuild
Copy link
Contributor

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. @silviodonato, @dpiparo, @qliphy (and backports should be raised in the release meeting by the corresponding L2)

@qliphy
Copy link
Contributor

qliphy commented May 11, 2021

+1

@cmsbuild cmsbuild merged commit 6247472 into cms-sw:master May 11, 2021
@makortel makortel deleted the clonePSet branch May 11, 2021 13:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

EDModule.clone(pset) raises exception on duplicate parameters
5 participants