Skip to content

Commit

Permalink
Move all-plots into subcommand of init
Browse files Browse the repository at this point in the history
  • Loading branch information
mfisher87 committed Jul 24, 2024
1 parent 22a1fa1 commit a90253f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
19 changes: 10 additions & 9 deletions antarctica_today/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def cli():

@cli.group()
def init():
"""Initialize the Antarctica Today database."""
"""Initialize the Antarctica Today database and generate all plots."""
pass


Expand Down Expand Up @@ -59,12 +59,20 @@ def preprocess():
logger.success("Preprocess complete.")


@init.command("04-all-plots")
def all_plots():
"""Generate all Antarctica Today plot images from the database."""
generate_all_plots_and_maps_main()
logger.success("All plots generated.")


@init.command("all")
def init_all():
"""Initialize the Antarctica Today database."""
"""Initialize the Antarctica Today database and generate all plots."""
download_new_files()
generate_new_daily_melt_files(overwrite=False)
preprocessing_main()
generate_all_plots_and_maps_main()
logger.success("Antarctica Today database initialized.")


Expand All @@ -88,12 +96,5 @@ def daily_update_and_plots():
logger.success("Database updated to the current date. New plots produced.")


@cli.command()
def all_plots():
"""Generate all Antarctica Today plot images from the database."""
generate_all_plots_and_maps_main()
logger.success("All plots generated.")


if __name__ == "__main__":
cli()
3 changes: 1 addition & 2 deletions doc/operation.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ These steps will use Docker, as we expect that to be the main operation mode. Se

```bash
docker compose run cli init all
docker compose run cli plots
```


Expand Down Expand Up @@ -188,7 +187,7 @@ This will go through the entire database and produce summary maps and plots for

```bash
PYTHONPATH=.
python antarctica_today plots
python antarctica_today init plots
```

<details><summary>🛠️ _TODO_</summary>
Expand Down

0 comments on commit a90253f

Please sign in to comment.