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

[SDEV-1916] fix pre calibration failure stops the acquisition #2985

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

nandishjpatel
Copy link
Contributor

NOTE: This PR depends on #2972

[feat] allow skipping roa acquisition in case of failure

Updates:

  • The status text in the ROA window of the project tree will show "Open", "Skipped", "Failed" and respective colour
  • Added autostigmation and autofocus period in the Acquisition panel; previously it was in the acquisition.config file
  • Added a checkbox Stop acquisition on failure which helps is skipping roa acquisition in case of failure

Screenshot from 2024-12-20 09-37-59

Cancelled
Screenshot from 2024-12-20 09-40-53

Stop acquisition on failure checked (Exception is raised in autostigmation)
Screenshot from 2024-12-20 09-44-16

Stop acquisition on failure un-checked (Exception is raised in autostigmation)
Screenshot from 2024-12-20 09-46-38

@nandishjpatel nandishjpatel force-pushed the SDEV-1916-fix-pre-calibration-failure-stops-the-acquisition branch 3 times, most recently from a7b88e5 to 842a560 Compare December 20, 2024 09:32
@tepals
Copy link
Contributor

tepals commented Jan 8, 2025

@nandishjpatel can you resolve the conflicts in this PR?

Updates:
- The status text in the ROA window of the project tree will show "Open", "Skipped", "Failed" and respective colour
- Added autostigmation and autofocus period in the Acquisition panel; previously it was in the acquisition.config file
- Added a checkbox `Stop acquisition on failure` which helps is skipping roa acquisition in case of failure
@nandishjpatel nandishjpatel force-pushed the SDEV-1916-fix-pre-calibration-failure-stops-the-acquisition branch from 842a560 to 47b50d7 Compare January 8, 2025 11:27
@nandishjpatel
Copy link
Contributor Author

@nandishjpatel can you resolve the conflicts in this PR?

Done :)

@@ -84,6 +84,11 @@
}


class ROASkipped(Exception):
def __init__(self, message):
super().__init__(message)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you log why the ROA is skipped?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree, will add the reason to the message and then log it as well

exc_info=True)
exception = ex # let the caller handle the exception
else:
exception = ROASkipped(f"Skipped the ROA {self._roa.shape.name.value}")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you decide to return the ROASkipped exception and not deal with it similar to how we deal with CancelledError?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All ROAs ProgressiveFuture are run in a ProgressiveBatchFuture. If any ProgressiveFuture raises an exception inside the ProgressiveBatchFuture all subsequent ProgressiveFuture will be cancelled. That's why I don't raise the ROASkipped and just return it to be later handled for the project tree status.

See here:

ex = f.exception() # raises CancelledError if cancelled, otherwise returns error

@nandishjpatel nandishjpatel requested a review from tepals January 24, 2025 10:54
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

Successfully merging this pull request may close these issues.

2 participants