Conversation
|
The head-plot module and standalone script look solid and useful for export workflows. |
|
Module Architecture - Integration Concern I see the headplot function follows Finn's structure which is good for consistency. Questions:
Suggestion: class PlotRegistry:
_plotters = {}
@classmethod
def register(cls, name, plotter_func):
cls._plotters[name] = plotter_func
@classmethod
def get_available_plots(cls):
return list(cls._plotters.keys()) |
|
Testing Coverage** ⭐ On the test runner file, add: **Automated Testing - Test Coverage**
Good initiative adding a test runner! However, I have some concerns about test comprehensiveness:
**Current State:**
- ✅ Tests plot generation (good!)
- ❌ Missing edge case tests
- ❌ No validation of plot output correctness
**Recommended Test Cases:**
1. **Empty data**: What happens when the CSV has no valid frames?
2. **NaN values**: How does the plot handle missing head coordinates?
3. **Single frame**: Edge case with only 1 data point
4. **Invalid config**: Missing required fields in config JSON
5. **Output validation**: Check that generated plots have expected data ranges
**Example test structure:**
```python
def test_headplot_empty_data():
"""Test head plot handles empty DataFrame gracefully."""
empty_df = pd.DataFrame()
config = load_test_config()
# Should either skip gracefully or raise informative error
with pytest.raises(ValueError, match="No data to plot"):
plot_head(empty_df, config)
def test_headplot_output_has_correct_traces():
"""Verify generated plot contains expected data."""
df = load_test_data()
config = load_test_config()
fig = plot_head(df, config)
assert len(fig.data) > 0 # Has trace data
assert fig.layout.xaxis.title.text == "Time (s)" # Correct axis labels
Adding these tests would prevent regressions and improve code reliability |
| # Head Plot GUI Integration | ||
|
|
||
| ## Overview | ||
| Head plots are now integrated into the GraphViewerScene and appear automatically in the GUI when calculations complete, following the same pattern as dot plots. Both use the DataFrame directly for optimal performance. |
There was a problem hiding this comment.
- Is there a specific reason head plots are separated from the main GraphViewerScene workflow?
-added modern headplot function following finns structure
-added runner test file to test generating plots