diff --git a/.abcli/download.sh b/.abcli/download.sh index 3e233be..8a07090 100644 --- a/.abcli/download.sh +++ b/.abcli/download.sh @@ -35,25 +35,26 @@ function abcli_hubble_download() { $abcli_object_root/$object_name/" fi - abcli_log "⚙️ $command_line" + abcli_eval dryrun=$do_dryrun \ + "$command_line" + if [ "$do_dryrun" == 0 ]; then - eval "$command_line" + abcli_tag set $object_name hubble - abcli_tag set \ - $object_name hubble \ - validate abcli_relation set \ $object_name $hubble_object_name \ - is-download-of validate + is-download-of fi - if [ "$do_ingest" == 1 ]; then - python3 -m hubble ingest \ + [[ "$do_ingest" == 1 ]] && + abcli_eval dryrun=$do_dryrun \ + python3 -m hubble ingest \ --dataset_name $dataset_name \ --hubble_object_name $hubble_object_name \ --object_name $object_name - fi [[ "$do_upload" == 1 ]] && abcli_upload - $object_name + + return 0 } diff --git a/.abcli/tests/list.sh b/.abcli/tests/list.sh new file mode 100644 index 0000000..75316dd --- /dev/null +++ b/.abcli/tests/list.sh @@ -0,0 +1,35 @@ +#! /usr/bin/env bash + +function test_hubble_list() { + local dataset + local object + for dataset in hst; do + for object in "public/u4ge/u4ge0106r"; do + test_internal_hubble_list \ + "dataset=$dataset,object=$object,$1" \ + "${@:2}" + done + done +} + +function test_internal_hubble_list() { + local options=$1 + local do_dryrun=$(abcli_option_int "$options" dryrun 0) + + local dataset=$(abcli_option "$options" dataset) + local object=$(abcli_option "$options" object) + + hubble select dataset $dataset + hubble select object $object + + abcli_eval $options, \ + hubble list + + abcli_hr + abcli_eval $options, \ + hubble list dataset + + abcli_hr + abcli_eval $options, \ + hubble list object +} diff --git a/.abcli/tests/select_and_download.sh b/.abcli/tests/select_and_download.sh new file mode 100644 index 0000000..a7466b9 --- /dev/null +++ b/.abcli/tests/select_and_download.sh @@ -0,0 +1,34 @@ +#! /usr/bin/env bash + +function test_hubble_select_and_download() { + local dataset + local object + for dataset in hst; do + for object in "public/u4ge/u4ge0106r"; do + test_internal_hubble_select_and_download \ + "dataset=$dataset,object=$object,filename=u4ge0106r_cgr.fits,$1" \ + "${@:2}" + done + done +} + +function test_internal_hubble_select_and_download() { + local options=$1 + local do_dryrun=$(abcli_option_int "$options" dryrun 0) + + local dataset=$(abcli_option "$options" dataset) + local object=$(abcli_option "$options" object) + local filename=$(abcli_option "$options" filename) + + hubble select dataset $dataset + hubble select object $object + + abcli_select + abcli_eval $options, \ + hubble download dryrun=$do_dryrun + + abcli_hr + abcli_select + abcli_eval $options, \ + hubble download dryrun=$do_dryrun,filename=$filename +} diff --git a/hubble/__init__.py b/hubble/__init__.py index dd4367e..121c8c1 100644 --- a/hubble/__init__.py +++ b/hubble/__init__.py @@ -4,4 +4,4 @@ DESCRIPTION = f"{ICON} tools to access and process Hubble Space Telescope imagery and other datasets on AWS Open Data Registry." -VERSION = "3.312.1" +VERSION = "3.314.1"