Skip to content

Commit

Permalink
Merge pull request #29 from mbari-org/CLI-renames
Browse files Browse the repository at this point in the history
CLI program renames
  • Loading branch information
carueda authored Aug 26, 2024
2 parents e188caa + 2a50f87 commit b189e29
Show file tree
Hide file tree
Showing 10 changed files with 36 additions and 28 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

2024-08

- 1.4.2:
- renamed `pbp` CLI program to `pbp-hmb-gen`
- renamed `pbp-plot` CLI program to `pbp-hmb-plot`

- 1.4.1 - HMB generation CLI now with `--s3-unsigned` option to use unsigned config.

- 1.4.0 with improved "meta-gen" functionality
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@ and also provides APIs you can use in your Python scripts or notebooks.

The package includes the following CLI programs:

| Program | Description |
| ------- |------------------------------------------------|
| [`pbp-meta-gen`](https://docs.mbari.org/pbp/pbp-meta-gen/) | Generate JSON files with audio metadata. |
| [`pbp`](https://docs.mbari.org/pbp/pbp/) | Main HMB generation program. |
| [`pbp-cloud`](https://docs.mbari.org/pbp/pbp-cloud/) | Program for cloud based processing. |
| [`pbp-plot`](https://docs.mbari.org/pbp/pbp-plot/) | Utility program to plot resulting HMB product. |
| Program | Description |
|------------------------------------------------------------|-----------------------------------------|
| [`pbp-meta-gen`](https://docs.mbari.org/pbp/pbp-meta-gen/) | Generate JSON files with audio metadata |
| [`pbp-hmb-gen`](https://docs.mbari.org/pbp/pbp-hmb-gen/) | Main HMB generation program |
| [`pbp-cloud`](https://docs.mbari.org/pbp/pbp-cloud/) | Program for cloud based processing |
| [`pbp-hmb-plot`](https://docs.mbari.org/pbp/pbp-hmb-plot/) | Utility program to plot HMB product |

### API

Expand Down
22 changes: 11 additions & 11 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ tgz:
# Run main (on gizo)
main-gizo date="20220902" output_dir="/PAM_Analysis/pypam-space/test_output/daily":
PYTHONPATH=. poetry run python pbp/main.py \
PYTHONPATH=. poetry run python pbp/main_hmb_generator.py \
--json-base-dir=json \
--date={{date}} \
--voltage-multiplier=3 \
Expand All @@ -43,7 +43,7 @@ main-gizo date="20220902" output_dir="/PAM_Analysis/pypam-space/test_output/dail

# Run main (on gizo) with some initial test jsons
main-gizo-test *more_args="":
PYTHONPATH=. poetry run python pbp/main.py \
PYTHONPATH=. poetry run python pbp/main_hmb_generator.py \
--json-base-dir=tests/json \
--date=20220902 \
--voltage-multiplier=3 \
Expand All @@ -67,7 +67,7 @@ main-gizo-multiple-days year month *days="":
base="$output_dir/milli_psd_$date"
out="$base.out"
echo "running: day=$day output_dir=$output_dir"
poetry run python pbp/main.py \
poetry run python pbp/main_hmb_generator.py \
--json-base-dir=json \
--date="$date" \
--voltage-multiplier=3 \
Expand All @@ -87,7 +87,7 @@ main-mb05 *more_args="":
mkdir -p NB_SPACE/OUTPUT
PYTHONPATH=. EXCLUDE_LOG_TIME=yes \
poetry run python pbp/main.py \
poetry run python pbp/main_hmb_generator.py \
--date=20220812 \
--json-base-dir=NB_SPACE/JSON \
--voltage-multiplier=1 \
Expand All @@ -113,7 +113,7 @@ main-nrs11 date='20200101' *more_args='':
mkdir -p $WS/DOWNLOADS
mkdir -p $WS/OUTPUT
PYTHONPATH=. EXCLUDE_LOG_TIME=yes \
poetry run python pbp/main.py \
poetry run python pbp/main_hmb_generator.py \
--date={{date}} \
--gs \
--json-base-dir=$WS/noaa-passive-bioacoustic_nrs_11_2019-2021 \
Expand All @@ -139,7 +139,7 @@ main-nrs11-multiple-days year month *days="":
export PYTHONPATH=.
for day in {{days}}; do
date=$(printf "%04d%02d%02d" {{year}} {{month}} "$day")
poetry run python pbp/main.py \
poetry run python pbp/main_hmb_generator.py \
--date="$date" \
--gs \
--json-base-dir=$WS/noaa-passive-bioacoustic_nrs_11_2019-2021 \
Expand All @@ -159,8 +159,8 @@ main-nrs11-multiple-days year month *days="":
wait
# Plot NRS11 datasets
plot-nrs11 *netcdfs='NRS11/OUTPUT/NRS11_20200101.nc':
poetry run python pbp/plot.py \
hmb-plot-nrs11 *netcdfs='NRS11/OUTPUT/NRS11_20200101.nc':
poetry run python pbp/main_plot.py \
--ylim 10 2000 \
--cmlim 64 108 \
--latlon 37.88 -123.44 \
Expand Down Expand Up @@ -231,14 +231,14 @@ main-cloud-chumash-basic-test date="20230108":
# Run main
main *args="":
PYTHONPATH=. poetry run python pbp/main.py {{args}}
PYTHONPATH=. poetry run python pbp/main_hmb_generator.py {{args}}

##############
# misc/utils:

# Generate summary plots
plot *args:
poetry run python pbp/plot.py {{args}}
hmb-plot *args:
poetry run python pbp/main_plot.py {{args}}

##############
# docker:
Expand Down
2 changes: 1 addition & 1 deletion misc/plot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ dir=$1

for nc in "${dir}"/*nc; do
echo -e "\n=== ${nc} ==="
python src/plot.py \
python src/main_plot.py \
--latlon 35.77 -121.43 \
--ylim 10 24000 \
--title 'Location: MB05, Monterey Bay National Marine Sanctuary, 35.77°N 121.43°W' \
Expand Down
2 changes: 1 addition & 1 deletion pbp/main.py → pbp/main_hmb_generator.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from pbp.main_args import parse_arguments
from pbp.main_hmb_generator_args import parse_arguments

# Some imports, in particular involving data processing, cause a delay that is
# noticeable when just running the --help option. We get around this issue by
Expand Down
2 changes: 1 addition & 1 deletion pbp/main_args.py → pbp/main_hmb_generator_args.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def parse_arguments():
description = "Process ocean audio data archives to daily analysis products of hybrid millidecade spectra using PyPAM."
example = """
Examples:
pbp --json-base-dir=tests/json \\
pbp-hmb-gen --json-base-dir=tests/json \\
--audio-base-dir=tests/wav \\
--date=20220902 \\
--output-dir=output
Expand Down
File renamed without changes.
12 changes: 8 additions & 4 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"

[tool.poetry]
name = "mbari-pbp"
version = "1.4.1"
version = "1.4.2"
description = "PyPAM based Processing"
authors = [
"Carlos Rueda <[email protected]>",
Expand All @@ -17,9 +17,9 @@ repository = "https://github.com/mbari-org/pbp"
packages = [{include = "pbp"}]

[tool.poetry.scripts]
pbp = "pbp.main:main"
pbp-hmb-gen = "pbp.main_hmb_generator:main"
pbp-cloud = "pbp.main_cloud:main"
pbp-plot = "pbp.plot:main"
pbp-hmb-plot = "pbp.main_plot:main"
pbp-meta-gen = "pbp.main_meta_generator:main"

[tool.poetry.dependencies]
Expand Down
2 changes: 1 addition & 1 deletion scripts/mb05.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ instrument="SoundTrap ST600 HF, SN 6999"
for month in $months; do
for day in $days; do
date=$(printf "%04d%02d%02d" "$year" "$month" "$day")
python src/main.py \
python src/main_hmb_generator.py \
--audio-path-map-prefix="s3://pacific-sound-mb05/~/PAM_Archive/MB05/202211_6999/" \
--date="$date" \
--json-base-dir="/PAM_Analysis/JSON/mb05" \
Expand Down

0 comments on commit b189e29

Please sign in to comment.