Skip to content

Commit 5cc9ede

Browse files
committed
added underscore to function definition _parallel_client
1 parent b4a537c commit 5cc9ede

File tree

1 file changed

+28
-24
lines changed

1 file changed

+28
-24
lines changed

OceanLab/utils.py

Lines changed: 28 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -5,30 +5,7 @@
55
import dask
66
from dask.distributed import Client, progress
77

8-
##### Functions
9-
# =============================================================================
10-
# KERNEL FOR PARALLEL COMPUTING
11-
# =============================================================================
12-
def parallel_client(cpu_params=dict(tpw=2,nw=4,ml=7.5)):
13-
"""
14-
Create client kernel for parallel computing
15-
====================================================
16-
INPUT:
17-
-> cpu_params: dict containing floats with keys
18-
-> tpw: threads_per_worker
19-
-> nw: n_workers
20-
-> ml: memory_limit per worker [GB]
21-
OUTPUT:
22-
-> client: configuration of parallel computing
23-
====================================================
24-
"""
25-
26-
client = Client(threads_per_worker=cpu_params['tpw'],
27-
n_workers=cpu_params['nw'],
28-
memory_limit=str(cpu_params['ml'])+'GB')
29-
return client
30-
#=============================================================================
31-
8+
##### User functions
329
#=============================================================================
3310
# NEAREST DISTANCE
3411
#=============================================================================
@@ -156,3 +133,30 @@ def timefilter(prop,filtdays=60):
156133

157134
return m_prop,p_prop
158135
#=============================================================================
136+
137+
##### Functions for relative imports
138+
# =============================================================================
139+
# KERNEL FOR PARALLEL COMPUTING
140+
# =============================================================================
141+
def _parallel_client(cpu_params=dict(tpw=2,nw=4,ml=7.5)):
142+
"""
143+
Create client kernel for parallel computing
144+
====================================================
145+
INPUT:
146+
-> cpu_params: dict containing floats with keys
147+
-> tpw: threads_per_worker
148+
-> nw: n_workers
149+
-> ml: memory_limit per worker [GB]
150+
OUTPUT:
151+
-> client: configuration of parallel computing
152+
====================================================
153+
"""
154+
155+
client = Client(threads_per_worker=cpu_params['tpw'],
156+
n_workers=cpu_params['nw'],
157+
memory_limit=str(cpu_params['ml'])+'GB')
158+
return client
159+
#=============================================================================
160+
161+
162+

0 commit comments

Comments
 (0)