Skip to content

feature/issue-11/implement-hausdorff-features#14

Merged
alperkent merged 5 commits into
mainfrom
alperkent/issue11
Apr 18, 2025
Merged

feature/issue-11/implement-hausdorff-features#14
alperkent merged 5 commits into
mainfrom
alperkent/issue11

Conversation

@alperkent
Copy link
Copy Markdown
Collaborator

Resolves #11.

- 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.
@alperkent alperkent requested a review from Asanto32 April 10, 2025 17:07
@alperkent alperkent self-assigned this Apr 10, 2025
@alperkent alperkent added the task A development task intended for Github Projects label Apr 10, 2025
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 10, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (b5f9d6f) to head (a86ce3a).
Report is 12 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Collaborator

@Asanto32 Asanto32 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks pretty good, just some small modifications

Comment thread src/graphomotor/core/config.py Outdated
Comment thread src/graphomotor/core/config.py Outdated
Comment thread src/graphomotor/features/distance.py
Comment thread src/graphomotor/features/distance.py Outdated
Comment thread src/graphomotor/features/distance.py Outdated
Comment thread src/graphomotor/features/distance.py Outdated
Comment thread tests/unit/test_distance.py Outdated
Comment thread tests/unit/test_distance.py Outdated
Comment thread tests/unit/test_config.py Outdated
Comment thread tests/unit/test_config.py Outdated
Copy link
Copy Markdown
Collaborator

@Asanto32 Asanto32 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks pretty good, just some small modifications

…s, rename Hausdorff features, remove unnecessary tests
@alperkent alperkent requested a review from Asanto32 April 16, 2025 20:34
Copy link
Copy Markdown
Collaborator

@Asanto32 Asanto32 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few more small things

Comment thread src/graphomotor/features/distance.py Outdated
Comment thread src/graphomotor/utils/reference_spiral.py Outdated
Comment thread src/graphomotor/utils/reference_spiral.py Outdated
Comment thread tests/unit/test_reference_spiral.py Outdated
… edit docstrings to reflect changes, simplify arc length calculations, and modify tests for checking points are distributed equally along the spiral.
@alperkent alperkent requested a review from Asanto32 April 17, 2025 20:06
Comment thread tests/unit/test_reference_spiral.py Outdated
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)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I used the mean twice, that's why I created a variable

Copy link
Copy Markdown
Collaborator

@Asanto32 Asanto32 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just that last comment about ordering the tests (Arrange, Action, Assert)

@alperkent alperkent merged commit 9570fda into main Apr 18, 2025
16 checks passed
@alperkent alperkent deleted the alperkent/issue11 branch April 18, 2025 17:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

task A development task intended for Github Projects

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Task: Implement distance.py module, computation of distance features

2 participants