generated from kamangir/blue-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
173 additions
and
154 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
from blue_geo.help.datacube.crop import help_crop | ||
from blue_geo.help.datacube.generate import help_generate | ||
from blue_geo.help.datacube.get import help_get | ||
from blue_geo.help.datacube.ingest import help_ingest, ingest_options, scope_details | ||
from blue_geo.help.datacube.list import help_list | ||
|
||
help_functions = { | ||
"crop": help_crop, | ||
"generate": help_generate, | ||
"get": help_get, | ||
"ingest": help_ingest, | ||
"list": help_list, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
from typing import List | ||
|
||
from blue_options.terminal import show_usage | ||
|
||
|
||
def help_crop( | ||
tokens: List[str], | ||
mono: bool, | ||
) -> str: | ||
options = "download,dryrun,suffix=<suffix>" | ||
return show_usage( | ||
[ | ||
"@datacube crop", | ||
f"[{options}]", | ||
"[..|<object-name>]", | ||
"[.|<datacube-id>]", | ||
], | ||
"crop <datacube-id> by <object-name>/target/shape.geojson -> <datacube-id>-DERIVED-crop-<suffix>.", | ||
mono=mono, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
from typing import List | ||
|
||
from blue_options.terminal import show_usage, xtra | ||
|
||
from blue_geo.datacube.modalities import options as modality_options | ||
|
||
|
||
def help_generate( | ||
tokens: List[str], | ||
mono: bool, | ||
) -> str: | ||
options = xtra("dryrun", mono) | ||
|
||
args = [ | ||
"[--modality <{}>]".format("|".join(modality_options)), | ||
"[--overwrite <1>]", | ||
] | ||
|
||
return show_usage( | ||
[ | ||
"@datacube generate", | ||
f"[{options}]", | ||
"[.|<datacube-id>]", | ||
] | ||
+ args, | ||
"generate datacube/<modality>.", | ||
mono=mono, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
from typing import List | ||
|
||
from blue_options.terminal import show_usage | ||
|
||
|
||
def help_get( | ||
tokens: List[str], | ||
mono: bool, | ||
) -> str: | ||
options = "catalog | raw | template" | ||
|
||
return show_usage( | ||
[ | ||
"@datacube get", | ||
f"[{options}]", | ||
"[.|<datacube-id>]", | ||
], | ||
"get datacube properties.", | ||
mono=mono, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
from typing import List | ||
|
||
from blue_options.terminal import show_usage, xtra | ||
|
||
from blue_geo.catalog.generic.generic.scope import DatacubeScope | ||
|
||
|
||
def ingest_options(mono: bool) -> str: | ||
return "".join( | ||
[ | ||
xtra("~copy_template,dryrun,overwrite,", mono), | ||
"scope=<scope>", | ||
xtra(",upload", mono), | ||
] | ||
) | ||
|
||
|
||
scope_details = { | ||
f"scope: {DatacubeScope.help}": [ | ||
"all: ALL files.", | ||
"metadata (default): any < 1 MB.", | ||
"raster: all raster.", | ||
"rgb: rgb.", | ||
"rgbx: rgb and what is needed to build rgb.", | ||
"<suffix>: any *<suffix>.", | ||
] | ||
} | ||
|
||
|
||
def help_ingest( | ||
tokens: List[str], | ||
mono: bool, | ||
) -> str: | ||
options = ingest_options(mono) | ||
|
||
return show_usage( | ||
[ | ||
"@datacube ingest", | ||
f"[{options}]", | ||
"[.|<datacube-id>]", | ||
"[<args>]", | ||
], | ||
"ingest <datacube-id>/<scope>.", | ||
scope_details, | ||
mono=mono, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
from typing import List | ||
|
||
from blue_options.terminal import show_usage | ||
|
||
from blue_geo.help.datacube.ingest import scope_details | ||
|
||
|
||
def help_list( | ||
tokens: List[str], | ||
mono: bool, | ||
) -> str: | ||
args = [ | ||
"[--count 1]", | ||
"[--delim +]", | ||
"[--exists 1]", | ||
"[--log 0]", | ||
"[--scope <scope>]", | ||
] | ||
|
||
return show_usage( | ||
[ | ||
"@datacube list", | ||
"[.|<datacube-id>]", | ||
] | ||
+ args, | ||
"list datacube files.", | ||
scope_details, | ||
mono=mono, | ||
) |
Oops, something went wrong.