Skip to content

FIX: Hide Bin Count Setting for FormulaCurves#201

Merged
zdomke merged 1 commit into
mainfrom
zdomke/formula-bin-count
Sep 17, 2025
Merged

FIX: Hide Bin Count Setting for FormulaCurves#201
zdomke merged 1 commit into
mainfrom
zdomke/formula-bin-count

Conversation

@zdomke

@zdomke zdomke commented Sep 17, 2025

Copy link
Copy Markdown
Collaborator

Description

Fixes error with CurveSettingsModal. The widget would try to reference a non existent property for FormulaCurveItems. This PR adds a check to prevent referencing the property if it doesn't exist.

Motivation

The error below would come up when opening the settings for a Formula curve:

Traceback (most recent call last):
  File "/sdf/home/z/zdomke/workspace/trace/trace/trace/widgets/control_panel.py", line 968, in show_settings_modal
    self.pv_settings_modal = CurveSettingsModal(self.pv_settings_button, self.plot, self.source)
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/sdf/home/z/zdomke/workspace/trace/trace/trace/widgets/curve_settings.py", line 40, in __init__
    bin_count = curve.optimized_data_bins
                ^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'FormulaCurveItem' object has no attribute 'optimized_data_bins'

Screenshots

Curve Settings, includes line labeled "Optimized bin count":
Screenshot 2025-09-17 at 12 00 01

Formula Curve Settings, does not include line labeled "Optimized bin count":
Screenshot 2025-09-17 at 12 00 04

Pre-merge checklist

  • Code works interactively
  • Code contains descriptive docstrings
  • New/changed functions and methods are covered in the test suite where possible
  • Test suite passes locally
  • Test suite passes on GitHub Actions

@zdomke zdomke requested a review from a team September 17, 2025 19:02
@zdomke zdomke self-assigned this Sep 17, 2025
@zdomke zdomke added the bug Something isn't working label Sep 17, 2025
@zdomke zdomke merged commit da15469 into main Sep 17, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants