Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KeyError: 3 in Upload subjects to Zooniverse when trying to compare modified clip to original clip #424

Open
Bergylta opened this issue Aug 21, 2024 · 0 comments
Assignees
Labels
bug Something isn't working GU Support

Comments

@Bergylta
Copy link
Collaborator

🐛 Bug

getting a KeyError: 3 (has gotten 1 and 2 too) when trying to compare modified clip to original clip example

To Reproduce (REQUIRED)

Input:

kso_widgets.compare_clips(
    example_clips=pp.generated_clips.clip_path,
    modified_clips=pp.generated_clips.clip_example_original_path,
)

Select original clip: /tmp/transect_rig_2_27_10.mp4_zooniverseclips/transect_rig_2_27_10.mp4_clip_example_original_402_10.mp4

Output:

---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
[~/.local/lib/python3.10/site-packages/pandas/core/indexes/base.py](https://album.cloudina.org/user/kso-user/lab/tree/kso/notebooks/classify/~/.local/lib/python3.10/site-packages/pandas/core/indexes/base.py) in get_loc(self, key, method, tolerance)
   3801             try:
-> 3802                 return self._engine.get_loc(casted_key)
   3803             except KeyError as err:

[~/.local/lib/python3.10/site-packages/pandas/_libs/index.pyx](https://album.cloudina.org/user/kso-user/lab/tree/kso/notebooks/classify/~/.local/lib/python3.10/site-packages/pandas/_libs/index.pyx) in pandas._libs.index.IndexEngine.get_loc()

[~/.local/lib/python3.10/site-packages/pandas/_libs/index.pyx](https://album.cloudina.org/user/kso-user/lab/tree/kso/notebooks/classify/~/.local/lib/python3.10/site-packages/pandas/_libs/index.pyx) in pandas._libs.index.IndexEngine.get_loc()

[~/.local/lib/python3.10/site-packages/pandas/_libs/index.pyx](https://album.cloudina.org/user/kso-user/lab/tree/kso/notebooks/classify/~/.local/lib/python3.10/site-packages/pandas/_libs/index.pyx) in pandas._libs.index.IndexEngine._get_loc_duplicates()

KeyError: 3

The above exception was the direct cause of the following exception:

KeyError                                  Traceback (most recent call last)
/cache/album/cache/kso-user/kso/kso_utils/widgets.py in on_change(change)
   1422                 logging.info("It is OK to modify the clips again")
   1423             else:
-> 1424                 a = view_clips(example_clips, modified_clips, change["new"])
   1425                 display(a)
   1426 

/cache/album/cache/kso-user/kso/kso_utils/widgets.py in view_clips(example_clips, modified_clips, modified_clip_selected)
   1370 
   1371     # Get the path of the original clip based on the selected modified clip
-> 1372     example_clip_selected = example_clips[
   1373         modified_clips.tolist().index(modified_clip_selected)
   1374     ]

[~/.local/lib/python3.10/site-packages/pandas/core/series.py](https://album.cloudina.org/user/kso-user/lab/tree/kso/notebooks/classify/~/.local/lib/python3.10/site-packages/pandas/core/series.py) in __getitem__(self, key)
    979 
    980         elif key_is_scalar:
--> 981             return self._get_value(key)
    982 
    983         if is_hashable(key):

[~/.local/lib/python3.10/site-packages/pandas/core/series.py](https://album.cloudina.org/user/kso-user/lab/tree/kso/notebooks/classify/~/.local/lib/python3.10/site-packages/pandas/core/series.py) in _get_value(self, label, takeable)
   1087 
   1088         # Similar to Index.get_value, but we do not fall back to positional
-> 1089         loc = self.index.get_loc(label)
   1090         return self.index._get_values_for_loc(self, loc, label)
   1091 

[~/.local/lib/python3.10/site-packages/pandas/core/indexes/base.py](https://album.cloudina.org/user/kso-user/lab/tree/kso/notebooks/classify/~/.local/lib/python3.10/site-packages/pandas/core/indexes/base.py) in get_loc(self, key, method, tolerance)
   3802                 return self._engine.get_loc(casted_key)
   3803             except KeyError as err:
-> 3804                 raise KeyError(key) from err
   3805             except TypeError:
   3806                 # If we have a listlike key, _check_indexing_error will raise

KeyError: 3

Expected behavior

Additional context

Could this be due to the previous KeyError: site_id that is still unresolved?
Also, a different error shows up when not doing any modifications, kind of expected?
the different error:
image_2024-08-21_111811170

@Bergylta Bergylta added the bug Something isn't working label Aug 21, 2024
@jannesgg jannesgg removed their assignment Aug 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working GU Support
Projects
None yet
Development

No branches or pull requests

3 participants