-
Notifications
You must be signed in to change notification settings - Fork 52
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
Allow relative z in multi_d_acquisition_events #158
Conversation
A couple things:
|
Also, yes, it would be great to some more stuff built into automatic testing. That test directory is not automated at the moment, I just copy and paste them to quickly debug when I think things are broken. @bryantChhun has also been thinking about adding automated testing. Maybe better to continue this conversation on the issue for it |
I'm not sure I understand what the order is meant to be. Is it chronological? Also, if anything this notebook is more of a tutorial than an application, would it make sense to fold it into the page on MDAs?
I was probably doing some premature optimization here, the current setup allows for different non-uniform stepped z stacks for each positions. So you could have but that's probably not necessary to include. To be explicit you're proposing the following call signatures: # Gives relative z
multi_d_acquisition_events(xyz_positions = xyz)
multi_d_acquisition_events(xyz_positions = xyz, z_start=-1, z_stop = 1, z_step=1)
# absolute z
multi_d_acquisition_events(z_start=0, z_stop=10,z_step=1)
multi_d_acquisition_events(xy_positions = xy, z_start=0, z_stop=10,z_step=1) I'd suggest adding the option of an array of relative z values: multi_d_acquisition_events(xyz_positions = xyz, z_rel = np.linspace(-1,1,3)) The only downsides I see are:
|
Vaguely scales with complexity. Either position in the ordering is fine, you've just got it first in the TOC but second on the actual list right now (or vice versa). I think given the density of it, it makes more sense to have it with applications.
Makes sense. Generally speaking I don't think its worth the effort to try to get every edge case into this function, since for customized stuff you should probably just be going a level deeper and creating events manually anyway. In my mind z-stacks with custom nonuniform step spacing would fall under this
Yeah exactly. Or maybe a
I think its better to make an example of doing this manually than to have an explicit option. The purpose of this function is a a convenience for people who dont want to dig any deeper into the API, so I think the fewer ways of doing things, the better
Maybe this is an argument for
Fine to just throw in an exception in the cases that it doesnt make sense |
58766a6
to
8f3d320
Compare
@henrypinkard I think this is good now. I ended up adding github actions to run the pytest tests I added for MDA, but I think you need to change a setting to get them to run on PRs. I opened a PR against my fork and the tests all ran there: ianhi#1 I think you need to modify these settings: |
I went for raising errors rather than adding yet more kwargs.
sounds good! It indeed simplified it greatly.
In a moment of forgiveness is better than permission I went ahead and greated github actions + pytest tests for the content of this PR. Testing the actual functionality of the integration with μmanager would be much more complex though so I'll leave that to the other issue. pytest supports multiple test directories and I think its pretty standard to have one inside the |
z_positions = xyz_positions[:,2][:, None] | ||
|
||
if has_zsteps: | ||
z_rel = np.arange(z_start, z_end + z_step, z_step) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This includes one more point than the old version. To me this way make more sense but it is clearly backwards incompatible.. let me know if you'd prefer this to be
z_rel = np.arange(z_start, z_end + z_step, z_step) | |
z_rel = np.arange(z_start, z_end, z_step) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I think that's fine and probably an upgrade
no worries! I didn't do much other than add some mocks and a couple tests. Will create a PR soon. And in general, I never discourage anyone from writing tests for their code :-) There was a discussion by email about the more complex testing with umanager (apologies, we agreed we'll move those discussions to github issues). The general conclusion was that other umanager work (release of 2.0) is taking priority. Continuous Integration with micromanager will require solving some issues in the 2.1 release.. |
I looked on the settings but it was the same as the picture you posted -- allow all actions was already selected. |
Any other ideas on how to set it up like you had in that link? |
See #162. looks as though the tests work on newly created PR |
Closes: #153
This should maintain all the previous behaviors but also allow for specifying z positions in these new ways:
which is hopefully made clear in the new docs page I added for this.
Stuff like this is a great candidate for pytest, I thought about adding that but didn't becuase you already have a large user automated testing DIR that I wasn't sure would work with pytest on CI. Let me know what would be best