-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #43 from sepal-contrib/master
update
- Loading branch information
Showing
59 changed files
with
961 additions
and
793 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: Unit testing | ||
|
||
on: | ||
- push | ||
- workflow_dispatch | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.8" | ||
- uses: pre-commit/[email protected] | ||
- name: install dependencies | ||
run: python -m pip install -r requirements.txt | ||
- name: build the application | ||
run: | | ||
python -m pip install pytest nbmake | ||
pytest --nbmake ui.ipynb |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,29 @@ | ||
default_language_version: | ||
python: python3 | ||
default_install_hook_types: [pre-commit] | ||
|
||
repos: | ||
- repo: https://github.com/psf/black | ||
rev: 8a59528c2d8ae1ef5f366039c728614aaf1a470b | ||
- repo: "https://github.com/psf/black" | ||
rev: "22.3.0" | ||
hooks: | ||
- id: black | ||
- id: black-jupyter | ||
- repo: https://github.com/kynan/nbstripout | ||
rev: 0.5.0 | ||
- id: black | ||
stages: [commit] | ||
- id: black-jupyter | ||
stages: [commit] | ||
|
||
- repo: "https://github.com/kynan/nbstripout" | ||
rev: "0.5.0" | ||
hooks: | ||
- id: nbstripout | ||
stages: [commit] | ||
|
||
- repo: "https://github.com/pre-commit/mirrors-prettier" | ||
rev: "v2.7.1" | ||
hooks: | ||
- id: prettier | ||
stages: [commit] | ||
exclude: "CHANGELOG.md" | ||
|
||
- repo: https://github.com/charliermarsh/ruff-pre-commit | ||
rev: "v0.0.215" | ||
hooks: | ||
- id: nbstripout | ||
- id: ruff | ||
stages: [commit] |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"aoi_control": { | ||
"title": "Select AOI" | ||
} | ||
} |
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,12 @@ | ||
{ | ||
"down_control": { | ||
"title": "Download images", | ||
"btn": "Download", | ||
"error": { | ||
"no_aoi": "Select an aoi first" | ||
}, | ||
"process": { | ||
"loading_grid": "Loading the PLANET grid" | ||
} | ||
} | ||
} |
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,7 @@ | ||
{ | ||
"dynamic_select": { | ||
"prev": "prev", | ||
"next": "next", | ||
"label": "Select mosaic" | ||
} | ||
} |
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 |
---|---|---|
@@ -1,54 +1,12 @@ | ||
{ | ||
"app": { | ||
"title": "Planet ordering module", | ||
"drawer_item": { | ||
"aoi": "AOI selection", | ||
"retrieve": "Retrieve images", | ||
"about": "About" | ||
} | ||
}, | ||
"key": { | ||
"password": { | ||
"label": "API key", | ||
"error_msg": "You cannot expose the default API key" | ||
} | ||
}, | ||
"dynamic_select": { | ||
"prev": "prev", | ||
"next": "next", | ||
"label": "Select mosaic" | ||
}, | ||
"planet": { | ||
"title": "Explore planet data", | ||
"btn": { | ||
"check": "Check API key", | ||
"download": "Download images" | ||
}, | ||
"key": { | ||
"invalid": "The current key is invalid, please provide a valid Planet key", | ||
"test": "We are currently checking your API key", | ||
"valid": "Your key have been validated" | ||
}, | ||
"mosaic": { | ||
"load": "We are retrieving the mosaics list", | ||
"complete": "The list of mosaic is available in the Mosaic selector" | ||
}, | ||
"down": { | ||
"start": "exporting planet tiles", | ||
"progress": "Images downloaded to Sepal", | ||
"not_found": "Image {} not found", | ||
"done": "Image {} downloaded to SEPAL", | ||
"end": "Out of {} requested images, {} have been downloaded, {} skipped and {} failed", | ||
"exist": "The image {} already exist in your sepal directory, aborting", | ||
"no_access": "You don't have the right access to download this resource", | ||
"view_only": "At least one of the missing tile was not downloaded because you don't have the right access to download the resources. Please see the module documentation or your Planet Lab profile to check their availability." | ||
} | ||
}, | ||
"map": { | ||
"aoi": "loading aoi", | ||
"grid": "generating planet grid", | ||
"tiles": "loading tiles", | ||
"done": "loading complete", | ||
"aoi_border": "AOI border" | ||
"app": { | ||
"title": "Planet ordering module" | ||
}, | ||
"planet": { | ||
"down": { | ||
"start": "exporting Planet tiles", | ||
"progress": "Images downloaded", | ||
"end": "Out of {} requested images, {} have been downloaded, {} skipped and {} failed" | ||
} | ||
} | ||
} | ||
} |
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,48 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"import sys\n", | ||
"import os\n", | ||
"\n", | ||
"sys.path.insert(0, os.path.abspath(\"../\"))" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"from message import cm\n", | ||
"\n", | ||
"cm.key_use(os.path.abspath(\"../../\"), \"cm\")" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "app", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.10.6" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 2 | ||
} |
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 |
---|---|---|
@@ -1 +1,7 @@ | ||
"""Module to gather all the models from the application. | ||
If you only have few widgets, a module is not necessary and you can simply use a model.py file | ||
In a big module with lot of custom models, it can make sense to split things in separate files for the sake of maintenance. | ||
If you use a module import all the functions here to only have 1 call to make | ||
""" | ||
from .order_model import * |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,7 @@ | ||
"""module to gather all the parameters used in the application. | ||
if you only have few widgets, a module is not necessary and you can simply use a parameter.py file. Iin a big module with lot of custom parmeters, it can make sense to split things in separate files for the sake of maintenance. | ||
If you use a module import all the functions here to only have 1 call to make | ||
""" | ||
from .directory import * | ||
from .planet import * |
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 |
---|---|---|
@@ -1,28 +1,28 @@ | ||
"""All directories used in the application.""" | ||
|
||
from pathlib import Path | ||
|
||
# module directory | ||
module_dir = Path("~", "module_results").expanduser() | ||
module_dir = Path.home() / "module_results" | ||
module_dir.mkdir(exist_ok=True) | ||
|
||
# result_dir | ||
result_dir = module_dir.joinpath("planet-order") | ||
result_dir = module_dir / "planet-order" | ||
result_dir.mkdir(exist_ok=True) | ||
|
||
|
||
def get_aoi_dir(aoi_name): | ||
"""get the result dir associated with the aoi name""" | ||
|
||
aoi_dir = result_dir.joinpath(aoi_name) | ||
def get_aoi_dir(aoi_name: str) -> Path: | ||
"""Returns the directory associated with the aoi_name.""" | ||
aoi_dir = result_dir / aoi_name | ||
aoi_dir.mkdir(exist_ok=True) | ||
|
||
return aoi_dir | ||
|
||
|
||
def get_mosaic_dir(aoi_name, mosaic_name): | ||
"""get the result dir associated with the mosaic name""" | ||
|
||
"""Get the result dir associated with the mosaic name.""" | ||
aoi_dir = get_aoi_dir(aoi_name) | ||
mosaic_dir = aoi_dir.joinpath(mosaic_name) | ||
mosaic_dir = aoi_dir / mosaic_name | ||
mosaic_dir.mkdir(exist_ok=True) | ||
|
||
return mosaic_dir |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,10 @@ | ||
from .planet import * | ||
"""Module to gather all scripts of the application. | ||
If you only have few widgets, a module is not necessary and you can simply use a scripts.py file | ||
In a big module with lot of custom scripts, it can make sense to split things in separate files for the sake of maintenance | ||
If you use a module import all the functions here to only have 1 call to make | ||
""" | ||
|
||
from .mapping import * | ||
from .planet import * |
Oops, something went wrong.