Project

General

Profile

Feature #8772

Feature #7538: art service/module command-line helpers

Feature #8770: Implement parameter set validation - task 3a of issue #7538

Facility to retrieve individual sequence elements in FHiCL

Added by Kyle Knoepfel over 5 years ago. Updated about 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
-
Target version:
Start date:
05/13/2015
Due date:
% Done:

100%

Estimated time:
8.00 h
Spent time:
Scope:
Internal
Experiment:
-
SSI Package:
FHiCL
Duration:

Description

It is not currently possible to retrieve individual sequence elements using

pset.get<T>("a.b[0]");
pset.get<U>("a.c[0][4]");

where b represents a sequence in FHiCL and c represents a sequence of sequences. This facility is a necessity for the current prototype for FHiCL validation. For various reasons (both conceptual and technical), I strongly suggest the first form.

In order to facilitate this, each sequence element must be stored in the map_t object in fhicl::ParameterSet. While this is not a technical problem, care should be taken to ensure that expanding the map would not produce undesirable side effects.


Related issues

Blocks art - Feature #8773: Create new types in FHiCL that automatically register allowed parameters.Closed05/19/201508/01/2015

History

#1 Updated by Kyle Knoepfel over 5 years ago

  • Blocks Feature #8773: Create new types in FHiCL that automatically register allowed parameters. added

#2 Updated by Kyle Knoepfel over 5 years ago

Kyle Knoepfel wrote:

For various reasons (both conceptual and technical), I strongly suggest the first form.

This statement should be revised to say:

For various reasons (both conceptual and technical), I strongly prefer the first form of the following options

pset.get<T>("a.b[0]"); // <-- YES
pset.get<T>("a.b.0");  // <-- NO

#3 Updated by Kyle Knoepfel over 5 years ago

I have produced close to a full implementation of this facility. Several tests fail, likely because the ParameterSet::to_indented_string() call needs to be adjusted since sequence elements are now included in the map_t object. I do not know yet, however, what effect this facility has on writing/reading to sqlite databases in art ROOT files.

#4 Updated by Kyle Knoepfel over 5 years ago

  • Target version set to 1.18.00

#5 Updated by Kyle Knoepfel over 5 years ago

  • Status changed from Assigned to Resolved
  • % Done changed from 70 to 100

Chris Green was able to suggest a solution without having to store the individual sequence elements in the parameter map. The storage concerns are thus moot. The implementation relies on the std::regex library to split a parameter name "name[0]...[n]" into the base name "name" and the sequence indices 0,...,n. Requests like:

pset.get<T>("name[0][1].otherTable[3]");
are now supported.

Implemented with fhicl-cpp:3d7db657856c0606ec9c4992f94bcd7992e842a8.

#6 Updated by Kyle Knoepfel about 5 years ago

  • Target version changed from 1.18.00 to 1.16.00

#7 Updated by Christopher Green about 5 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF