import of specutils is slow
- Dominant language
- Python
- Stars
- 204
- Forks
- 134
- Avg merge
- 12h 55m
- Merged PRs (30d)
- 1
Description
Importing `spectuils` is slow, taking 1.3-2 seconds. See attached screenshot, captured with `python -X importtime -c "import specutils" 2> imports.txt` and shown with tuna. For users developing packages that want to use and build off `Spectrum1D` it's unfortunate that importing `Spectrum1D` adds upwards of a second to the import time. If you drill down it looks like a big slowdown comes from importing `pkg_resources` in `astropy.modeling`, as well as `astropy.coordinates` within `astropy.nddata`. Has there been any discussion on ways of improving this?
Contributor guide
Research direction
Reproduce the report with `python -X importtime -c "import specutils" 2> imports.txt` and inspect the result with tuna. Trace the import paths involving `Spectrum1D`, `pkg_resources` in `astropy.modeling`, and `astropy.coordinates` within `astropy.nddata`; done means establishing a concrete import-time improvement without changing the public behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- performance
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100