Skip to content

Feat/pretty print records#31

Merged
tbeason merged 4 commits into
mainfrom
feat/pretty-print-records
Jun 5, 2026
Merged

Feat/pretty print records#31
tbeason merged 4 commits into
mainfrom
feat/pretty-print-records

Conversation

@tbeason

@tbeason tbeason commented Jun 5, 2026

Copy link
Copy Markdown
Owner

No description provided.

tbeason and others added 4 commits June 4, 2026 19:57
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>
@tbeason
tbeason merged commit 17a1ff3 into main Jun 5, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant