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

TimeBlock types #34

Merged
merged 6 commits into from
Oct 30, 2024
Merged

Conversation

KrisThielemans
Copy link
Contributor

This PR introduces different types of TimeBlocks, one for coincidence/triple events, one for external signals, one for bed movement and one for gantry movement.

Having different types makes sure that we can have different time resolution for the different types, e.g. different external signals will have different sampling rates etc.

We have chosen to signals to be a union of different types as well. Alternatively, we could have introduced different types of signalTimeBlock. However, that seems to need more if statements in the main loop (one for every signal-type), which could be more wasteful and less future proof, but maybe it's just a matter of taste...

@KrisThielemans KrisThielemans added the enhancement New feature or request label Oct 26, 2024
@KrisThielemans KrisThielemans self-assigned this Oct 26, 2024
@KrisThielemans KrisThielemans changed the title Time blocks TimeBlock types Oct 26, 2024
Comment on lines +170 to +176
(
petsird.TimeBlock.EventTimeBlock(
petsird.EventTimeBlock(
start=start, prompt_events=prompts_this_block
)
),
)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This syntax works, but is a bit awkward. @johnstairs can this be simplified? (I didn't find any doc on creating unions at https://microsoft.github.io/yardl/python/language.html#generated-union-types)

@KrisThielemans KrisThielemans merged commit fd6b833 into ETSInitiative:main Oct 30, 2024
1 check passed
@KrisThielemans KrisThielemans deleted the TimeBlocks branch October 30, 2024 00:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant