strategies: fix table renderer crushing columns to zero width#9
Open
garethreakes wants to merge 1 commit intomasterfrom
Open
strategies: fix table renderer crushing columns to zero width#9garethreakes wants to merge 1 commit intomasterfrom
garethreakes wants to merge 1 commit intomasterfrom
Conversation
The default print_df gives every DataFrame column equal weight, so
ai_momentum's 30-element conids list (~150 chars of integers) starves
the name/state/bar_size columns to nothing — the table effectively
disappears, leaving only an unreadable blob of numbers and rules.
Add a custom renderer for `_handle_strategies_list` that:
* Replaces conIds with looked-up symbols when a local universe maps them.
* Truncates long lists as "N: first,second,third, +M more" with a count.
* Renders state as colored ON / off.
* Compacts params to "KEY=val, KEY=val".
* Lays the table out with explicit ratio columns so symbols/params share
the wide space and name/state/bar/hist stay legible.
Falls back gracefully when the universe lookup fails (raw conIds shown).
Verified live against four deployed strategies including a 30-symbol
ai_momentum entry — all rows render with names, states, bar sizes,
symbol counts and params visible in a single readable table.
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.
The default print_df gives every DataFrame column equal weight, so
ai_momentum's 30-element conids list (~150 chars of integers) starves
the name/state/bar_size columns to nothing — the table effectively
disappears, leaving only an unreadable blob of numbers and rules.
Add a custom renderer for
_handle_strategies_listthat:the wide space and name/state/bar/hist stay legible.
Falls back gracefully when the universe lookup fails (raw conIds shown).
Verified live against four deployed strategies including a 30-symbol
ai_momentum entry — all rows render with names, states, bar sizes,
symbol counts and params visible in a single readable table.