PsychoinformaticsLab / pliers

Automated feature extraction in Python
https://pliers.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
296 stars 68 forks source link

Handle missing concepts more gracefully #493

Open adelavega opened 6 months ago

adelavega commented 6 months ago

This error happens when a selected_concept is passed to Clarifai which does not get found in the stimuli

  File "/home/zorro/anaconda3/envs/pliers/lib/python3.12/site-packages/pliers/extractors/base.py", line 19, in transform
    result = super().transform(stim, *args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/zorro/anaconda3/envs/pliers/lib/python3.12/site-packages/pliers/transformers/base.py", line 56, in wrapper
    result = transform(self, stim, *args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/zorro/anaconda3/envs/pliers/lib/python3.12/site-packages/pliers/transformers/base.py", line 105, in transform
    iters = self._iterate(stims, validation=validation, *args,
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/zorro/anaconda3/envs/pliers/lib/python3.12/site-packages/pliers/transformers/base.py", line 259, in _iterate
    result = batch_results[target_inds[key]]
             ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^