Skip to content

Commit

Permalink
Try to make write more robust to float128 errors in FITS
Browse files Browse the repository at this point in the history
  • Loading branch information
matteobachetti committed Sep 19, 2023
1 parent c270b10 commit 48a1a29
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions stingray/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ def write(self, filename: str, fmt: str = None) -> None:
os.unlink(probe_file)
raise ValueError("float128")
except ValueError as e:
if not "float128" in str(e): # pragma: no cover
if "float128" not in str(e): # pragma: no cover
raise
warnings.warn(
f"{fmt} output does not allow saving metadata at maximum precision. "
Expand All @@ -525,7 +525,7 @@ def write(self, filename: str, fmt: str = None) -> None:
os.unlink(probe_file)
CAN_SERIALIZE_META = True
except TypeError as e:
if not "serialize_meta" in str(e):
if "serialize_meta" not in str(e):
raise
warnings.warn(
f"{fmt} output does not serialize the metadata at the moment. "
Expand Down

0 comments on commit 48a1a29

Please sign in to comment.