Skip to content

Fix API naming/consistency quirks in Flow and Fit - #4

Merged
annmoel merged 1 commit into
masterfrom
fix/api-consistency-quirks
Jul 28, 2026
Merged

annmoel merged 1 commit into
masterfrom
fix/api-consistency-quirks

Conversation

@annmoel

@annmoel annmoel commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Standardize coords -> coordinates across distances.py/graph_construction.py
  • Flow now accepts plain arrays/pd.Series for scores/distances, not only DataFrame/named-Series
  • De-duplicate the fit-failure bookkeeping shared by the three saturation Fit subclasses via a new Fit._finalize_fit()
  • Fix _calculate_fraction_not_converged's missing return (previously always returned None despite its -> float annotation)
  • Rename Flow.flow()'s measures parameter to score_names, since it accepts arbitrary score-column names (e.g. log1p_total_counts, gene names), not the fixed centrality vocabulary that compute_centrality_measures correctly calls measures
  • Fixed stale CLAUDE.md claims (networkx fallback, missing distance_to_alpha_shape entry)

Test plan

  • pytest tests/ — 111 passed, 1 skipped
  • Manual smoke test: Flow.from_distances_and_scores with plain np.ndarray scores/distances
  • Manual smoke test: old measures= keyword now correctly raises TypeError on Flow.flow()

Note: no consuming code outside this repo passes coords=/measures= as keywords for the renamed functions (verified via grep across truncated_graphs); the one exception, Flow.flow(measures=...), is being updated in a companion PR on truncated_graphs.

🤖 Generated with Claude Code

Standardizes coords -> coordinates across distances.py and
graph_construction.py, lets Flow accept plain arrays/Series (not just
DataFrame/named-Series) for scores and distances, de-duplicates the
fit-failure bookkeeping shared by the three saturation Fit subclasses,
fixes _calculate_fraction_not_converged's missing return values, and
renames Flow.flow()'s `measures` parameter to `score_names` so it stops
being conflated with compute_centrality_measures's fixed centrality
vocabulary (it actually accepts arbitrary score-column names).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@annmoel
annmoel merged commit 496bf03 into master Jul 28, 2026
3 checks passed
@annmoel
annmoel deleted the fix/api-consistency-quirks branch July 28, 2026 11:33
@annmoel annmoel mentioned this pull request Jul 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant