Skip to content

Commit

Permalink
datacube refactor - kamangir/bolt#746
Browse files Browse the repository at this point in the history
  • Loading branch information
kamangir committed Jul 20, 2024
1 parent de6d861 commit 0dd0c1c
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 20 deletions.
8 changes: 4 additions & 4 deletions blue_geo/.abcli/datacube/list.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ function blue_geo_datacube_list() {
local options=$1

if [ $(abcli_option_int "$options" help 0) == 1 ]; then
options="-"
local args=$abcli_tag_search_args
options="types"
local args="[--delim space]$ABCUL[--log 0]"
abcli_show_usage "@datacube list$ABCUL[$options]$ABCUL$args" \
"list datacubes."
"list datacube types."
return
fi
python3 -m blue_geo.datacube \
list \
list_of_types \
"$@"
}

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.76.1"
VERSION = "4.77.1"

REPO_NAME = "blue-geo"

Expand Down
17 changes: 4 additions & 13 deletions blue_geo/datacube/__main__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import argparse
from blue_geo import VERSION
from blue_geo.datacube.types import list_of
from blue_geo.ukraine_timemap import NAME
from blue_geo.logger import logger
from blueness.argparse.generic import sys_exit
Expand All @@ -8,17 +9,7 @@
parser.add_argument(
"task",
type=str,
help="list",
)
parser.add_argument(
"--count",
type=int,
default=-1,
)
parser.add_argument(
"--offset",
type=int,
default=0,
help="list_of_types",
)
parser.add_argument(
"--delim",
Expand All @@ -36,8 +27,8 @@
delim = " " if args.delim == "space" else args.delim

success = False
if args.task == "list_type":
output = [] # list_of_types(object_name=args.object_name)
if args.task == "list_of_types":
output = list_of

if args.log:
logger.info(f"{len(output):,} datacube type(s): {delim.join(output)}")
Expand Down
3 changes: 2 additions & 1 deletion blue_geo/datacube/firms/area/classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@


class FirmsAreaDatacube(GenericDatacube):
type = "firms-area"

def __init__(
self,
source: Source = Source.default(),
Expand All @@ -22,7 +24,6 @@ def __init__(
log: bool = True,
):
super().__init__()
self.type = "firms-area"

self.url_prefix = "https://firms.modaps.eosdis.nasa.gov/api/area"
self.map_key = env.FIRMS_MAP_KEY
Expand Down
4 changes: 3 additions & 1 deletion blue_geo/datacube/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@


class GenericDatacube:
type = "generic"

def __init__(self):
self.type = "generic"
pass

@property
def datacube_id(self) -> str:
Expand Down
3 changes: 3 additions & 0 deletions blue_geo/datacube/types.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from blue_geo.datacube.firms.area import FirmsAreaDatacube

list_of = [FirmsAreaDatacube.type]

0 comments on commit 0dd0c1c

Please sign in to comment.