-
Notifications
You must be signed in to change notification settings - Fork 1
Description
GitHub Issue: Polynomial Signal Title Formatting
Title: Polynomial signal titles should use mathematical notation instead of parameter listing
Labels: bug, enhancement, UX
Description
When creating polynomial signals in DataLab, the signal titles display verbose parameter listings like:
polynomial(a0=1,a1=2,a2=-3,a3=4,a4=0,a5=0)
This format is difficult to read and doesn't follow standard mathematical conventions. Instead, polynomials should be displayed as mathematical expressions:
1+2x-3x²+4x³
Expected Behavior
Polynomial signal titles should:
- Display in standard mathematical notation (e.g.,
1+2x-3x²+4x³) - Omit zero coefficients (e.g.,
1+x+x³when a2=0) - Handle coefficient simplification (e.g.,
xinstead of1x,-xinstead of-1x) - Use proper sign handling (e.g.,
1-2x+3x²not1+-2x++3x²) - Use
^for exponents (e.g.,x²displayed asx^2) - Return
"0"for all-zero polynomials
Actual Behavior
The PolyParam.generate_title() method currently returns a verbose format listing all six coefficients (a0-a5), even when some are zero, making the titles unnecessarily long and hard to parse visually.
Proposed Solution
Modify the PolyParam.generate_title() method in sigima/objects/signal/creation.py to:
- Iterate through coefficients (a0-a5)
- Skip zero coefficients
- Format each term with proper coefficient and exponent handling
- Join terms with correct sign operators
Use Case
This improvement benefits users working with polynomial signals in DataLab by:
- Making signal lists more readable
- Following standard mathematical notation
- Reducing visual clutter in the GUI
- Improving quick identification of polynomial characteristics
Related Files
sigima/objects/signal/creation.py(PolyParam class, line ~1276)datalab/gui/actionhandler.py(uses PolyParam for signal creation)
Additional Context
This is a presentation-layer fix that doesn't affect:
- Signal data storage or processing
- Polynomial coefficient values
- Mathematical operations
- Serialization/deserialization
- Existing tests or functionality
The fix only changes how polynomial signals are displayed to users.