Skip to content

Commit

Permalink
pipeline fix, hopefully - kamangir/bolt#746
Browse files Browse the repository at this point in the history
  • Loading branch information
kamangir committed Jul 30, 2024
1 parent 8268e2c commit ac52700
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 13 deletions.
7 changes: 6 additions & 1 deletion blue_geo/.abcli/catalog/generic/query.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ function blue_geo_catalog_query_generic() {
--catalog $catalog \
--delim , \
--log 0)
local default_collection=$(blue_geo_catalog get list_of_collections \
--catalog $catalog \
--count 1 \
--delim , \
--log 0)

if [ $(abcli_option_int "$options" help 0) == 1 ]; then
local collection
Expand All @@ -19,7 +24,7 @@ function blue_geo_catalog_query_generic() {
fi

local do_dryrun=$(abcli_option_int "$options" dryrun 0)
local collection=$(abcli_option_choice "$options" $list_of_collectios area)
local collection=$(abcli_option_choice "$options" $list_of_collectios $default_collection)

if [[ ",$list_of_collectios," != *",$collection,"* ]]; then
abcli_log_error "-@catalog: query: $catalog: $collection: collection not found."
Expand Down
2 changes: 1 addition & 1 deletion blue_geo/.abcli/catalog/get.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ function blue_geo_catalog_get() {

if [ $(abcli_option_int "$options" help 0) == 1 ]; then
options="list_of_collections"
local args="[--catalog <catalog>]$ABCUL[--delim ,]$ABCUL[--log 0]"
local args="[--catalog <catalog>]$ABCUL[--count 1]$ABCUL[--delim ,]$ABCUL[--log 0]"
abcli_show_usage "@catalog get$ABCUL[$options]$ABCUL$args" \
"get list of collections in <catalog>."
return
Expand Down
15 changes: 13 additions & 2 deletions blue_geo/.abcli/tests/catalog.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,15 @@ function test_blue_geo_catalog_get_list_of_collections() {
--delim , \
--log 0
[[ $? -ne 0 ]] && return 1

abcli_eval ,$options \
blue_geo catalog get \
list_of_collections \
--catalog $catalog \
--count 1 \
--delim , \
--log 0
[[ $? -ne 0 ]] && return 1
done

return 0
Expand All @@ -44,14 +53,16 @@ function test_blue_geo_catalog_query() {
for catalog in $(echo $blue_geo_catalog_list | tr , " "); do
local object_name="bashtest-$(abcli_string_timestamp)"

[[ "$catalog" == generic ]] && continue

abcli_eval ,$options \
blue_geo catalog query firms \
blue_geo catalog query $catalog \
ingest \
$object_name
[[ $? -ne 0 ]] && return 1

abcli_assert \
$(blue_geo datacube query read len $object_name) \
$(blue_geo catalog query read len $object_name) \
1
[[ $? -ne 0 ]] && return 1
done
Expand Down
2 changes: 1 addition & 1 deletion blue_geo/.abcli/tests/catalog_query_firms_area.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ function test_blue_geo_catalog_query_firms_area() {
[[ $? -ne 0 ]] && return 1

abcli_assert \
$(blue_geo datacube query read - $object_name) \
$(blue_geo catalog query read - $object_name) \
$BLUE_GEO_TEST_DATACUBE_FIRMS_AREA
}
9 changes: 2 additions & 7 deletions blue_geo/.abcli/tests/datacube_get.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@ function test_blue_geo_datacube_get_catalog() {
void
[[ $? -ne 0 ]] && return 1

abcli_assert \
$(blue_geo_datacube_get catalog xyz) \
unknown-catalog
[[ $? -ne 0 ]] && return 1

abcli_assert \
$(blue_geo_datacube_get catalog datacube-generic) \
generic
Expand All @@ -23,12 +18,12 @@ function test_blue_geo_datacube_get_catalog() {

function test_blue_geo_datacube_get_template() {
abcli_assert \
$(blue_geo_datacube_get template unknown-catalog) \
$(blue_geo_datacube_get template void) \
unknown-template
[[ $? -ne 0 ]] && return 1

abcli_assert \
$(blue_geo_datacube_get template generic) \
$(blue_geo_datacube_get template datacube-generic) \
unknown-template
[[ $? -ne 0 ]] && return 1

Expand Down
2 changes: 1 addition & 1 deletion blue_geo/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

DESCRIPTION = f"{ICON} AI for precise geospatial data analysis and visualization."

VERSION = "4.172.1"
VERSION = "4.173.1"

REPO_NAME = "blue-geo"

Expand Down
9 changes: 9 additions & 0 deletions blue_geo/catalog/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@
type=str,
default=",",
)
parser.add_argument(
"--count",
type=int,
default=-1,
help="-1: all",
)
parser.add_argument(
"--log",
default=1,
Expand All @@ -53,6 +59,9 @@
output = [
datacube_class.name for datacube_class in get_collections(args.catalog)
]

if args.count != -1:
output = output[: args.count]
elif args.task == "list":
item_name = "catalog"
output = list_of_catalogs
Expand Down

0 comments on commit ac52700

Please sign in to comment.