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

Predctions crashes if workflow is open in another language #7015

Open
janezd opened this issue Feb 2, 2025 · 0 comments
Open

Predctions crashes if workflow is open in another language #7015

janezd opened this issue Feb 2, 2025 · 0 comments
Labels
bug A bug confirmed by the core team urgent Requires immediate action

Comments

@janezd
Copy link
Contributor

janezd commented Feb 2, 2025

What's wrong?

Predictions crashes with

     target = self.class_var.values.index(self.target_class)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: tuple.index(x): x not in tuple

How can we reproduce the problem?

  • Create a workflow that involves predictions. In Show perfomance scores set Target class to "(Average over classes)". Save the workflow.
  • Switch Orange to another language and restart.
  • Load the workflow. Predictions will crash.

The problem is that the "target class" is stored as literal. If Orange is initially in Slovenian, context settings may be as follows:

'values': {
    'show_probability_errors': False,
    'show_reg_errors': 1,
    'shown_probs': 0,
    'target_class': '(Povprečje prek razredov)',
    'score_table': {},
    '__version__': 2},

(Povprečje prek razredov) doesn't exist when Orange is set to English.

Orange workflows should be language independent, hence this setting must be saved as an enum, not a string literal. Settinng migration is feasible assuming that it is done within the same language in which the workflow was created.

Temporary solution

If the user finds himself in this situation, he should switch Show performance scores off and on again. This somehow resolves the state.

What's your environment?

  • Orange 3.38.1
  • macOS Sequoia
@janezd janezd added bug A bug confirmed by the core team urgent Requires immediate action labels Feb 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A bug confirmed by the core team urgent Requires immediate action
Projects
None yet
Development

No branches or pull requests

1 participant