Repository navigation
Fix chart window positions after dropping invalid data rows - #414
Draft
xiaoheiai4719-collab wants to merge 2 commits into
Draft
xiaoheiai4719-collab wants to merge 2 commits into
xiaoheiai4719-collab wants to merge 2 commits into
Conversation
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.
Summary
The custom-date prediction endpoint passes
df[mask].index[0]into the chart renderer, which slices withiloc. When CSV cleanup removes invalid rows, those index labels no longer equal row positions. As a result, the chart shows different history from the predictor input and shifts the plotted prediction/actual timestamps.Use the first matching row position rather than its index label. Data cleaning and model inputs remain unchanged.
Validation
python -m pytest -q tests/test_webui_chart_window.py: 3 passed; before the fix, 2 failed and 1 passed.python -m ruff check --isolated --select E4,E7,E9,F tests/test_webui_chart_window.pypython -m py_compile webui/app.py tests/test_webui_chart_window.pygit diff --checkThe optional Web UI dependencies are required to run these tests; the module skips when they are absent. Three existing Plotly/pandas deprecation warnings are emitted. No models were downloaded or run.
AI assistance: OpenAI assisted with source inspection, implementation, and regression tests.