-
Notifications
You must be signed in to change notification settings - Fork 6
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
Add image tags to events #90
Comments
This automatically propagated the new version to update pycro-manager, and the test failed (the old one--I haven't added the new one yet) because: pycromanager\test\test_hook_functions.py:65: AssertionError
=========================== short test summary info ===========================
FAILED pycromanager/test/test_hook_functions.py::test_event_serialize_and_deserialize - AssertionError: assert {'axes': {'ch...], 'tags': {}} == {'axes': {'ch...nel', 'DAPI']}
Omitting 2 identical items, use -vv to show
Left contains 1 more item:
{'tags': {}}
Full diff:
- {'axes': {'channel': 'DAPI'}, 'config_group': ['Channel', 'DAPI']}
+ {'axes': {'channel': 'DAPI'}, 'config_group': ['Channel', 'DAPI'], 'tags': {}}
? Im guessing this is an error in the toJSON function. It adds an empty JSONobject for tags, when the expected behavior is that this does not get added if no tags are present. |
Fair enough. Just pushed a fix, not sure why it does not show here.
|
PR #92 contains this putative fix. I am unable to run these tests locally. When running the snippet you posted above, I get:
When running one of the test scripts directly, them output is empty. When running them in PyCharm, I get:
Relying on the server to run them after a merge is not really a pleasant workflow (especially considering the 10 minutes work around). |
Missing import. Need to add |
If the output is empty and the process completes, then that is a success.
This is because there are extra requirements for setting up the test environment, because the test environment is running in GH actions and it needs to download the MM nightly build and latest dependencies.
@ieivanov plans to write out in more detail how it all works at some point micro-manager/pycro-manager#608 |
Cool! That now runs, I added the test: How do I run those files in the test directory, so that I can actually edit them and create a PR? Ah, sorry, those posts crossed. Without those details, I would not really ask others to contribute to the tests. |
I'll get to documenting the testing infrastructure in the next couple of days, seems I've been putting it off long enough :) I think this PR is a great addition. A couple of related issues: |
I'm a bit confused--are you asking how do you run all the tests from an IDE like pycharm? I do this by just right clicking the file I'm changing and selecting run. Ivan just made this PR with more instructions, including the comand line way to run the tests |
Cool! That did not work earlier because of missing requirements. I still do not see the
mentioned in the documentation. Am I missing something? |
I believe this gets handled by |
That's correct. I'll add instructions also on how to runs tests in PyCharm: https://www.jetbrains.com/help/pycharm/pytest.html#run-pytest-test and VSCode: https://code.visualstudio.com/docs/python/testing#_run-tests |
Currently, it is difficult to attach information to an event to be passed onto a tagged image. For instance, I am currently faking an axis so that the DataSink can see which event was responsible for a given image. Another example is including the name of a position (which possibly can be done by passing the position list to the DataSink). In general, it seems useful for an event to be able to include arbitrary information to the image it will generate.
The most straight forward way seems to include a field "tags", possibly of type Map<String, String> to the event, with getters and setters. The Acquisition Engine then would add those to a TaggedImage as key-value pairs.
Happy to take a stab at this.
The text was updated successfully, but these errors were encountered: