Skip to content

Commit e47a825

Browse files
committed
test fix
1 parent 17afebb commit e47a825

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

prompts/linetools.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@
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.

pypeit/io.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import gzip
1717
import shutil
1818
from packaging import version
19+
from typing import TYPE_CHECKING
1920

2021
from IPython import embed
2122

@@ -36,9 +37,12 @@
3637

3738
from pypeit import msgs
3839
from pypeit import dataPaths
39-
from pypeit import onespec
4040
from 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

4448
def 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)

0 commit comments

Comments
 (0)