forked from NOAA-EMC/global-workflow
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'NOAA-EMC:develop' into develop
- Loading branch information
Showing
141 changed files
with
2,192 additions
and
582 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
experiment: | ||
system: gfs | ||
mode: cycled | ||
|
||
arguments: | ||
pslot: {{ 'pslot' | getenv }} | ||
app: ATM | ||
resdetatmos: 96 | ||
comroot: {{ 'RUNTESTS' | getenv }}/COMROOT | ||
expdir: {{ 'RUNTESTS' | getenv }}/EXPDIR | ||
icsdir: {{ 'ICSDIR_ROOT' | getenv }}/C96C48 | ||
idate: 2021122018 | ||
edate: 2021122118 | ||
nens: 0 | ||
gfs_cyc: 4 | ||
start: cold | ||
yaml: {{ HOMEgfs }}/ci/cases/yamls/gfs_extended_ci.yaml | ||
|
||
skip_ci_on_hosts: | ||
- hera | ||
- orion | ||
- hercules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
defaults: | ||
!INC {{ HOMEgfs }}/parm/config/gfs/yaml/defaults.yaml | ||
|
||
base: | ||
ACCOUNT: {{ 'SLURM_ACCOUNT' | getenv }} | ||
DO_GOES: "YES" | ||
DO_BUFRSND: "YES" | ||
DO_GEMPAK: "YES" | ||
DO_AWIPS: "NO" | ||
DO_NPOESS: "YES" | ||
DO_GENESIS_FSU: "NO" | ||
FHMAX_GFS: 384 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
#!/usr/bin/env python3 | ||
|
||
""" | ||
This script parses a yaml file and returns the value of a specified key. | ||
""" | ||
|
||
import os | ||
import sys | ||
from wxflow import AttrDict, parse_j2yaml | ||
from argparse import ArgumentParser | ||
from pathlib import Path | ||
|
||
_here = os.path.dirname(__file__) | ||
_top = os.path.abspath(os.path.join(os.path.abspath(_here), '../../..')) | ||
|
||
description = """parse yaml file and return value of key""" | ||
|
||
|
||
def parse_args(): | ||
""" | ||
Parse command-line arguments. | ||
Returns: | ||
argparse.Namespace: The parsed command-line arguments. | ||
""" | ||
|
||
parser = ArgumentParser(description=description) | ||
parser.add_argument('-y', '--yaml', help='full path to yaml file to parse', type=Path, required=True) | ||
parser.add_argument('-k', '--key', help='key to return value of', type=str, required=True) | ||
parser.add_argument('-s', '--string', help='output results as strings', action="store_true", required=False) | ||
return parser.parse_args() | ||
|
||
|
||
def yq(yamlfile, key): | ||
""" | ||
Parse a yaml file and return the value of a specified key. | ||
Args: | ||
yamlfile (Path): The path to the yaml file. | ||
key (str): The key to return the value of. | ||
Returns: | ||
The value of the specified key in the yaml file. | ||
""" | ||
|
||
data = AttrDict(HOMEgfs=_top) | ||
data.update({'HOMEgfs': _top}) | ||
ydict = parse_j2yaml(path=yamlfile, data=data) | ||
if key == 'all': | ||
return ydict | ||
list_keys = key.split('.') | ||
for k in list_keys: | ||
ydict = ydict.get(k, None) | ||
if ydict is None: | ||
break | ||
return ydict | ||
|
||
|
||
if __name__ == '__main__': | ||
""" | ||
Main function. Parses command-line arguments and prints the value of the specified key in the specified yaml file. | ||
""" | ||
|
||
args = parse_args() | ||
values = yq(args.yaml, args.key) | ||
if args.string and isinstance(values, list): | ||
for value in values: | ||
print(value) | ||
else: | ||
print(values) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.