Skip to content

strategies: fix table renderer crushing columns to zero width#9

Open
garethreakes wants to merge 1 commit intomasterfrom
pr9
Open

strategies: fix table renderer crushing columns to zero width#9
garethreakes wants to merge 1 commit intomasterfrom
pr9

Conversation

@garethreakes
Copy link
Copy Markdown
Collaborator

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.

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.
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