-
Notifications
You must be signed in to change notification settings - Fork 3
/
start_with_pycharm.py
36 lines (27 loc) · 1 KB
/
start_with_pycharm.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
""" starting code
"""
import multiprocessing
from functools import partial
import time
import warnings
import pyowc as owc
warnings.filterwarnings("ignore", category=RuntimeWarning)
if __name__ == '__main__':
FLOAT_NAMES = ["3901960"] # add float names here
USER_CONFIG = owc.configuration.load() # fetch the default configuration and parameters
print(owc.configuration.print_cfg(USER_CONFIG))
start = time.time()
pool = multiprocessing.Pool(multiprocessing.cpu_count() - 1)
func = partial(owc.calibration.update_salinity_mapping, "/", USER_CONFIG)
pool.map(func, FLOAT_NAMES)
pool.close()
pool.join()
end = time.time()
print("\nTOTAL TIME ELAPSED: ", end - start)
# loop for sequential run
for flt in FLOAT_NAMES:
owc.configuration.set_calseries("/", flt, USER_CONFIG)
owc.calibration.calc_piecewisefit("/", flt, USER_CONFIG)
owc.dashboard("/", flt, USER_CONFIG)
mid = time.time()
print("Time for float: ", mid - start)