creare-com / podpac

Pipeline for Observational Data Processing Analysis and Collaboration
https://podpac.org
Apache License 2.0
45 stars 6 forks source link

Use global context for pyproj when single-threaded #487

Open rmeyers4 opened 3 years ago

rmeyers4 commented 3 years ago

Description There is quite a bit of overhead involved when creating pyproj CRS objects, which podpac does in many places (validating coordinates, transforming coordinates, etc). If podpac is running single-threaded, creating CRS objects is much, much faster when global context is enabled.

Describe the solution you'd like Check Podpac settings for MULTITHREADING. If false, enable pyproj global context as part of PODPAC initialization. See https://pyproj4.github.io/pyproj/stable/api/global_context.html#pyproj.set_use_global_context. Sample Code

if not podpac.settings['MULTITHREADING']:
    pyproj.set_use_global_context(True)

Additional context Add any other context or screenshots about the feature request here.