Skip to content

Commit

Permalink
Merge pull request #1717 from HEXRD/invalidate-grains-table
Browse files Browse the repository at this point in the history
Invalidate grains table for failed clustering
  • Loading branch information
psavery authored Jul 23, 2024
2 parents d6ce875 + 6c5e8a4 commit 137adb2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions hexrdgui/indexing/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,7 @@ def generate_grains_table(self):
num_grains = self.qbar.shape[1]
if num_grains == 0:
print('No grains found')
self.grains_table = None
return

plural = 's' if num_grains != 1 else ''
Expand Down
6 changes: 5 additions & 1 deletion hexrdgui/rerun_clustering_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from pathlib import Path

from PySide6.QtWidgets import QDialog, QFileDialog
from PySide6.QtCore import Qt
from PySide6.QtCore import QTimer, Qt

from hexrdgui.async_worker import AsyncWorker
from hexrdgui.hexrd_config import HexrdConfig
Expand Down Expand Up @@ -89,6 +89,10 @@ def on_finished():
runner.accept_progress()
runner.confirm_indexing_results()

if runner.grains_table is None:
# The previous step must have failed. Show again.
QTimer.singleShot(0, self.exec)

def on_rejected():
# Since this is a QueuedConnection, we need to accept progress here
runner.accept_progress()
Expand Down

0 comments on commit 137adb2

Please sign in to comment.