diff --git a/docs/source/changelog.md b/docs/source/changelog.md index 0a84726..352dc00 100644 --- a/docs/source/changelog.md +++ b/docs/source/changelog.md @@ -5,6 +5,9 @@ list and release milestones. ## Version Release Notes Release notes for the `space_packet_parser` library +### v5.1.0 (unreleased) +- BUGFIX: Fix kbps calculation in packet generator for showing progress. + ### v5.0.1 (released) - BUGFIX: Allow raw_value representation for enums with falsy raw values. Previously these defaulted to the enum label. diff --git a/space_packet_parser/definitions.py b/space_packet_parser/definitions.py index cdf0cc2..b2aa568 100644 --- a/space_packet_parser/definitions.py +++ b/space_packet_parser/definitions.py @@ -464,7 +464,7 @@ def _print_progress( # Fast calls initially on Windows can result in a zero elapsed time elapsed_ns = max(time.time_ns() - start_time_ns, 1) delta = dt.timedelta(microseconds=elapsed_ns / 1E3) - kbps = int(current_bytes // 8 * 1E6 / elapsed_ns) + kbps = int(current_bytes * 8E6 / elapsed_ns) # 8 bits per byte, 1E9 s per ns, 1E3 bits per kb pps = int(current_packets * 1E9 / elapsed_ns) info_str = f"[Elapsed: {delta}, " \ f"Parsed {current_bytes} bytes ({current_packets} packets) " \