Skip to content

Render Scattergl with ±Inf by coercing ndarray to list and Inf→NaN #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

logicstar-ai[bot]
Copy link

@logicstar-ai logicstar-ai bot commented Jul 18, 2025

🚀 Fix: Scattergl not drawing line with np.inf but only when in pd.Dataframe

🐞 Root cause

WebGL traces choke on NumPy binary array encoding that contains ±Inf. Lists work because JSON encoder converts Inf to null. When Pandas supplies a NumPy array with Inf, validator left it unchanged, leading to empty render.

🛠️ Fix overview

Detect ±Inf in homogeneous NumPy arrays during validation; replace Inf with NaN and convert the data to a Python list, forcing JSON list encoding so that infinities become null and Scattergl renders correctly.

🧪 Tests

4 / 4 passed
🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩

100% test coverage
🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩



🔗 Check LogicStar for full analysis, test output, and trace logs.

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.

0 participants