Skip to content

Commit

Permalink
Bug fix in LAMDA_stats_workflow.py that was missing main (#106)
Browse files Browse the repository at this point in the history
* main now added and runs successfully

* added requirements
  • Loading branch information
kevindougherty-noaa authored Nov 17, 2021
1 parent c976fbd commit d94e92c
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 3 deletions.
6 changes: 3 additions & 3 deletions LAMDA/scripts/LAMDA_mapping_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,11 @@ def workflow(data_config, plotting_config, nprocs, outdir='./'):
ap.add_argument("-n", "--nprocs",
help="Number of tasks/processors for multiprocessing",
type=int, default=1)
ap.add_argument("-d", "--data_yaml",
ap.add_argument("-d", "--data_yaml", required=True,
help="Path to yaml file with diag data")
ap.add_argument("-p", "--plotting_yaml",
ap.add_argument("-p", "--plotting_yaml", required=True,
help="Path to yaml file with plotting info")
ap.add_argument("-o", "--outdir",
ap.add_argument("-o", "--outdir", default='./',
help="Out directory where files will be saved")

myargs = ap.parse_args()
Expand Down
21 changes: 21 additions & 0 deletions LAMDA/scripts/LAMDA_stats_workflow.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import argparse
import yaml
import glob
import os
Expand Down Expand Up @@ -196,3 +197,23 @@ def stats_workflow(config_yaml, nprocs, outdir):
p = Pool(processes=nprocs)
p.map(partial(plotting, data_dict=data_dict, outdir=outdir,
ob_type=ob_type, data_type=data_type), work_list)


if __name__ == '__main__':
# Parse command line
ap = argparse.ArgumentParser()
ap.add_argument("-n", "--nprocs",
help="Number of tasks/processors for multiprocessing",
type=int, default=1)
ap.add_argument("-s", "--stats_yaml", required=True,
help="Path to yaml file with stats data information")
ap.add_argument("-o", "--outdir", default='./',
help="Out directory where files will be saved")

myargs = ap.parse_args()

nprocs = myargs.nprocs
stats_yaml = myargs.stats_yaml
outdir = myargs.outdir

stats_workflow(stats_yaml, nprocs, outdir)

0 comments on commit d94e92c

Please sign in to comment.