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

Error when RESULT order is the ORIGINAL order #46

Open
tomasfelcman opened this issue Nov 10, 2023 · 0 comments
Open

Error when RESULT order is the ORIGINAL order #46

tomasfelcman opened this issue Nov 10, 2023 · 0 comments

Comments

@tomasfelcman
Copy link
Contributor

Hi, I have been playing around with optimus-py and I was getting an error in some intermittent case:

Traceback (most recent call last):
  File "/_install_pathPython/optimus-py-master/optimuspy.py", line 300, in <module>
    success = main(
  File "/_install_pathPython/optimus-py-master/optimuspy.py", line 221, in main
    optimus_result.to_png(
  File "/_install_pathPython/optimus-py-master/results.py", line 187, in to_png
    df = self.to_dataframe(view_name, process_name)
  File "/_install_pathPython/optimus-py-master/results.py", line 146, in to_dataframe
    rows.append(result.to_row(view_name, process_name, self.original_order_result))
  File "/_install_pathPython/optimus-py-master/results.py", line 96, in to_row
    original_median_query_time = float(original_order_result.median_query_time(view_name))
AttributeError: 'NoneType' object has no attribute 'median_query_time'

I traced it back to the case when optimal order is the original orded. IMHO it is due to replacement of permutation_result.mode:
results.py: line 140: permutation_result.mode = executors.ExecutionMode.RESULT

I think sufficient would be to add condition for result not being ORIGINAL_ORDER:
if permutation_result.permutation_id == self.best_result.permutation_id **and permutation_result.mode != executors.ExecutionMode.ORIGINAL_ORDER**: permutation_result.is_best = True permutation_result.mode = executors.ExecutionMode.RESULT

I will create Pull request for that...

Thanks,
Tomas

tomasfelcman added a commit to tomasfelcman/optimus-py that referenced this issue Nov 10, 2023
MariusWirtz pushed a commit that referenced this issue Nov 24, 2023
See #46 for detail
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant