Project

General

Profile

Feature #9361

Feature #9078: ParameterSet validation enhancements

Create 'TableFragment' fhiclcpp type that mirrors @table

Added by Kyle Knoepfel about 4 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
Start date:
07/02/2015
Due date:
% Done:

100%

Estimated time:
24.00 h
Spent time:
Duration:

Description

Consider the following job configuration:

label : {

  module_type : MyModule

  a1 : <val>
  a2 : <val>

  b1 : <val>
  b2 : <val>

}

There are various use cases within art (and likely in user code) where a1 and a2 are used by class A, and b1 and b2 are used by class B, both of which belong to a module called MyModule. With the existence of fhiclcpp types (see issue #8773), a reasonable configuration would be:

class A {
public:
  struct Config {
    Atom<T> a1 { Key("a1") }:
    Atom<T> a2 { Key("a2") }:
  };
  // ...
};

and
class B {
public:
  struct Config {
    Atom<T> b1 { Key("b1") }:
    Atom<T> b2 { Key("b2") }:
  };
  // ...
};

There is, unfortunately, no way for users to declare a full configuration for MyModule using fhiclcpp types without resorting to multiple inheritance. An InlineTable class template would be very helpful so that a user could still benefit from C++ encapsulation, but fhiclcpp would expect to see a configuration as shown above. For example:

struct ConfigMyModule {
  TableFragment<A::Config> a;
  TableFragment<B::Config> b;
};

would allow a and b to be passed to the relevant functions/classes, but the FHiCL configuration corresponding to the members of {A,B}::Config be inline, as shown in the above FHiCL configuration. This closely parallels the @table syntax in FHiCL.


Related issues

Related to art - Feature #10748: Implement fhicl::TableFragment in artClosed11/03/2015

History

#1 Updated by Kyle Knoepfel about 4 years ago

  • Category set to Infrastructure
  • Status changed from New to Assigned
  • Assignee set to Kyle Knoepfel
  • Target version set to 2.01.00
  • Estimated time set to 24.00 h

Anticipate 8 hours for implementing feature and 16 for testing it.

#2 Updated by Kyle Knoepfel about 4 years ago

  • Description updated (diff)

#3 Updated by Kyle Knoepfel about 4 years ago

  • Subject changed from Create fhiclcpp type that mirrors @table to Create 'TableFragment' fhiclcpp type that mirrors @table

#4 Updated by Kyle Knoepfel about 4 years ago

  • Project changed from art to fhicl-cpp
  • Category deleted (Infrastructure)

#5 Updated by Kyle Knoepfel almost 4 years ago

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

This feature was straightforward to implement, largely because of the design of the already in-place fhiclcpp-type features. The TableFragment is formally not a fhiclcpp type as it has no meaningful FHiCL construct. Rather, it serves as an auxiliary class to support the cases discussed above. It therefore does not have the standard common accessors as documented here.

Implemented with fhicl-cpp:072ab5b.

#6 Updated by Kyle Knoepfel almost 4 years ago

  • Related to Feature #10748: Implement fhicl::TableFragment in art added

#7 Updated by Kyle Knoepfel over 3 years ago

  • Target version changed from 2.01.00 to 1.17.05

#8 Updated by Kyle Knoepfel over 3 years ago

  • Status changed from Resolved to Closed


Also available in: Atom PDF