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.
|
46d3378 to
a41cc1b
Compare
|
Hmm benchmarks not affected. Does this mean we need a new benchmark at https://github.com/astropy/astropy-benchmarks ? |
|
I don't think there are any benchmarks for this particular transform or any benchmarks for the I can open a merge request |
mhvk
left a comment
There was a problem hiding this comment.
Hah, that is really an example of making the wrong inference: for ndarray, np.broadcast is the fastest way to check shapes, but if the inputs are not arrays, clearly that is no longer true. As for benchmarks, having one about GCRS equality would be nice, but I'm happy to get this in without it.
Description
For large
SkyCoordobjects, e.g. many obstimes, actually performing the broadcast is a very expensive operation, checking shapes is enough.main
observe the 200_000 and 600_000 calls on numpy / quantity methods
This branch
Both #20416 and this branch merged together
Benchmark script:
AI Disclosure
The issue was identified by me looking at profiling output while working on #20416, the exact code location was identified by codex / gpt-6-astra, fix was made by me.
Merge method