Skip to content

Commit

Permalink
Add --no-plot option
Browse files Browse the repository at this point in the history
  • Loading branch information
siiptuo committed Sep 19, 2024
1 parent 3e00c6e commit e82a414
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
5 changes: 5 additions & 0 deletions mwrpy/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ def _parse_args(args):
metavar="YYYY-MM-DD",
help="Single date to be processed.",
)
group.add_argument(
"--no-plot",
action="store_true",
help="Process without plotting.",
)
return parser.parse_args(args)


Expand Down
11 changes: 6 additions & 5 deletions mwrpy/process_mwrpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,12 @@ def main(args):
process_product(product, date, args.site)
elapsed_time = time.process_time() - start
logging.info(f"Processing took {elapsed_time:.1f} seconds")
logging.info(f"Plotting {product} product, {args.site} {date}")
try:
plot_product(product, date, args.site)
except TypeError as err:
logging.error(err)
if not args.no_plot:
logging.info(f"Plotting {product} product, {args.site} {date}")
try:
plot_product(product, date, args.site)
except TypeError as err:
logging.error(err)


def process_product(prod: str, date: datetime.date, site: str):
Expand Down

0 comments on commit e82a414

Please sign in to comment.