Skip to content

Commit

Permalink
tmy cli test with multiple site chunks
Browse files Browse the repository at this point in the history
  • Loading branch information
bnb32 committed Jul 3, 2024
1 parent 1726c26 commit f0b7168
Show file tree
Hide file tree
Showing 3 changed files with 101 additions and 127 deletions.
9 changes: 6 additions & 3 deletions nsrdb/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -749,9 +749,11 @@ def tmy(ctx, config, verbose=False, pipeline_step=None, collect=False):
\b
{
"tmy": {"run_name": "tmy"},
"collect-tmy": {"run_name": "collect_tmy"},
"tmy": {},
"collect-tmy": {"purge_chunks": True},
"direct": {
"sites_per_worker": 50,
"site_slice": [0, 100],
"tmy_types": ['tmy', 'tdy', 'tgy'],
"nsrdb_base_fp": './nsrdb_*_{}.h5',
"years": [2000, ..., 2022],
Expand All @@ -773,7 +775,8 @@ def tmy(ctx, config, verbose=False, pipeline_step=None, collect=False):
fn_out = config.pop('fn_out', 'tmy.h5')
out_dir = config['out_dir']
for tmy_type in tmy_types:
func = TmyRunner.collect if collect else getattr(TmyRunner, tmy_type)
func = TmyRunner.collect if collect else TmyRunner.tmy
config['tmy_type'] = tmy_type
config['out_dir'] = os.path.join(out_dir, f'{tmy_type}/')
config['job_name'] = f'{ctx.obj["RUN_NAME"]}_{tmy_type}'
config['fn_out'] = fn_out.replace('.h5', f'_{tmy_type}.h5')
Expand Down
Loading

0 comments on commit f0b7168

Please sign in to comment.