Repository navigation
fix: trim error bars with rolling plot points - #2223
ayushmaan-16 wants to merge 1 commit into
Conversation
Include error_x, error_y and error_z arrays and arrayminus values in max_points trimming so retained scatter points keep their matching errors and discarded error values are released. Cover creation, lowering the limit, incremental append patches, disabled limits and scalar error settings across scatter, scattergl and scatter3d.
Reviewer's GuideImplementationAdd error-bar array paths to the existing rolling-point trimming list so
TestsAdd regression coverage for error-bar alignment during creation, limit changes, and append patches, along with unchanged behavior when limits do not expire points or errors are scalar.
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
| ("ids",), | ||
| ("error_x", "array"), | ||
| ("error_x", "arrayminus"), | ||
| ("error_y", "array"), |
There was a problem hiding this comment.
🟡 Medium · Appended points lose their errors
When an incremental append supplies data-based error bars, UpdateHandler.update appends coordinates but not the incoming trace’s error arrays, so trim_plot_points can only trim the old errors; newly appended points have no matching error bars.
Append each incoming error array and arrayminus alongside its corresponding points, and include those additions in the generated patch.
| errors = {"type": error_type, "value": 5, "valueminus": 2, "symmetric": False} | ||
| trace["error_y"] = copy.deepcopy(errors) | ||
| pane = window(window_args(data=[trace], opts={"max_points": 1})) | ||
| assert pane["content"]["data"][0]["error_y"] == errors |
There was a problem hiding this comment.
🟡 Medium · Scalar test misses skipped trimming
When the rolling trimmer skips the trace, test_rolling_points_preserve_scalar_error_settings only compares error_y with its input at line 1118, so a trimmer that does nothing leaves the assertion passing even though the points were not rolled.
Also assert that the trace coordinates contain only the retained point.
Description
Keep error bars aligned with the points retained by
opts.max_points.Previously, the server removed old coordinates but kept their error values. The remaining points could then show error bars from discarded samples, and the unused values stayed in memory.
Add the
arrayandarrayminuspaths forerror_x,error_y, anderror_zto the existing trimming list. This coversscatter,scattergl, andscatter3d.Motivation and Context
Each retained point should keep its matching error values.
For example, if points 2 and 3 remain from four samples with upper errors
[1, 2, 8, 12], their errors should be[8, 12]. Previously, they displayed[1, 2]instead.This also keeps unused error values from reducing the memory benefit of
max_points.How Has This Been Tested?
Types of changes
Checklist:
py/visdom/VERSIONaccording to Semantic VersioningSummary by Sourcery
Trim rolling-plot error-bar arrays alongside expired points.
Bug Fixes:
Tests:
Summary by CodeRabbit