Repository navigation
Fix slicing of GroupData created from arrays - #20514
Conversation
|
Thank you for your contribution to Astropy! 🌌 This checklist is meant to remind the package maintainers who will review this pull request of some common things to look for.
|
8e27003 to
83de5ed
Compare
|
The test failures aren't from this change. Every failing job stops on the config tests importing astropy.extern.configobj, which was broken at the old base c55a2b2 and is fixed on main. I rebased onto main. Could a maintainer approve the new run? |
|
@astrofrog , what do you think? Exclude from contributor list?
|
Hey @pllim , just wanted to jump in and clarify nothing here is automated or running on a bot loop. I’m a real person manually selecting issues, directing the agent's focus, running/verifying the reproductions, and reviewing every diff before opening a PR. Im real haha, I've just been working alot in my free time contributing to just about anything i find cool, and do plan to continue on astropy. For reference i'm an AI systems engineer with a focus on security research and debugging. I completely respect whatever your team decide, just figured I'd let you know. |
…514-on-v7.2.x Backport PR #20514 on branch v7.2.x (Fix slicing of GroupData created from arrays)
…514-on-v8.0.x Backport PR #20514 on branch v8.0.x (Fix slicing of GroupData created from arrays)
Description
Slicing a
GroupDatacreated from arrays, rather than read from a file, raisedTypeError: 'NoneType' object is not subscriptable.GroupData.__new__never pointed its columns at the new fields, andFITS_rec.__getitem__reads those references when slicing. It now sets them the same wayFITS_rec.from_columnsdoes.#2748 hit this through
repr()with more than 1000 groups. That no longer fails, because numpy converts to a plain array before printing, but slicing the same data still did.The scaled case is only checked in memory, because writing scaled in-memory group data is a separate bug (#2751).
Fixes #6688
Fixes #2748
AI Disclosure
I chose this issue, directed the work, and reviewed the fix, the test and the reproductions before opening this PR. Under my direction, Claude Code (Claude Opus 5.5) traced the cause, wrote the fix, the test and the changelog entry, drafted this description, and ran the reproductions and the
io.fitstests on a local build.Merge method