Skip to content

Commit

Permalink
Merge pull request #73 from kamangir/palisades-2025-01-21-02nsc2
Browse files Browse the repository at this point in the history
πŸ§‘πŸ½β€πŸš’ QGIS refactors for palisades
  • Loading branch information
kamangir authored Jan 22, 2025
2 parents f851dab + aebce42 commit aa7e630
Show file tree
Hide file tree
Showing 7 changed files with 82 additions and 20 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,4 +112,4 @@ graph LR

[![pylint](https://github.com/kamangir/blue-geo/actions/workflows/pylint.yml/badge.svg)](https://github.com/kamangir/blue-geo/actions/workflows/pylint.yml) [![pytest](https://github.com/kamangir/blue-geo/actions/workflows/pytest.yml/badge.svg)](https://github.com/kamangir/blue-geo/actions/workflows/pytest.yml) [![bashtest](https://github.com/kamangir/blue-geo/actions/workflows/bashtest.yml/badge.svg)](https://github.com/kamangir/blue-geo/actions/workflows/bashtest.yml) [![PyPI version](https://img.shields.io/pypi/v/blue-geo.svg)](https://pypi.org/project/blue-geo/) [![PyPI - Downloads](https://img.shields.io/pypi/dd/blue-geo)](https://pypistats.org/packages/blue-geo)

built by πŸŒ€ [`blue_options-4.192.1`](https://github.com/kamangir/awesome-bash-cli), based on 🌐 [`blue_geo-4.1011.1`](https://github.com/kamangir/blue-geo).
built by πŸŒ€ [`blue_options-4.194.1`](https://github.com/kamangir/awesome-bash-cli), based on 🌐 [`blue_geo-4.1015.1`](https://github.com/kamangir/blue-geo).
9 changes: 9 additions & 0 deletions blue_geo/QGIS/console/QGIS.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from .objects import Q_get_thing_path, Q_upload, Q_open
from .path import Q_open_path
from .project import Q_project
from .project import Q_layer
from .testing import Q_test

ABCLI_OBJECT_ROOT = ""
Expand Down Expand Up @@ -102,6 +103,10 @@ def clear(self):
def help(self):
Q_help(clear=True)

@property
def layer(self):
return Q_layer

@property
def list_recent_projects(self):
Q_list_recent_projects()
Expand All @@ -110,6 +115,10 @@ def list_recent_projects(self):
def open(self):
Q_open(thing=Q_project)

@property
def project(self):
return Q_project

@property
def screenshot(self):
Q_screenshot()
Expand Down
55 changes: 55 additions & 0 deletions blue_geo/QGIS/console/apps/palisades.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
if not QGIS_is_live:
from ..logger import Q_log
from ..application import BLUE_GEO_QGIS_APPLICATION
from ..QGIS import QGIS
from ..objects import Q_file_path_in_object
from ..project import Q_project
from ..logger import Q_log_error, Q_verbose


class BLUE_GEO_QGIS_APPLICATION_PALISADES(BLUE_GEO_QGIS_APPLICATION):
def __init__(self):
super().__init__("palisades", "πŸ§‘πŸ½β€πŸš’")

def help_(self):
Q_log(
"palisades.load",
"load the layers of the palisades object.",
icon=self.icon,
)

@property
def load(self):
metadata = Q_project.metadata
if Q_verbose:
self.log(f"metadata: {metadata}")

if "predict" not in metadata:
Q_log_error("predict not found in metadata.")
return

reference_filename = metadata["predict"]["reference_filename"]
datacube_id = metadata["predict"]["datacube_id"]
if not Q_project.add_layer(
filename=Q_file_path_in_object(
filename=reference_filename,
object_name=datacube_id,
),
layer_name=f"input-{reference_filename}",
):
return

output_filename = metadata["predict"]["output_filename"]
if not Q_project.add_layer(
filename=Q_file_path_in_object(
filename=output_filename,
object_name=Q_project.name,
),
layer_name=f"predict-{output_filename}",
template_name="prediction-template",
):
return


palisades = BLUE_GEO_QGIS_APPLICATION_PALISADES()
QGIS.add_app(palisades)
2 changes: 0 additions & 2 deletions blue_geo/QGIS/console/testing.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
if not QGIS_is_live:
from logger import Q_log, Q_hr

from tests.alias import test_aliases
from tests.application import test_template_application
from tests.graphics import test_graphics_screenshot
from tests.help import test_help
Expand All @@ -12,7 +11,6 @@


list_of_tests = [
test_aliases,
test_graphics_screenshot,
test_help,
test_logging,
Expand Down
6 changes: 3 additions & 3 deletions blue_geo/QGIS/console/tests/objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ def test_objects_get_name_or_path():
Q_log(f"testing {what}.{property}...")

output = Q_get_thing_name_or_path(what, property)
assert output
assert isinstance(output, str)

Q_log(f"{what}.path...")
output = Q_get_thing_name(what)
assert output
assert isinstance(output, str)

Q_log(f"{what}.name...")
output = Q_get_thing_path(what)
assert output
assert isinstance(output, str)


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

DESCRIPTION = f"{ICON} AI for a Blue Planet."

VERSION = "4.1011.1"
VERSION = "4.1015.1"

REPO_NAME = "blue-geo"

Expand Down
26 changes: 13 additions & 13 deletions blue_geo/watch/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ watch the planet's story unfold.
<details>
<summary>🌐</summary>

[![image](https://kamangir-public.s3.ca-central-1.amazonaws.com/geo-watch-Cache-Creek-2x-wider-2024-11-05/geo-watch-Cache-Creek-2x-wider-2024-11-05-4X.gif?raw=true&random=2ecotohlfrenxtfd)](https://kamangir-public.s3.ca-central-1.amazonaws.com/geo-watch-Cache-Creek-2x-wider-2024-11-05/geo-watch-Cache-Creek-2x-wider-2024-11-05.gif)
[![image](https://kamangir-public.s3.ca-central-1.amazonaws.com/geo-watch-Cache-Creek-2x-wider-2024-11-05/geo-watch-Cache-Creek-2x-wider-2024-11-05-4X.gif?raw=true&random=47irchgahkdriq4b)](https://kamangir-public.s3.ca-central-1.amazonaws.com/geo-watch-Cache-Creek-2x-wider-2024-11-05/geo-watch-Cache-Creek-2x-wider-2024-11-05.gif)

</details>

Expand All @@ -159,7 +159,7 @@ watch the planet's story unfold.
<details>
<summary>🌐</summary>

[![image](https://kamangir-public.s3.ca-central-1.amazonaws.com/DrugSuperLab-2024-12-09-ZnmC5L/DrugSuperLab-2024-12-09-ZnmC5L-4X.gif?raw=true&random=ww371g951uz6496t)](https://kamangir-public.s3.ca-central-1.amazonaws.com/DrugSuperLab-2024-12-09-ZnmC5L/DrugSuperLab-2024-12-09-ZnmC5L.gif)
[![image](https://kamangir-public.s3.ca-central-1.amazonaws.com/DrugSuperLab-2024-12-09-ZnmC5L/DrugSuperLab-2024-12-09-ZnmC5L-4X.gif?raw=true&random=fmixu3caa3jgrqc5)](https://kamangir-public.s3.ca-central-1.amazonaws.com/DrugSuperLab-2024-12-09-ZnmC5L/DrugSuperLab-2024-12-09-ZnmC5L.gif)

</details>

Expand All @@ -176,7 +176,7 @@ watch the planet's story unfold.
<details>
<summary>🌐</summary>

[![image](https://kamangir-public.s3.ca-central-1.amazonaws.com/geo-watch-2024-09-04-Fagradalsfjall-a/geo-watch-2024-09-04-Fagradalsfjall-a-2X.gif?raw=true&random=1yosopn7w19jpslz)](https://kamangir-public.s3.ca-central-1.amazonaws.com/geo-watch-2024-09-04-Fagradalsfjall-a/geo-watch-2024-09-04-Fagradalsfjall-a.gif)
[![image](https://kamangir-public.s3.ca-central-1.amazonaws.com/geo-watch-2024-09-04-Fagradalsfjall-a/geo-watch-2024-09-04-Fagradalsfjall-a-2X.gif?raw=true&random=hpewfqavufaz1dd2)](https://kamangir-public.s3.ca-central-1.amazonaws.com/geo-watch-2024-09-04-Fagradalsfjall-a/geo-watch-2024-09-04-Fagradalsfjall-a.gif)

</details>

Expand All @@ -189,7 +189,7 @@ watch the planet's story unfold.
<details>
<summary>🌐</summary>

[![image](https://kamangir-public.s3.ca-central-1.amazonaws.com/geo-watch-Jasper-2024-11-03/geo-watch-Jasper-2024-11-03-2X.gif?raw=true&random=f2wwcjv0v9xlkbdk)](https://kamangir-public.s3.ca-central-1.amazonaws.com/geo-watch-Jasper-2024-11-03/geo-watch-Jasper-2024-11-03.gif)
[![image](https://kamangir-public.s3.ca-central-1.amazonaws.com/geo-watch-Jasper-2024-11-03/geo-watch-Jasper-2024-11-03-2X.gif?raw=true&random=bx7zjly3v3isv6vo)](https://kamangir-public.s3.ca-central-1.amazonaws.com/geo-watch-Jasper-2024-11-03/geo-watch-Jasper-2024-11-03.gif)

</details>

Expand All @@ -204,7 +204,7 @@ watch the planet's story unfold.
<details>
<summary>🌐</summary>

[![image](https://kamangir-public.s3.ca-central-1.amazonaws.com/geo-watch-2024-10-27-16-17-36-12059/geo-watch-2024-10-27-16-17-36-12059-4X.gif?raw=true&random=wddkhcxqkod5p055)](https://kamangir-public.s3.ca-central-1.amazonaws.com/geo-watch-2024-10-27-16-17-36-12059/geo-watch-2024-10-27-16-17-36-12059.gif)
[![image](https://kamangir-public.s3.ca-central-1.amazonaws.com/geo-watch-2024-10-27-16-17-36-12059/geo-watch-2024-10-27-16-17-36-12059-4X.gif?raw=true&random=xymshv34oke3sgvb)](https://kamangir-public.s3.ca-central-1.amazonaws.com/geo-watch-2024-10-27-16-17-36-12059/geo-watch-2024-10-27-16-17-36-12059.gif)

</details>

Expand All @@ -222,7 +222,7 @@ watch the planet's story unfold.
<details>
<summary>🌐</summary>

[![image](https://kamangir-public.s3.ca-central-1.amazonaws.com/geo-watch-2024-09-04-Mount-Etna-a/geo-watch-2024-09-04-Mount-Etna-a-2X.gif?raw=true&random=e940gq1n4gwpktk1)](https://kamangir-public.s3.ca-central-1.amazonaws.com/geo-watch-2024-09-04-Mount-Etna-a/geo-watch-2024-09-04-Mount-Etna-a.gif)
[![image](https://kamangir-public.s3.ca-central-1.amazonaws.com/geo-watch-2024-09-04-Mount-Etna-a/geo-watch-2024-09-04-Mount-Etna-a-2X.gif?raw=true&random=hudog9byrsp8zafq)](https://kamangir-public.s3.ca-central-1.amazonaws.com/geo-watch-2024-09-04-Mount-Etna-a/geo-watch-2024-09-04-Mount-Etna-a.gif)

</details>

Expand All @@ -235,7 +235,7 @@ watch the planet's story unfold.
<details>
<summary>🌐</summary>

[![image](https://kamangir-public.s3.ca-central-1.amazonaws.com/Palisades-Sentinel-2-2025-01-15-16-50-38-vyjxu8/Palisades-Sentinel-2-2025-01-15-16-50-38-vyjxu8-2X.gif?raw=true&random=01fgi6r73yjf8szk)](https://kamangir-public.s3.ca-central-1.amazonaws.com/Palisades-Sentinel-2-2025-01-15-16-50-38-vyjxu8/Palisades-Sentinel-2-2025-01-15-16-50-38-vyjxu8.gif)
[![image](https://kamangir-public.s3.ca-central-1.amazonaws.com/Palisades-Sentinel-2-2025-01-15-16-50-38-vyjxu8/Palisades-Sentinel-2-2025-01-15-16-50-38-vyjxu8-2X.gif?raw=true&random=on5q1pcesbdrr963)](https://kamangir-public.s3.ca-central-1.amazonaws.com/Palisades-Sentinel-2-2025-01-15-16-50-38-vyjxu8/Palisades-Sentinel-2-2025-01-15-16-50-38-vyjxu8.gif)

</details>

Expand All @@ -249,7 +249,7 @@ watch the planet's story unfold.
<details>
<summary>🌐</summary>

[![image](https://kamangir-public.s3.ca-central-1.amazonaws.com/Sheerness-20x-2024-12-14-EDkXl0/Sheerness-20x-2024-12-14-EDkXl0-4X.gif?raw=true&random=v7j9spxiw5rxm1os)](https://kamangir-public.s3.ca-central-1.amazonaws.com/Sheerness-20x-2024-12-14-EDkXl0/Sheerness-20x-2024-12-14-EDkXl0.gif)
[![image](https://kamangir-public.s3.ca-central-1.amazonaws.com/Sheerness-20x-2024-12-14-EDkXl0/Sheerness-20x-2024-12-14-EDkXl0-4X.gif?raw=true&random=0uyxdz8gim4ama5n)](https://kamangir-public.s3.ca-central-1.amazonaws.com/Sheerness-20x-2024-12-14-EDkXl0/Sheerness-20x-2024-12-14-EDkXl0.gif)

</details>

Expand All @@ -262,7 +262,7 @@ watch the planet's story unfold.
<details>
<summary>🌐</summary>

[![image](https://kamangir-public.s3.ca-central-1.amazonaws.com/geo-watch-Silver-Peak-2024-10-12-a/geo-watch-Silver-Peak-2024-10-12-a-4X.gif?raw=true&random=sw2f4d6y6ao2qqc3)](https://kamangir-public.s3.ca-central-1.amazonaws.com/geo-watch-Silver-Peak-2024-10-12-a/geo-watch-Silver-Peak-2024-10-12-a.gif)
[![image](https://kamangir-public.s3.ca-central-1.amazonaws.com/geo-watch-Silver-Peak-2024-10-12-a/geo-watch-Silver-Peak-2024-10-12-a-4X.gif?raw=true&random=cct34uer09fxooz1)](https://kamangir-public.s3.ca-central-1.amazonaws.com/geo-watch-Silver-Peak-2024-10-12-a/geo-watch-Silver-Peak-2024-10-12-a.gif)

</details>

Expand All @@ -276,7 +276,7 @@ watch the planet's story unfold.
<details>
<summary>🌐</summary>

[![image](https://kamangir-public.s3.ca-central-1.amazonaws.com/bellingcat-2024-09-27-nagorno-karabakh-6X-2024-12-14-EUUpS1/bellingcat-2024-09-27-nagorno-karabakh-6X-2024-12-14-EUUpS1-4X.gif?raw=true&random=or2qxq06e47rjr5o)](https://kamangir-public.s3.ca-central-1.amazonaws.com/bellingcat-2024-09-27-nagorno-karabakh-6X-2024-12-14-EUUpS1/bellingcat-2024-09-27-nagorno-karabakh-6X-2024-12-14-EUUpS1.gif)
[![image](https://kamangir-public.s3.ca-central-1.amazonaws.com/bellingcat-2024-09-27-nagorno-karabakh-6X-2024-12-14-EUUpS1/bellingcat-2024-09-27-nagorno-karabakh-6X-2024-12-14-EUUpS1-4X.gif?raw=true&random=r883lydg0g3737kg)](https://kamangir-public.s3.ca-central-1.amazonaws.com/bellingcat-2024-09-27-nagorno-karabakh-6X-2024-12-14-EUUpS1/bellingcat-2024-09-27-nagorno-karabakh-6X-2024-12-14-EUUpS1.gif)

</details>

Expand All @@ -293,7 +293,7 @@ watch the planet's story unfold.
<details>
<summary>🌐</summary>

[![image](https://kamangir-public.s3.ca-central-1.amazonaws.com/geo-watch-2024-09-04-burning-man-2024-a/geo-watch-2024-09-04-burning-man-2024-a-2X.gif?raw=true&random=vwndwegqkbvbrmlt)](https://kamangir-public.s3.ca-central-1.amazonaws.com/geo-watch-2024-09-04-burning-man-2024-a/geo-watch-2024-09-04-burning-man-2024-a.gif)
[![image](https://kamangir-public.s3.ca-central-1.amazonaws.com/geo-watch-2024-09-04-burning-man-2024-a/geo-watch-2024-09-04-burning-man-2024-a-2X.gif?raw=true&random=jnaiyst5dp50i0j5)](https://kamangir-public.s3.ca-central-1.amazonaws.com/geo-watch-2024-09-04-burning-man-2024-a/geo-watch-2024-09-04-burning-man-2024-a.gif)

</details>

Expand All @@ -305,7 +305,7 @@ watch the planet's story unfold.
<details>
<summary>🌐</summary>

[![image](https://kamangir-public.s3.ca-central-1.amazonaws.com/geo-watch-Chilcotin-2024-11-03/geo-watch-Chilcotin-2024-11-03-4X.gif?raw=true&random=99igbswm01ilk9yn)](https://kamangir-public.s3.ca-central-1.amazonaws.com/geo-watch-Chilcotin-2024-11-03/geo-watch-Chilcotin-2024-11-03.gif)
[![image](https://kamangir-public.s3.ca-central-1.amazonaws.com/geo-watch-Chilcotin-2024-11-03/geo-watch-Chilcotin-2024-11-03-4X.gif?raw=true&random=zhx2gdth1sftagio)](https://kamangir-public.s3.ca-central-1.amazonaws.com/geo-watch-Chilcotin-2024-11-03/geo-watch-Chilcotin-2024-11-03.gif)

</details>

Expand All @@ -325,7 +325,7 @@ watch the planet's story unfold.
<details>
<summary>🌐</summary>

[![image](https://kamangir-public.s3.ca-central-1.amazonaws.com/elkhema-2024-12-15-8EqPXl/elkhema-2024-12-15-8EqPXl-4X.gif?raw=true&random=kd253lip0wzyglt5)](https://kamangir-public.s3.ca-central-1.amazonaws.com/elkhema-2024-12-15-8EqPXl/elkhema-2024-12-15-8EqPXl.gif)
[![image](https://kamangir-public.s3.ca-central-1.amazonaws.com/elkhema-2024-12-15-8EqPXl/elkhema-2024-12-15-8EqPXl-4X.gif?raw=true&random=zohcdd3hk4m8czal)](https://kamangir-public.s3.ca-central-1.amazonaws.com/elkhema-2024-12-15-8EqPXl/elkhema-2024-12-15-8EqPXl.gif)

</details>

Expand Down

0 comments on commit aa7e630

Please sign in to comment.