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

Remove positional arguments from PSet.clone() #23566

Merged
merged 1 commit into from Jun 13, 2018

Conversation

makortel
Copy link
Contributor

@makortel makortel commented Jun 12, 2018

There was a bug in #23363 (already fixed in the PR) using a pattern FooPSet.clone(dict(foo = dict(...))) to clone a PSet. Because of the leading dict the clone was not modified, and it took a while to realize the cause. A simple way to detect this kind of bug would be to forbid positional arguments to PSet.clone() (as in this PR). I am not aware of any use cases for them (and e.g. Modifier.toModify() does not allow positional arguments, except for customizing with a function).

The error message from python is

TypeError: clone() takes exactly 1 argument (2 given)

which may be a bit difficult to interpret. Alternatively we could keep the positional arguments and raise our own Exception with an easier-to-understand message if any positional arguments are given.

Tested in CMSSW_10_2_X_2018-06-10-2300, no changes expected.

@Dr15Jones

I don't know any use case for positional arguments for PSet.clone().
Allowing them may lead to difficult-to-detect bugs like
PSet.clone(dict(foo = ...)) (which happened).
@cmsbuild
Copy link
Contributor

The code-checks are being triggered in jenkins.

@cmsbuild
Copy link
Contributor

@cmsbuild
Copy link
Contributor

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

It involves the following packages:

FWCore/ParameterSet

@cmsbuild, @smuzaffar, @Dr15Jones can you please review it and eventually sign? Thanks.
@Martin-Grunewald, @wddgit this is something you requested to watch as well.
@davidlange6, @slava77, @fabiocos you are the release manager for this.

cms-bot commands are listed here

@makortel
Copy link
Contributor Author

@cmsbuild, please test

@cmsbuild
Copy link
Contributor

cmsbuild commented Jun 12, 2018

The tests are being triggered in jenkins.
https://cmssdt.cern.ch/jenkins/job/ib-any-integration/28641/console Started: 2018/06/12 17:26

@cmsbuild
Copy link
Contributor

@cmsbuild
Copy link
Contributor

Comparison job queued.

@Dr15Jones
Copy link
Contributor

+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. @davidlange6, @slava77, @smuzaffar, @fabiocos (and backports should be raised in the release meeting by the corresponding L2)

@cmsbuild
Copy link
Contributor

Comparison is ready
https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-23566/28641/summary.html

Comparison Summary:

  • No significant changes to the logs found
  • Reco comparison results: 0 differences found in the comparisons
  • DQMHistoTests: Total files compared: 31
  • DQMHistoTests: Total histograms compared: 2902004
  • DQMHistoTests: Total failures: 1
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 2901813
  • DQMHistoTests: Total skipped: 190
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 30 files compared)
  • Checked 128 log files, 14 edm output root files, 31 DQM output files

@fabiocos
Copy link
Contributor

+1

@cmsbuild cmsbuild merged commit b6bbb7e into cms-sw:master Jun 13, 2018
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.

None yet

4 participants