From 4dde524fb6f3032214b5e95ab0c3bf0cca7e39bc Mon Sep 17 00:00:00 2001 From: xuewc Date: Wed, 27 Mar 2024 02:18:48 +0800 Subject: [PATCH] fix: informative exception * more informative error message on loading type II spectrum --- src/elisa/data/ogip.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/elisa/data/ogip.py b/src/elisa/data/ogip.py index 0ee2ba52..76e6b43c 100644 --- a/src/elisa/data/ogip.py +++ b/src/elisa/data/ogip.py @@ -691,7 +691,8 @@ def __init__(self, specfile: str, poisson: bool | None = None): # TODO: more robust way to detect a type II data # check if data is type II if not type_ii: - msg = f'row id must be provided for type II spectrum {specfile}' + msg = 'row id must be provided for type II spectrum, e.g., ' + msg += f"'{specfile}{{1}}'" nchan = len(data) if int(header.get('DETCHANS', nchan)) != nchan: