Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update docs to match exclusive end_time implementation (#1286)
### Changelog None ### Docs * Updated the Python docstrings for the MCAP readers to label the `end_time` parameter as an exclusive bound * The documentation on [this page](https://mcap.dev/docs/python/mcap-apidoc/mcap.reader#mcap.reader.McapReader.iter_decoded_messages) will also be updated ### Description According to the documentation [here](https://mcap.dev/docs/python/mcap-apidoc/mcap.reader#mcap.reader.McapReader.iter_decoded_messages), the iterator should exclude messages that were logged before `start_time` or after `end_time` (i.e. both inclusive bounds). However, the implementation also excludes messages published at the same time as `end_time` (making it an exclusive bound). The documentation has been updated to match the implementation. This discrepancy in the Python package is only happening in `python/mcap/mcap/reader.py` where `iter_message()` and `iter_decoded_message()` are defined. In all of the other files where those functions are called, `end_time` is described as an exclusive bound: - `python/mcap-protobuf-support/mcap_protobuf/reader.py` - `python/mcap-ros1-support/mcap_ros1/reader.py` - `python/mcap-ros2-support/mcap_ros2/reader.py` This motivated updating the documentation rather than modifying the implementation (which would also have been a breaking change). In addition, this follows the typical Python convention of using inclusive-start and exclusive-end bounds (`list[start:end]`, `array[start:end]`, `range(start, end)`, `numpy.arange(start, end)`, etc...). <table> <tr> <th></th><th>Before</th><th>After</th> </tr><tr> <td>Documentation</td> <td><code>end_time</code> is inclusive</td><td> <code>end_time</code> is exclusive</td> </tr><tr> <td>Implementation</td> <td><code>end_time</code> is exclusive</td> <td><code>end_time</code> is exclusive</td> </tr> </table> Fixes: FG-9583 --------- Co-authored-by: james-rms <[email protected]>
- Loading branch information