Skip to content

Commit

Permalink
Improve error message for reid_arxiv file not exist
Browse files Browse the repository at this point in the history
As commented in the Users Slack:

https://pypeit-users.slack.com/archives/CST2Q4QPN/p1694827540917799

This commit adds checking to see if the input is empty before calling
`pathlib.Path()`, which is what was causing the errors reported.

	modified:   pypeit/core/wavecal/waveio.py
  • Loading branch information
tbowers7 committed Oct 30, 2023
1 parent bdb80d2 commit b083fc5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pypeit/core/wavecal/waveio.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def load_template(arxiv_file:str, det:int, wvrng:list=None)->tuple[np.ndarray,np
binning of the template arc spectrum
"""
if not isinstance(arxiv_file, (str, pathlib.Path)):
if not isinstance(arxiv_file, (str, pathlib.Path)) or arxiv_file is None or arxiv_file == "":
msgs.error(f"Incorrect or nonexistant arxiv file specified: {arxiv_file}")

# Path already included?
Expand Down

0 comments on commit b083fc5

Please sign in to comment.