Skip to content

Fix rank-0 coord select guard and fbe doc typo - #771

Merged
d-chambers merged 1 commit into
masterfrom
fix-scale-and-1d-guards
Jul 25, 2026
Merged

Fix rank-0 coord select guard and fbe doc typo#771
d-chambers merged 1 commit into
masterfrom
fix-scale-and-1d-guards

Conversation

@d-chambers

@d-chambers d-chambers commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Description

Two small fixes surfaced by a CodeRabbit review while integrating master into dev (#769). Split out here so the integration merge stays a pure merge.

  • dascore/core/coords.py_select_by_sample_array guarded on ndim > 1, so a rank-0 coord (e.g. CoordPartial(shape=())) slipped past and then crashed on np.arange(len(self)) with an opaque TypeError. Changed to ndim != 1, matching the sibling guards already used in align_to, get_sample_count, and change_length. Added a regression test.
  • dascore/transform/fbe.py — fixed the "orginal" typo and the unbalanced parenthesis in the dB docstring formula (20 * log10( sqrt(mean(x^2)) )).

A third finding (map_fiber _set_scale scale validation) was intentionally left alone — it's a private helper in an obscure plotting path where bad input already errors, and hardening it wasn't worth the added code.

Checklist

I have (if applicable):

  • referenced the GitHub issue this PR closes.
  • documented the new feature with docstrings and/or appropriate doc page. (docstring corrected)
  • included tests. (rank-0 select regression test)
  • added the "ready_for_review" tag once the PR is ready to be reviewed.

Verification

  • pytest tests/test_core/test_coords.py::TestDimensionalityErrors tests/test_transform/test_fbe.py — passed.
  • pre-commit run --files <changed> — passed.

@coderabbitai

coderabbitai Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@d-chambers, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 14 seconds

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: f9c633de-5f0d-422e-aa5b-a2b01a91b9a5

📥 Commits

Reviewing files that changed from the base of the PR and between 09aac2f and 5de0332.

📒 Files selected for processing (3)
  • dascore/core/coords.py
  • dascore/transform/fbe.py
  • tests/test_core/test_coords.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-scale-and-1d-guards

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@d-chambers
d-chambers force-pushed the fix-scale-and-1d-guards branch from 20bedbd to 6bd9cc4 Compare July 24, 2026 07:56
@codecov

codecov Bot commented Jul 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.93%. Comparing base (09aac2f) to head (5de0332).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #771   +/-   ##
=======================================
  Coverage   99.93%   99.93%           
=======================================
  Files         145      145           
  Lines       12859    12859           
=======================================
  Hits        12851    12851           
  Misses          8        8           
Flag Coverage Δ
unittests 99.93% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 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.

@d-chambers
d-chambers force-pushed the fix-scale-and-1d-guards branch 2 times, most recently from 44dd3a6 to f5344f0 Compare July 24, 2026 08:06
- coords: _select_by_sample_array used `ndim > 1`, so a rank-0 coord slipped
  past and crashed on `len()`. Use `ndim != 1`, matching the sibling guards in
  align_to/get_sample_count/change_length. Add a regression test.
- fbe: fix "orginal" typo and the unbalanced paren in the dB docstring formula.
@d-chambers
d-chambers force-pushed the fix-scale-and-1d-guards branch from f5344f0 to 5de0332 Compare July 24, 2026 08:11
@d-chambers d-chambers changed the title Fix scale validation, rank-0 coord guard, and fbe doc Fix rank-0 coord select guard and fbe doc typo Jul 24, 2026
@d-chambers
d-chambers merged commit 38f43ed into master Jul 25, 2026
25 checks passed
@d-chambers
d-chambers deleted the fix-scale-and-1d-guards branch July 25, 2026 08:01
@d-chambers d-chambers mentioned this pull request Aug 4, 2026
4 tasks
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.

2 participants