navigating-stories / orange-story-navigator

Add-on to the Orange3 data mining toolkit with text processing widgets from the project Navigating Stories
https://research-software-directory.org/projects/navigating-stories
Other
2 stars 2 forks source link

table output for actor and actions widgets #38

Closed f-hafner closed 2 weeks ago

f-hafner commented 4 months ago

This is more about usability than a bug.

Story Navigator version

0.0.18 (commit https://github.com/navigating-stories/orange-story-navigator/commit/8732988e67920716c2eef3eef0af7d6e936da74f)

Orange version

3.36.2

Expected behavior

connecting data table widget to Actors and Actions requires different settings. For actors, we do "Selected data -> Story elements", while for actions it is "Data -> story elements" (see screenshot below). This feels counterintuitive. I tried to change either of the two connections, but I then get an error similar to the one in #37

Can we use one of the two options for both?

Additional info (worksheets, data, screenshots, ...)

image

f-hafner commented 4 months ago

Clarification: when setting up a new workflow using "Data -> Story Elements" for both Actions and Actors widgets, it works fine. Then, when changing to "Selected Data -> Story elements" for Actors widgets, I get a KeyError described above. Changing back to "Data -> Story elements" does not solve the error.

kodymoodley commented 3 months ago

I suspect this is not a bug with story navigator. @f-hafner could you help me reproduce this error?

f-hafner commented 3 months ago

So, it's quite subtle. It happens when certain connections from table widget to actor widget are modified.

Consider the workflow image

in table with row selected, select one or multiple rows. leave the table in table without row selected (untouched) as-is. Now add an actor widget that takes input from the table with selected row.

when first connecting from Import Documents

   Error encountered in widget Actors:

Traceback (most recent call last):
  File "/home/flavio/repositories/projects/navigating-stories/orange-story-navigator/.venv/lib/python3.9/site-packages/Orange/widgets/utils/concurrent.py", line 591, in _on_task_done
    super()._on_task_done(future)
  File "/home/flavio/repositories/projects/navigating-stories/orange-story-navigator/.venv/lib/python3.9/site-packages/Orange/widgets/utils/concurrent.py", line 547, in _on_task_done
    self.on_exception(ex)
  File "/home/flavio/repositories/projects/navigating-stories/orange-story-navigator/orangecontrib/storynavigation/widgets/OWSNActorAnalysis.py", line 937, in on_exception
    raise ex
  File "/home/flavio/.pyenv/versions/3.9.13/lib/python3.9/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/home/flavio/repositories/projects/navigating-stories/orange-story-navigator/orangecontrib/storynavigation/widgets/OWSNActorAnalysis.py", line 612, in run
    self.valid_stories.append(self.stories[int(storyid)])
  File "/home/flavio/repositories/projects/navigating-stories/orange-story-navigator/.venv/lib/python3.9/site-packages/orangecontrib/text/corpus.py", line 549, in __getitem__
    c = super().__getitem__(key)
  File "/home/flavio/repositories/projects/navigating-stories/orange-story-navigator/.venv/lib/python3.9/site-packages/Orange/data/table.py", line 1168, in __getitem__
    return RowInstance(self, key)
  File "/home/flavio/repositories/projects/navigating-stories/orange-story-navigator/.venv/lib/python3.9/site-packages/Orange/data/table.py", line 96, in __init__
    self.id = table.ids[row_index]
IndexError: index 3 is out of bounds for axis 0 with size 3

when first connecting from table with row selected widget

when connecting from the widget table without selected (untouched)

connecting works fine either way. Modifying the connection works, too (can process the data), but it again duplicates the stories -- again similar to #44

ThijsVroegh commented 3 weeks ago

Potentially solved with #44 (fix contained in PR #71)

eriktks commented 2 weeks ago

I did not manage to reproduce this error. i can freely switch from Selected Data to Data without any problems. It is better not to have a Data Table between Elements and Actions/Actors. Then the expected links are Story elements to Story elements and there are no ambiguities.