File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed
Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change 33## On this deprecate_linetools branch, I wish to remove all imports of linetools. Can you confirm that I have successfully done so?
44
55### yes, please do, but ignore the ones in the Documentation files
6+
7+ ## The test test_arc.py in tests/ is failing. Please suggest a fix. If you need to run it, use the "pypeit" environment in conda.
Original file line number Diff line number Diff line change 1616import gzip
1717import shutil
1818from packaging import version
19+ from typing import TYPE_CHECKING
1920
2021from IPython import embed
2122
3637
3738from pypeit import msgs
3839from pypeit import dataPaths
39- from pypeit import onespec
4040from pypeit import __version__
4141
42+ # Avoid circular import: datamodel -> io -> onespec -> spectrographs -> detector_container -> datamodel
43+ if TYPE_CHECKING :
44+ from pypeit import onespec
45+
4246# TODO -- Move this module to core/
4347
4448def init_record_array (shape , dtype ):
@@ -981,7 +985,7 @@ def load_thar_spec():
981985 return fits_open (dataPaths .arclines .get_file_path ('thar_spec_MM201006.fits' ))
982986
983987
984- def load_sky_spectrum (sky_file : str ) -> onespec .OneSpec :
988+ def load_sky_spectrum (sky_file : str ) -> " onespec.OneSpec" :
985989 """
986990 Load a sky spectrum from the PypeIt data directory into an XSpectrum1D
987991 object.
@@ -997,6 +1001,8 @@ def load_sky_spectrum(sky_file: str) -> onespec.OneSpec:
9971001 Returns:
9981002 `onespec.OneSpec`_: Sky spectrum
9991003 """
1004+ from pypeit import onespec
1005+
10001006 path = dataPaths .sky_spec .get_file_path (sky_file )
10011007
10021008 return onespec .OneSpec .from_xspec_file (path )
You can’t perform that action at this time.
0 commit comments