Skip to content

Commit

Permalink
Allow parallel processing only on Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
wpreimes committed Jan 12, 2024
1 parent b0674ac commit 1da0170
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/repurpose/img2ts.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import sys
import warnings

from repurpose.process import parallel_process_async, idx_chunks
import pynetcf.time_series as nc
from pygeogrids.grids import CellGrid
Expand Down Expand Up @@ -193,7 +196,12 @@ def __init__(self,
self.timekey = None # to be set when reading data

# Multiprocessing only used when n_proc > 1 chosen
self.n_proc = n_proc
if sys.platform != "linux" and n_proc != 1:
warnings.warn("Parallel processing is for now only supported "
"on Linux. Setting `n_proc=1`.")
self.n_proc = 1
else:
self.n_proc = n_proc

def _read_image(self, date, target_grid):
"""
Expand Down

0 comments on commit 1da0170

Please sign in to comment.