Skip to content

Commit

Permalink
1st working version
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan Jurgen Griesfeller committed Jun 8, 2022
1 parent 4ce1d6b commit d902f21
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions pyaerocom/tools/aeroval_parallelise.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def main():
description="command line interface to aeroval parallelisation.\n"
"aeroval config has to to be in the variable CFG for now!\n\n"
)
parser.add_argument("--file", help="file(s) to read", nargs="+")
parser.add_argument("files", help="file(s) to read", nargs="+")
parser.add_argument("-v", "--verbose", help="switch on verbosity", action="store_true")

parser.add_argument("--outdir", help="output directory")
Expand All @@ -45,8 +45,8 @@ def main():

args = parser.parse_args()
options = {}
if args.file:
options["files"] = args.file
if args.files:
options["files"] = args.files
if args.verbose:
options["verbose"] = True
else:
Expand All @@ -57,6 +57,7 @@ def main():

if args.tempdir:
options["tempdir"] = args.tempdir

if args.cfgvar:
options["cfgvar"] = args.cfgvar

Expand All @@ -73,9 +74,11 @@ def main():
out_cfg = copy.deepcopy(cfg)
out_cfg.pop("model_cfg", None)
out_cfg.pop("obs_cfg", None)
out_cfg["model_cfg"] = {}
out_cfg["model_cfg"][_model] = cfg["model_cfg"][_model]
for _obs_network in cfg["obs_cfg"]:
out_cfg["model_cfg"] = cfg["model_cfg"][_model]
out_cfg["obs_cfg"] = cfg["obs_cfg"][_obs_network]
out_cfg["obs_cfg"] = {}
out_cfg["obs_cfg"][_obs_network] = cfg["obs_cfg"][_obs_network]
cfg_file = pathlib.PurePosixPath(_file).stem
outfile = pathlib.PurePosixPath(tempdir).joinpath(f"cfg_file_{_model}_{_obs_network}.json")
print(f"writing file {outfile}")
Expand Down

0 comments on commit d902f21

Please sign in to comment.