Skip to content

Add support for std::chrono::duration properties

I would like to be able to declare:

using namespace std::chrono_literals;
Gaudi::Property<std::chrono::seconds> m_timeout{this, "Timeout", 60s};

The C++ part is straightforward (well... nothing ever is with boost spirit). But the question is on how we would represent such a property in Python:

  1. As integer: MyAlg.Timeout = 60
  2. As string following the same syntax as chrono_literals: MyAlg.Timeout = "60s"
  3. As Python datetime: MyAlg.Timeout = datetime.timedelta(seconds=60)

The second two would have the obvious advantage of carrying their unit and avoid any confusion.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information