Skip to content

Commit

Permalink
revert changes in ObsInfo
Browse files Browse the repository at this point in the history
Signed-off-by: Atreyee Sinha <asinha@ucm.es>
  • Loading branch information
AtreyeeS committed Feb 2, 2024
1 parent 072bfc4 commit 4818e37
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
3 changes: 1 addition & 2 deletions gammapy/utils/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,10 +196,9 @@ class ObsInfoMetaData(MetaData):
The observation mode.
"""

model_config = ConfigDict(coerce_numbers_to_str=True)
_tag: ClassVar[Literal["obs_info"]] = "obs_info"

obs_id: str
obs_id: int
telescope: Optional[str] = None
instrument: Optional[str] = None
sub_array: Optional[str] = None
Expand Down
10 changes: 5 additions & 5 deletions gammapy/utils/tests/test_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,10 @@ def test_obs_info():
obs_info = ObsInfoMetaData(obs_id="23523")

assert obs_info.telescope is None
assert obs_info.obs_id == "23523"
assert obs_info.obs_id == 23523

obs_info.obs_id = "23523"
assert obs_info.obs_id == "23523"
obs_info.obs_id = 23523
assert obs_info.obs_id == 23523

obs_info.instrument = "CTA-North"
assert obs_info.instrument == "CTA-North"
Expand All @@ -103,7 +103,7 @@ def test_obs_info_from_header(hess_eventlist_header):
meta = ObsInfoMetaData.from_header(hess_eventlist_header, format="gadf")

assert meta.telescope == "HESS"
assert meta.obs_id == "23523"
assert meta.obs_id == 23523
assert meta.observation_mode == "WOBBLE"
assert meta.sub_array is None

Expand All @@ -113,7 +113,7 @@ def test_obs_info_to_header():

header = obs_info.to_header("gadf")

assert header["OBS_ID"] == "23523"
assert header["OBS_ID"] == 23523
assert header["TELESCOP"] == "CTA-South"
assert "OBS_MODE" not in header

Expand Down

0 comments on commit 4818e37

Please sign in to comment.