feature/issue-11/implement-hausdorff-features#14
Conversation
- Updated pyproject.toml and uv.lock to include scipy as a dependency. - Implemented Hausdorff distance metrics in distance.py for analyzing spiral drawing data. - Added tests for distance metrics and data segmentation in test_distance.py. - Created reference spiral generation in config.py and corresponding tests in test_config.py.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #14 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 2 4 +2
Lines 65 115 +50
=========================================
+ Hits 65 115 +50 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Asanto32
left a comment
There was a problem hiding this comment.
Looks pretty good, just some small modifications
Asanto32
left a comment
There was a problem hiding this comment.
Looks pretty good, just some small modifications
…s, rename Hausdorff features, remove unnecessary tests
Asanto32
left a comment
There was a problem hiding this comment.
A few more small things
… edit docstrings to reflect changes, simplify arc length calculations, and modify tests for checking points are distributed equally along the spiral.
| assert spiral.shape == (10000, 2) | ||
| assert np.array_equal(spiral[0], [50, 50]) | ||
| assert np.allclose(spiral[-1], [50 + 1.075 * 8 * np.pi, 50], atol=1e-8) | ||
| arc_lengths = np.linalg.norm(spiral[1:] - spiral[:-1], axis=1) |
There was a problem hiding this comment.
So the action is: spiral = reference_spiral.generate... so the correct order here would be:
expected_mean_arc_length = reference_spiral._calculate_arc_length(
reference_spiral._SPIRAL_END_ANGLE
) / (reference_spiral._SPIRAL_NUM_POINTS - 1)
spiral = reference_spiral.generate_reference_spiral()
arc_lengths = np.linalg.norm(spiral[1:] - spiral[:-1], axis=1)
mean_arc_length = np.mean(arc_lengths)
And probably don't need a dedicated variable for mean, but it's fine.
There was a problem hiding this comment.
I used the mean twice, that's why I created a variable
Asanto32
left a comment
There was a problem hiding this comment.
Just that last comment about ordering the tests (Arrange, Action, Assert)
…e, Act, Assert pattern holds
Resolves #11.