From 4774769f2f5aedec8845aef7cb7a114031012f4e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gr=C3=B6ne=2C=20Tjark=20Leon=20Raphael?=
 <tjark.leon.raphael.groene@uni-hamburg.de>
Date: Mon, 16 Jun 2025 16:52:31 +0200
Subject: [PATCH] Update file maxwell_integrate_to_h5.py

---
 maxwell_integrate_to_h5.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/maxwell_integrate_to_h5.py b/maxwell_integrate_to_h5.py
index e636bbf..46e6eed 100644
--- a/maxwell_integrate_to_h5.py
+++ b/maxwell_integrate_to_h5.py
@@ -226,12 +226,12 @@ if __name__ == '__main__':
         raise ValueError("POLARIZATION must be a float between 0 and 1")
     if not sys.argv[7].isdigit():
         raise ValueError("NPT must be a positive integer")
-    if not sys.argv[8].isalpha():
+    if not isinstance(sys.argv[8],str):
         
         raise ValueError("UNIT must be a string representing the unit (e.g., 'q_A^-1', 'q_nm^-1', 'q_ang^-1')")
     if not sys.argv[9].isalpha():
         raise ValueError("ERRORMODE must be a string representing the error model (e.g., 'poisson', 'azimuthal', 'none')")
-    if not sys.argv[10].isalpha():
+    if not isinstance(sys.argv[10], str):
         raise ValueError("DATATYPE must be a string representing the data type (e.g., 'tif', 'tiff')")
 
         
@@ -247,7 +247,7 @@ if __name__ == '__main__':
     DATATYPE = str(sys.argv[10]).lower()
     FORBIDDEN = sys.argv[11].split(',') if len(sys.argv) > 11 else []
 
-    if DATATYPE not in {"tif", "tiff", "TIF", "TIFF"}:
+    if DATATYPE not in {".tif", ".tiff", ".TIF", ".TIFF"}:
         raise ValueError(f"Unsupported data type: {DATATYPE}")
     if UNIT not in {"q_A^-1", "q_nm^-1", "q_ang^-1"}:
         raise ValueError(f"Unsupported unit: {UNIT}")
-- 
GitLab