Conversation
Reduced NGC catalog load time by ~42% by deferring the creation of ~14,000 Skyfield Star and Pint Quantity objects. - Catalogs.NGC now stores raw numeric data for Magnitude and Size. - NGC.get_visible restores these objects lazily only for candidate items. - Objects.get_visible ensures type-safe magnitude comparisons. - Improved robustness for transit calculations with NaT handling. Co-authored-by: pozar87 <9629954+pozar87@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
Reduced NGC catalog load time by ~42% by deferring the creation of ~14,000 Skyfield Star and Pint Quantity objects. - Catalogs.NGC now stores raw numeric data for Magnitude and Size. - NGC.get_visible restores these objects lazily only for candidate items. - Objects.get_visible ensures type-safe magnitude comparisons. - Improved robustness for transit calculations with NaT handling. - Fixed undefined 'pd' name in NGC.get_skyfield_object. Co-authored-by: pozar87 <9629954+pozar87@users.noreply.github.com>
Optimized NGC catalog load time by ~42% by deferring creation of ~14,000 Skyfield Star and Pint Quantity objects. - Catalogs.NGC now stores raw numeric data for Magnitude and Size using object dtype for future-proofing. - NGC.get_visible restores Skyfield objects for candidates before computation and restores Pint Quantities for visible results. - Objects.get_visible ensures type-safe magnitude comparisons between Series and Quantities. - Fixed robustness for transit calculations with NaT handling. - Updated unit tests to verify lazy restoration and unpickling safety. Co-authored-by: pozar87 <9629954+pozar87@users.noreply.github.com>
💡 What:
Implemented a lazy loading strategy for the NGC astronomical catalog, which contains over 14,000 entries.
🎯 Why:
Eagerly creating thousands of complex objects (
skyfield.api.Starandpint.Quantity) during the initialization of the NGC catalog was a major performance bottleneck, adding significant overhead to everyObservationcreation.📊 Impact:
Observationwith NGC data from ~1.4s to ~0.8s (a ~42% improvement).🔬 Measurement:
Measured using
scripts/profile_apts.pyand a customObservationprofiling script. Verified that all unit tests for NGC, Messier, and Stars pass.🛠️ Key Changes:
_load_ngc_with_unitsto store raw floats instead of Quantities.get_visibleto restoreskyfield_objectbefore calculations and restoreMagnitude/SizeQuantities for visible results. Updatedget_skyfield_objectto support lazy reconstruction.get_visibleto handlePintQuantities during magnitude filtering to preventDimensionalityError. AddedNaTsafety to_vectorized_geometric_compute.PR created automatically by Jules for task 17275612905742126655 started by @pozar87