This PR addresses several import speed issues identified in #2379, especially for desispec.io.
desispec.io: deferring imports of specutils, speclite.filters, and desispec.preproc improves "import desispec.io" from 4.1 seconds to 1.3 seconds (best of 5, pwd on scratch). The remaining time is dominated by importing astropy.table (1.0 sec), which would be messy to defer everywhere.
desispec.tsnr: deferring import astropy.convolution improves "import desispec.tsnr" from 2.9 to 2.3 sec. Remaining big imports are astropy.table and astropy.coordinates via desiutil.dust.
desispec.pixgroup: removing unused import healpix improves "import desispec.pixgroup" from 3.7 to 3.15 sec. Remaining big imports are desispec.tsnr (could be deferred, though this is a bit messy since TSNR is re-calculated on-the-fly if columns are missing from older data)
coverage: 30.186% (-0.006%) from 30.192%
when pulling 5fabf40d68b9358e8f8ed2dec54b113d45faf5ea on import_speed
into 05bcd762c29d826fd39c6e9378e9355760e8a939 on main.
This PR addresses several import speed issues identified in #2379, especially for
desispec.io
.desispec.io
: deferring imports of specutils, speclite.filters, and desispec.preproc improves "import desispec.io" from 4.1 seconds to 1.3 seconds (best of 5, pwd on scratch). The remaining time is dominated by importing astropy.table (1.0 sec), which would be messy to defer everywhere.desispec.tsnr
: deferring import astropy.convolution improves "import desispec.tsnr" from 2.9 to 2.3 sec. Remaining big imports are astropy.table and astropy.coordinates via desiutil.dust.desispec.pixgroup
: removing unused import healpix improves "import desispec.pixgroup" from 3.7 to 3.15 sec. Remaining big imports are desispec.tsnr (could be deferred, though this is a bit messy since TSNR is re-calculated on-the-fly if columns are missing from older data)