Feat/pretty print records#31
Merged
Merged
Conversation
Julia's default struct `show` dumps every field with fully-qualified type names, which is unreadable when streaming a feed (`for rec in ch; println(rec); end`). Add a compact one-line `Base.show(io, r)` for all 18 DBN record types plus `RecordHeader` and `BidAskPair`. Rendering decodes fixed-point prices via `price_to_float`, prints full-nanosecond timestamps, and shows the unset sentinels (`UNDEF_PRICE`, `UNDEF_TIMESTAMP`, `UNDEF_ORDER_SIZE`, the unset stat quantity, and the UInt64-max `ts_recv`) as "-" instead of leaking NaN / huge integers / throwing on conversion. Side is labeled `side=` consistently across record types. Adds test/test_show.jl (47 assertions incl. sentinel safety) and a changelog entry. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
is_trading/is_quoting/is_short_sell_restricted decode as raw c_char bytes
('Y'=0x59, 'N'=0x4E, '~'/0x00 = not-available), per the StatusMsg round-trip
in test/test_phase5.jl. Comparing against 1 rendered a genuinely-trading
status as trading=false, inverting the exchange state for real decoded data.
Add _pp_tristate ('Y'->true, 'N'->false, else "-") and update the test to use
the canonical c_char values instead of the 0x01/0x00 representation.
Reported by Codex review on PR #29.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Bump version 0.1.2 -> 0.1.3 and finalize the changelog for the compact Base.show record pretty-printing feature (PR #29). Additive / non-breaking, so a patch bump under SemVer for 0.x. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.