Skip to content

Commit

Permalink
Minor changes for pathos-multiprocessing on osx
Browse files Browse the repository at this point in the history
  • Loading branch information
geojunky committed Nov 8, 2024
1 parent e2a8641 commit 4307eb9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion seismic/ASDFdatabase/waveform_analytics.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
import os, sys

is_windows = sys.platform.startswith('win')
is_osx = sys.platform.startswith('darwin')

if(is_windows): # suppress warnings on windows
import warnings
warnings.filterwarnings('ignore', \
Expand Down Expand Up @@ -46,6 +48,7 @@
import psutil

from pathos.multiprocessing import ProcessingPool as Pool
import multiprocess
from multiprocess import Manager, freeze_support

matplotlib.use('TKAgg')
Expand Down Expand Up @@ -810,6 +813,7 @@ def get_time_range_func(net, sta, loc, cha):
if __name__ == "__main__":
# add support for process-based multiprocessing for a Windows .exe
if(is_windows): freeze_support()

if(is_osx): multiprocess.set_start_method('spawn')

groups()
# end func

0 comments on commit 4307eb9

Please sign in to comment.