openslide / openslide-python

Python bindings to OpenSlide
https://openslide.org/
GNU Lesser General Public License v2.1
374 stars 183 forks source link

examples/deepzoom: parallelize `deepzoom_tile` to available CPUs #297

Closed bgilbert closed 4 weeks ago

bgilbert commented 4 weeks ago

On Python 3.13+, and on all Python versions on Linux, set the default job count to the number of available CPUs. Otherwise, default to 4 jobs as before.

Also: if OpenSlide Python is type-checked on Windows, os.add_dll_directory() will exist and mypy will complain. Add an extra ignore to fix this. Mypy understands conditionalizing on sys.platform but not on os.name, and we want the latter because it exactly corresponds to whether the function exists.

openslide-bot commented 4 weeks ago

DCO signed off :heavy_check_mark:

All commits have been signed off. You have certified to the terms of the Developer Certificate of Origin, version 1.1. In particular, you certify that this contribution has not been developed using information obtained under a non-disclosure agreement or other license terms that forbid you from contributing it under the GNU Lesser General Public License, version 2.1.