fix(tests): align test suite with refactored v2 API - #2
Merged
ezhil384 merged 1 commit intoMay 15, 2026
Merged
Conversation
- TestComputeEFD: access efd["efd_coeffs"] instead of treating return value as ndarray directly - TestComputeRadialProfile: update key names to radial_* prefix, replace missing radius_range_mu with computed radial_max - radial_min, add n_radial_peaks to expected key set - TestExtractFeaturesFromArray: fix call signature (resolution_mu=, source_name=), adapt assertions for dict return type, fix efd key count (51 not 40), fix hu prefix (no underscore) - TestClassifyShape: add n_radial_peaks and asymmetry_index to all feature dicts (now required by classify_shape) - test_section_pipeline: fix hu column prefix from hu_ to hu - TestCurlIndex: make _curved_skel dense enough to avoid disconnected segments causing nan; fix assertion direction (chord/arc metric gives lower values for curved lines, not higher) Agent-Logs-Url: https://github.com/ezhil384/fibermorph/sessions/86945c40-fef0-4344-97fa-c44ac3c5e80d Co-authored-by: ezhil384 <80913303+ezhil384@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
ezhil384
May 15, 2026 16:34
View session
ezhil384
marked this pull request as ready for review
May 15, 2026 16:35
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Tests were written against the pre-refactor API and fail across all Python versions (3.10–3.12) due to changed return types, renamed keys, and updated function signatures introduced in the v2 enhanced-analysis rewrite.
What changed
compute_efd— dict return instead of ndarraycompute_radial_profile— renamed keys, removedradius_range_muradius_*→radial_*(radius_mean_mu→radial_mean_mu, etc.)radius_range_mudropped; range now derived asradial_max_mu − radial_min_mun_radial_peaksadded to expected key setextract_features_from_array— signature and return type(mask, "name", resolution=4.25)→(mask, source_name="name", resolution_mu=4.25)dict | None, notpd.DataFrame; assertions updated accordinglyhu_→hu(keys arehu1…hu7)classify_shape— additional required keysAdded
n_radial_peaksandasymmetry_indexto all fixture feature dicts; the classifier now reads both.curl_index_from_skeleton— nan result and wrong assertion direction_curved_skelwas under-sampled (~120 pts for a 251-px arc), creating disconnected 1-px segments that all got skipped, yieldingnan. Increased sample density to4× arc pixel length.chord / arc(a straightness ratio, ≤ 1). A curved line therefore produces a lower value than a straight line. Assertion corrected toci_curved < ci_straight.