multiscale / muscle3

The third major version of the MUltiScale Coupling Library and Environment
Apache License 2.0
25 stars 13 forks source link

Improve Message construction syntax #146

Closed LourensVeen closed 1 year ago

LourensVeen commented 1 year ago

In many cases, the t_next argument to Message() isn't used. In C++, there's a constructor that only takes timestamp and data, but in Python you have to explicitly specify None for t_next if you don't want to use it. It would be nice if you could omit it, using Message(t_cur, data=data). For that, both t_next and data need to have a default value (data because of Python syntax requirements).

If we default both to None, then Message(t_cur) is also valid, and sends a nil value. That sounds reasonable enough, and may even be a nice syntax for sending an empty trigger message. We should be consistent and allow the same syntax in C++ then, with an extra Message(double timestamp) constructor.

LourensVeen commented 1 year ago

Ah, duplicate of #125, I put this in here already...