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

Fix #62 #63

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Fix #62 #63

wants to merge 1 commit into from

Conversation

rajkundu
Copy link
Contributor

This PR fixes #62 by adding the parallel probe configuration option. When configuration['parallel probe'] = True, concurrent.futures is imported, and concurrent.futures.ProcessPoolExecutor is used to simultaneously probe serial ports. Rather than check ports sequentially, this option allows _get_serial_port_name to return as soon as an NDI device is found on any serial port.

So far, this change has only been tested on an Intel MacBook Pro running macOS 12.5.

@thompson318
Copy link
Collaborator

Thanks @rajkundu, this looks a useful addition in principle. Ideally I'd like to see the change accompanied with a unit test so we don't drop code coverage. That should also help us no if it runs OK on Linux and Windows when it goes trough github actions. Do you think you can have a go at implementing that?

@rajkundu
Copy link
Contributor Author

I haven't written any before, but I have always wanted to learn, so sure - I'll try my best!

@thompson318
Copy link
Collaborator

OK, thanks. Please have a try and I'll be happy to help. You should be able to turn on github actions on your fork so you can see the test results each time you push.
Testing for this library is a little tricky as we don't have access to a continuous integration machine connected to an nditracker, so we make extensive use of Python's mock library. That enables us to create a mock version of ndicapy that returns what we need to test. I'd suggest you start with the file tests/test_sksurgerynditracker_mockndi_polaris.py, copy it and modify the settings to add "parallel probe", and see what happens.

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.

Simultaneously Probe Serial Ports for NDI devices
2 participants