Skip to content

FIX: Zero cosmask at its center - #808

Open
sapunyangkut wants to merge 1 commit into
soft-matter:masterfrom
sapunyangkut:codex/issue-728-zero-cosmask-center
Open

FIX: Zero cosmask at its center#808
sapunyangkut wants to merge 1 commit into
soft-matter:masterfrom
sapunyangkut:codex/issue-728-zero-cosmask-center

Conversation

@sapunyangkut

Copy link
Copy Markdown

Summary

  • set the geometric center of cosmask to zero
  • add a direct mask regression test
  • add a single-pixel eccentricity regression for both Python and numba engines

Root cause

At the geometric center, theta_mask evaluates arctan2(0, 0) as zero. The previous cos(2 * theta) calculation therefore contributed 1 at the center, even though the eccentricity calculation expects that undefined angular contribution to be zero. For a center-only feature, this produced an eccentricity of 1000000.0 instead of 0.0.

Fixes #728.

Validation

Fresh publication checks on upstream commit 186fa02f048ef0902b6f9804874b701345a22398:

  • reproduced the center value as 1.0 before the patch
  • verified the center is 0.0 after the patch and every non-center mask value is unchanged
  • syntax compilation and git diff --check passed

Archived test evidence from the same upstream commit, with its manifest reverified before publication:

  • focused regression tests: 5 passed
  • adjacent mask tests: 8 passed
  • adjacent feature/refine tests: 64 passed
  • broader non-slow suite: 958 passed and 95 skipped, with one known failure because the historical reproducibility_v0.4.npz fixture retains 14 previous eccentricity values

Automation disclosure

This pull request was prepared and submitted by an OpenAI Codex agent operating on behalf of @sapunyangkut. The agent reproduced the bug, applied the minimal patch, verified the test evidence, and checked the repository's public contribution rules before submission.

@nkeim
nkeim marked this pull request as ready for review August 13, 2026 18:48
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.

Error in eccentricity calculation

2 participants