icecube-skyreader 1.2.3__tar.gz → 1.2.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: icecube-skyreader
3
- Version: 1.2.3
3
+ Version: 1.2.4
4
4
  Summary: An API for Results Produced by SkyDriver & the Skymap Scanner
5
5
  Home-page: https://github.com/icecube/skyreader
6
6
  Download-URL: https://pypi.org/project/icecube-skyreader/
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: icecube-skyreader
3
- Version: 1.2.3
3
+ Version: 1.2.4
4
4
  Summary: An API for Results Produced by SkyDriver & the Skymap Scanner
5
5
  Home-page: https://github.com/icecube/skyreader
6
6
  Download-URL: https://pypi.org/project/icecube-skyreader/
@@ -17,7 +17,7 @@ __all__ = [
17
17
  # is zero for an official release, positive for a development branch,
18
18
  # or negative for a release candidate or beta (after the base version
19
19
  # number has been incremented)
20
- __version__ = "1.2.3"
20
+ __version__ = "1.2.4"
21
21
  version_info = (
22
22
  int(__version__.split(".")[0]),
23
23
  int(__version__.split(".")[1]),
@@ -537,7 +537,14 @@ class SkyScanResult:
537
537
  for key in nside_data.dtype.metadata:
538
538
  # dtype.metadata is a mappingproxy (dict-like) containing numpy-typed values
539
539
  # convert numpy types to python bultins to be JSON-friendly
540
- pydict[nside]['metadata'][key] = nside_data.dtype.metadata[key].item()
540
+ val = nside_data.dtype.metadata[key]
541
+ if isinstance(val, np.generic):
542
+ # numpy type, non serializable
543
+ # convert to python built-in by calling item()
544
+ pydict[nside]['metadata'][key] = nside_data.dtype.metadata[key].item()
545
+ else:
546
+ # likely a natively serializable python built-in
547
+ pydict[nside]['metadata'][key] = val
541
548
  return pydict
542
549
 
543
550
  """