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

feat: add sequence to Position object + update MDASequence iter_sequence + test [WIP] #81

Merged
merged 86 commits into from
Feb 28, 2023

Conversation

fdrgsp
Copy link
Contributor

@fdrgsp fdrgsp commented Feb 3, 2023

This PR introduces a possible way to add an optional MDASequence to the Position object (instead of only the z_plan option) so that specific axes events (t, z, c or g) can be executed only for a specific position. It also updates the MDASequence iter_sequence method to take this Position sequence into account.

marge after #80

Copy link
Member

@tlambert03 tlambert03 left a comment

Choose a reason for hiding this comment

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

i think I'm still looking for something a bit more obvious explicit in the tests here: For example, it might reflect the conversation we were having.

i.e.

# test that z positions are overridden (position 1), 
# relatively shifted (position 2),
# or inherited from the parent sequence (position 3). 
MDASequence(
    z_plan={"top": 60, "bottom": 55, "step": 1},
    stage_positions=[
        {"x": 40, "y": 50, "z": 60, "sequence": {"z_plan": {"top": 20, "bottom": 0}}},
        {"x": 60, "y": 70, "z": 80, "sequence": {"z_plan": {"range": 20, "step": 0.5}}},
        {"x": 10, "y": 20, "z": 30},
    ],
)

... and you can do a similar thing for channel, grid, etc...

@fdrgsp fdrgsp changed the title feat: add sequence to Position object + update MDASequence iter_sequence + test feat: add sequence to Position object + update MDASequence iter_sequence + test [WIP] Feb 27, 2023
src/useq/_mda_sequence.py Show resolved Hide resolved
src/useq/_mda_sequence.py Outdated Show resolved Hide resolved
tests/test_position_sequence.py Show resolved Hide resolved
Copy link
Member

@tlambert03 tlambert03 left a comment

Choose a reason for hiding this comment

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

awesome work here @fdrgsp!

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.

None yet

3 participants