icecube / skyreader

An API for Results Produced by SkyDriver & the Skymap Scanner
MIT License
0 stars 0 forks source link

Serialization Casting Bug #18

Closed ric-evans closed 1 year ago

ric-evans commented 1 year ago

With the latest release, I'm seeing the following:

Traceback (most recent call last):
  File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/local/skymap_scanner/server/__main__.py", line 6, in <module>
    start_scan.main()
  File "/local/skymap_scanner/server/start_scan.py", line 731, in main
    asyncio.run(
  File "/usr/lib/python3.10/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/usr/lib/python3.10/asyncio/base_events.py", line 646, in run_until_complete
    return future.result()
  File "/local/skymap_scanner/server/start_scan.py", line 372, in scan
    await reporter.after_computing_report()
  File "/local/skymap_scanner/server/reporter.py", line 565, in after_computing_report
    result = await self._send_result()
  File "/local/skymap_scanner/server/reporter.py", line 613, in _send_result
    serialized = result.serialize()
  File "/usr/local/lib/python3.10/dist-packages/skyreader/result.py", line 540, in serialize
    pydict[nside]['metadata'][key] = nside_data.dtype.metadata[key].item()
AttributeError: 'int' object has no attribute 'item'
mlincett commented 1 year ago

Tentatively fixed with #19 although I am not sure how to add a test for this circumstance in this repo.

This convinces me even more that we should consider solving #15 and abandon .dtype.metadata.