ESA-PhiLab / Major-TOM

Expandable Datasets for Earth Observation
https://huggingface.co/Major-TOM
141 stars 11 forks source link

Error in viewer app #2

Closed robmarkcole closed 7 months ago

robmarkcole commented 7 months ago

Not sure how I did this, but I was going between L2A-1C:

Traceback (most recent call last):
  File "/home/user/.local/lib/python3.11/site-packages/reacton/ipyvue.py", line 23, in handler
    callback_ref.current(*args)
  File "/home/user/.local/lib/python3.11/site-packages/solara/components/button.py", line 84, in <lambda>
    ipyvue.use_event(btn, click_event, lambda *_ignore: on_click and on_click())
                                                                     ^^^^^^^^^^
  File "/app.py", line 54, in update_image
    ret = map_to_image(m, return_centre=True, return_gridcell=True, l2a=(s2_level.value=='L2A'))
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/helpers/functional.py", line 72, in map_to_image
    bbox = map.get_bbox()
           ^^^^^^^^^^^^^^
  File "/home/user/.local/lib/python3.11/site-packages/leafmap/leafmap.py", line 4324, in get_bbox
    bbox = [bounds[0][1], bounds[0][0], bounds[1][1], bounds[1][0]]
            ~~~~~~^^^
IndexError: tuple index out of range
mikonvergence commented 7 months ago

We've spotted this recently - usually happens after multiple clicks in a row.

Should be simple to fix, so hopefully we can update that soon!

Thanks for bringing this up!

mikonvergence commented 7 months ago

@robmarkcole - it should work now! (the app view will reset if too many multiple find sample are called at the same time)