|
1 |
| -import os |
2 |
| -import sys |
3 |
| -import datetime as dt |
4 |
| -import configparser |
5 |
| -import subprocess |
6 |
| -import multiprocessing |
7 |
| -import importlib # CSB-Run util functions |
8 |
| -utils = importlib.import_module('CSB-Run.utils') |
9 |
| - |
10 |
| - |
11 |
| -# get command line args, 3 minimum required, missing args None |
12 |
| -# input args: workflow, startYear and endYear |
13 |
| -args = utils.GetArgs(sys.argv) |
14 |
| - |
15 |
| -# get CSB-Run config file, default csb_default.ini |
16 |
| -print(f'Config file: {os.getcwd()}/config/csb_default.ini') |
17 |
| -cfg = utils.GetConfig('default') |
18 |
| - |
19 |
| -# set parameters for CSB-Run |
20 |
| -# cpu_count = utils.GetBatch( args[0], args[3] ) |
21 |
| - # #workflow #batchSize |
22 |
| -python_path,\ |
23 |
| -script,\ |
24 |
| -creation_dir,\ |
25 |
| -partial = utils.SetRunParams(cfg, args) |
26 |
| - |
27 |
| - |
28 |
| -# build the folders for csb creation/prep run |
29 |
| -run_dir = utils.BuildFolders(creation_dir, args[0]) |
30 |
| - #workflow |
31 |
| - |
32 |
| -# run the CSB workflow script |
33 |
| -p = subprocess.run([python_path, script, args[1], args[2], run_dir, str(partial)]) |
34 |
| - #startYear #endYear |
| 1 | +import os |
| 2 | +import sys |
| 3 | +import datetime as dt |
| 4 | +import configparser |
| 5 | +import subprocess |
| 6 | +import multiprocessing |
| 7 | +import importlib # CSB-Run util functions |
| 8 | +utils = importlib.import_module('CSB-Run.utils') |
| 9 | + |
| 10 | + |
| 11 | +# get command line args, 3 minimum required, missing args None |
| 12 | +# input args: workflow, startYear and endYear |
| 13 | +args = utils.GetArgs(sys.argv) |
| 14 | + |
| 15 | +# get CSB-Run config file, default csb_default.ini |
| 16 | +print(f'Config file: {os.getcwd()}/config/csb_default.ini') |
| 17 | +cfg = utils.GetConfig('default') |
| 18 | + |
| 19 | +# set parameters for CSB-Run |
| 20 | +# cpu_count = utils.GetBatch( args[0], args[3] ) |
| 21 | + # #workflow #batchSize |
| 22 | +python_path,\ |
| 23 | +script,\ |
| 24 | +creation_dir,\ |
| 25 | +partial = utils.SetRunParams(cfg, args) |
| 26 | + |
| 27 | + |
| 28 | +# build the folders for csb creation/prep run |
| 29 | +run_dir = utils.BuildFolders(creation_dir, args[0]) |
| 30 | + #workflow |
| 31 | + |
| 32 | +# run the CSB workflow script |
| 33 | +p = subprocess.run([python_path, script, args[1], args[2], run_dir, str(partial)]) |
| 34 | + #startYear #endYear |
0 commit comments