Project

General

Profile

Bug #25492

ParameterSet::has_key not correctly returning for nested keys

Added by Etienne Chardonnet 2 months ago. Updated about 1 month ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
Start date:
02/09/2021
Due date:
% Done:

100%

Estimated time:
Spent time:
Duration:

Description

DUNE's PDSP and PDSP splitG4 CI tests enable modules that use the idiom:

fhicl::ParameterSet const ps = from_somewhere();
if (ps.has_key("source.firstEvent")) {
  // ...
}

For cases when the parameter set has no "source" key, the above code results in an exception throw. The workaround is to write:

fhicl::ParameterSet const ps = from_somewhere();
if (ps.has_key("source") and ps.has_key("source.firstEvent")) {
  // ...
}

which is undesirable.

History

#1 Updated by Kyle Knoepfel 2 months ago

  • Description updated (diff)
  • Subject changed from pdsp and pdsp_splitG4 CI gen stages asking for a source file to ParameterSet::has_key not correctly returning for nested keys

#2 Updated by Kyle Knoepfel 2 months ago

  • % Done changed from 0 to 100
  • Target version set to 3.08.00
  • Status changed from New to Resolved

Bug fixed with commit fhicl-cpp:da7893.

#3 Updated by Kyle Knoepfel about 1 month ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF