We were recently studying slow import times in DESI code (desihub/desispec#2379) which was partially traced to specutils, which has a chain of imports that include things like dask and matplotlib.
This will print a dizzying amount of information about what is imported and what takes time
i.e. the overall specutils import took 5.3 seconds, of which 2.8 were from astropy.ndata, of which 1.5 were from dask.array even though we don't use any dask at all, we just happen to also have it installed. The matplotlib impact was smaller, but still surprising to see.
This smells like an underlying astropy issue, but I'm starting with filing it here because I was just chatting with @tepickering who suggested I post here, and then specutils might sort this out with astropy.
Our developement versions are a little on the old side, so it would be worth having a specutils developer retest with latest versions before diving into this too much more.
We were recently studying slow import times in DESI code (desihub/desispec#2379) which was partially traced to specutils, which has a chain of imports that include things like dask and matplotlib.
This will print a dizzying amount of information about what is imported and what takes time
selected lines:
i.e. the overall specutils import took 5.3 seconds, of which 2.8 were from astropy.ndata, of which 1.5 were from dask.array even though we don't use any dask at all, we just happen to also have it installed. The matplotlib impact was smaller, but still surprising to see.
This smells like an underlying astropy issue, but I'm starting with filing it here because I was just chatting with @tepickering who suggested I post here, and then specutils might sort this out with astropy.
Our developement versions are a little on the old side, so it would be worth having a specutils developer retest with latest versions before diving into this too much more.
python 3.10.14 specutils 1.14.0 astropy 6.0.1