multiscale / muscle3

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

Passing a non-float for the Message timestamps in Python results in invalid message on the wire #118

Closed LourensVeen closed 2 years ago

LourensVeen commented 2 years ago

The API requires Message timestamps to be floats, but of course Python doesn't type check and neither does libmuscle, so if you pass an int it'll get serialised to MsgPack, resulting in a message on the wire that has the wrong format.

In communicator.py, the Message constructor should try to convert the value to float, just in case.

Thanks to Jonathan for finding this one!

LourensVeen commented 2 years ago

Actually, good point Maarten, you could assign an int to the attribute, so we should check and convert again at the MMPMessage level.