Skip to content

Fix phase-wrapped binning and add negative phase support#7

Merged
jackieblaum merged 8 commits intomainfrom
fix/phase-wrapped-binning
Jan 5, 2026
Merged

Fix phase-wrapped binning and add negative phase support#7
jackieblaum merged 8 commits intomainfrom
fix/phase-wrapped-binning

Conversation

@jackieblaum
Copy link
Owner

Summary

  • Fix IndexError when bins are empty: Added minlength parameter to np.bincount() to ensure array is long enough even when last bins have no data points
  • Add support for negative phase ranges: Phases outside [0,1] (e.g., PHOEBE-style [-0.5, 0.5]) are now automatically normalized internally
  • Fix phase-wrapped eclipses: Eclipses that cross the 0/1 boundary are now detected and unwrapped before binning
  • Automatic rewrapping: Results are returned in the original phase space by default
  • Version bump to 0.4.0 for PyPI release

Test plan

  • All existing tests pass
  • Added comprehensive tests for negative phase edge cases
  • Added tests for phase-wrapped eclipse detection
  • Verified binning works correctly with PHOEBE-style phase ranges

@jackieblaum jackieblaum merged commit 272a6d7 into main Jan 5, 2026
8 checks passed
jackieblaum added a commit that referenced this pull request Jan 5, 2026
Fix phase-wrapped binning and add negative phase support
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