Skip to content

Commit

Permalink
additional tests - kamangir/bolt#746
Browse files Browse the repository at this point in the history
  • Loading branch information
kamangir committed Apr 26, 2024
1 parent a59e3e2 commit b35dded
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 10 deletions.
19 changes: 10 additions & 9 deletions .abcli/download.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
35 changes: 35 additions & 0 deletions .abcli/tests/list.sh
Original file line number Diff line number Diff line change
@@ -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
}
34 changes: 34 additions & 0 deletions .abcli/tests/select_and_download.sh
Original file line number Diff line number Diff line change
@@ -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
}
2 changes: 1 addition & 1 deletion hubble/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"

0 comments on commit b35dded

Please sign in to comment.