Optimize opacity data reading performance#360
Conversation
…support - Added SQLite indexes to `molecular` and `continuum` tables for faster queries. - Vectorized PT point identification and nearest neighbor search in `optics.py` using NumPy. - Implemented HDF5 support in `RetrieveOpacities` for high-performance monochromatic opacity reading. - Added `convert_sqlite_to_h5` utility in `opacity_factory.py` for database migration. - Optimized HDF5 data retrieval with unique index sorting and vectorized slicing. - Fixed potential file handle leaks and redundant I/O in HDF5 backend. Co-authored-by: natashabatalha <6554465+natashabatalha@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. |
This PR addresses the performance bottleneck in reading monochromatic opacities from SQLite databases.
Key improvements:
(molecule, ptid)and(molecule, temperature), significantly speeding up targeted queries.optics.pywith vectorized broadcasting andnp.argmin, reducing overhead for many-layer atmospheres.convert_sqlite_to_h5to allow users to upgrade their existing databases to the faster format.Benchmarks showed up to 17x speedup over the original unindexed SQLite implementation and ~4x speedup over the optimized indexed SQLite for realistic monochromatic opacity reads.
PR created automatically by Jules for task 2624491173451506681 started by @natashabatalha