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

initial commit #560

Closed

Conversation

ZohebShaikh
Copy link
Contributor

No description provided.

@ZohebShaikh ZohebShaikh force-pushed the 549-support-multi-run-in-standarddetectorprepare branch from a4c2043 to e54b389 Compare September 6, 2024 13:09
Copy link
Contributor

@DiamondJoseph DiamondJoseph left a comment

Choose a reason for hiding this comment

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

comments on draft

Comment on lines +68 to +71
#: The number of times the detector can go through a complete cycle of kickoff and
#: complete without needing to re-arm. This is important for detectors where the
#: process of arming is expensive in terms of time
iteration: int = 0
Copy link
Contributor

Choose a reason for hiding this comment

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

iterations or max_iterations may be slightly clearer?

can go through or will?

Copy link
Contributor

Choose a reason for hiding this comment

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

This field also appears to not be used yet?

@@ -73,32 +77,36 @@ class DetectorControl(ABC):
arming and disarming a detector
"""

_arm_status = AsyncStatus
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
_arm_status = AsyncStatus
_arm_status: AsyncStatus | None

This does require that all subclasses of DetectorControl have this field, and that it is this type. As arm is abstract, and we're leaving implementation to the implementations I'd avoid having any required fields like this.

Args:
num: Expected number of frames
TriggerInfo which contains
Copy link
Contributor

Choose a reason for hiding this comment

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

Update to the new prepare params

@abstractmethod
async def arm(self):
"""
Arm the detector and save the status of arm in _arm_status
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Arm the detector and save the status of arm in _arm_status
Arm the detector

assert self._trigger_info, "Trigger Info cannot be none after prepare"
assert (
self._trigger_info.trigger == DetectorTrigger.internal
), "It can only be triggered for internal trigger"
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
), "It can only be triggered for internal trigger"
), "Cannot internally trigger with {self._trigger_info.trigger}"

trigger=self._trigger_info.trigger,
exposure=self._trigger_info.livetime,
)
if value.trigger != DetectorTrigger.internal:
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
if value.trigger != DetectorTrigger.internal:
if value.trigger is not DetectorTrigger.internal:

Should use is for enums

@ZohebShaikh
Copy link
Contributor Author

closed as duplicate #568

@ZohebShaikh ZohebShaikh deleted the 549-support-multi-run-in-standarddetectorprepare branch September 16, 2024 12:52
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