Repository navigation
Conversation
_containment wrapped the input in np.atleast_1d, so a scalar PixCoord gave a shape (1,) array instead of a bool like every other shape. The input shape is now kept. The shared scalar test checks the result is 0-d for every pixel region.
|
Hi 👋 and thank you for your contribution! 🙏 This pull request is being closed automatically - but don't worry, this is not the end, and we may re-open it. For some background, we have recently started seeing a rapid increase in the number of pull requests opened. Some of these are from good-faith humans, but some of which are from autonomous LLM agents or humans using LLMs who do not have a genuine understanding of, or interest in, the project. We are therefore auto-closing pull requests from new contributors, but if you are a good-faith human, we want to make sure your pull request gets considered! So if you would like us to re-open your pull request so that it gets reviewed, you need to do two things:
The second step is important, as we may otherwise miss notifications about this pull request. To be clear, our AI policy does allow the use of LLMs as part of contributions, but we need to see authentic engagement and understanding from humans making the contribution. Notes for maintainersIf you know this is a genuine user and the PR is is compliance with the AI policy, you may re-open this straight away. After two successful merged pull requests, the user will be added to the allowlist and future PRs will no longer be closed automatically. This user has not made any pull requests to this repository prior to this one. In addition, here are some statistics on the user's activity on GitHub:
|
PixelRegion.contains/coversare documented to return a bool for a scalar position.PolygonPixelRegion(andRegularPolygonPixelRegion) instead return a shape(1,)array, because_containmentwraps the input innp.atleast_1d:This also leaks into compound regions built with a polygon, and into anything that checks
np.ndimor indexes the result.Fix: keep the input shape (
ravelfor the Cython helpers, then reshape back) and index with[()], so a scalar input gives a scalar while 1-D and 2-D inputs are unchanged.Test: the shared
BaseTestPixelRegion.test_contains_scalarpassed before only because it usedassert reg.contains(p), and a one-element array is truthy. It now also assertsnp.ndim(...) == 0, so the check covers every pixel shape. Onmainit fails for the two polygon classes. With this change the full test suite passes (2146 passed) and flake8 is clean.Added a
CHANGES.rstentry under 0.14 Bug Fixes.AI-assisted (Claude): I used it to help read the code and draft the test. I reviewed and ran everything myself.