From c02676b81d0c82a15c491df86cfbacafe39a9241 Mon Sep 17 00:00:00 2001 From: ben decker Date: Thu, 24 Oct 2024 11:15:27 -0600 Subject: [PATCH] enable TREElement.to_dict() to handle floating-point values --- sarpy/io/general/nitf_elements/tres/tre_elements.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sarpy/io/general/nitf_elements/tres/tre_elements.py b/sarpy/io/general/nitf_elements/tres/tre_elements.py index 487ed0de..cc55ff3c 100644 --- a/sarpy/io/general/nitf_elements/tres/tre_elements.py +++ b/sarpy/io/general/nitf_elements/tres/tre_elements.py @@ -174,7 +174,7 @@ def to_dict(self): out = OrderedDict() for fld in self._field_ordering: val = getattr(self, fld) - if val is None or isinstance(val, (bytes, str, int)): + if val is None or isinstance(val, (bytes, str, int, float)): out[fld] = val elif isinstance(val, TREElement): out[fld] = val.to_dict()