It is not currently possible to retrieve individual sequence elements using
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.
#2 Updated by Kyle Knoepfel about 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"); // <-- YES pset.get<T>("a.b.0"); // <-- NO
#3 Updated by Kyle Knoepfel about 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.
#5 Updated by Kyle Knoepfel almost 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...[n]" into the base name
"name" and the sequence indices
0,...,n. Requests like:
are now supported.
Implemented with fhicl-cpp:3d7db657856c0606ec9c4992f94bcd7992e842a8.