Skip to content

Commit

Permalink
flake8
Browse files Browse the repository at this point in the history
  • Loading branch information
anikaweinmann committed Jul 28, 2022
1 parent 02b1c2e commit ff3aeb2
Show file tree
Hide file tree
Showing 15 changed files with 830 additions and 524 deletions.
25 changes: 13 additions & 12 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# This file is execfile()d with the current directory set to its containing dir.
# This file is execfiled with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
Expand All @@ -23,8 +23,8 @@
sys.path.insert(0, os.path.join(__location__, "../src"))

# -- Run sphinx-apidoc ------------------------------------------------------
# This hack is necessary since RTD does not issue `sphinx-apidoc` before running
# `sphinx-build -b html . _build/html`. See Issue:
# This hack is necessary since RTD does not issue `sphinx-apidoc` before
# running `sphinx-build -b html . _build/html`. See Issue:
# https://github.com/rtfd/readthedocs.org/issues/1139
# DON'T FORGET: Check the box "Install your project inside a virtualenv using
# setup.py install" in the RTD Advanced Settings.
Expand Down Expand Up @@ -59,13 +59,13 @@
except Exception as e:
print("Running `sphinx-apidoc` failed!\n{}".format(e))

# -- General configuration -----------------------------------------------------
# -- General configuration ----------------------------------------------------

# If your documentation needs a minimal Sphinx version, state it here.
# needs_sphinx = '1.0'

# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.intersphinx",
Expand Down Expand Up @@ -118,7 +118,8 @@
# directories to ignore when looking for source files.
exclude_patterns = ["_build"]

# The reST default role (used for this markup: `text`) to use for all documents.
# The reST default role (used for this markup: `text`) to use for all
# documents.
# default_role = None

# If true, '()' will be appended to :func: etc. cross-reference text.
Expand All @@ -142,7 +143,7 @@
# keep_warnings = False


# -- Options for HTML output ---------------------------------------------------
# -- Options for HTML output --------------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
Expand Down Expand Up @@ -227,7 +228,7 @@
htmlhelp_basename = "actinia_satellite_plugin-doc"


# -- Options for LaTeX output --------------------------------------------------
# -- Options for LaTeX output -------------------------------------------------

latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
Expand All @@ -238,8 +239,8 @@
# 'preamble': '',
}

# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass [howto/manual]).
# Grouping the document tree into LaTeX files. List of tuples (source start
# file, target name, title, author, documentclass [howto/manual]).
latex_documents = [
(
"index",
Expand Down Expand Up @@ -270,7 +271,7 @@
# If false, no module index is generated.
# latex_domain_indices = True

# -- External mapping ------------------------------------------------------------
# -- External mapping ---------------------------------------------------------
python_version = ".".join(map(str, sys.version_info[0:2]))
intersphinx_mapping = {
"sphinx": ("http://www.sphinx-doc.org/en/stable", None),
Expand Down
1 change: 0 additions & 1 deletion scripts/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
create_process_queue(global_config)


########################################################################################################################
if __name__ == "__main__":
# Connect to the database
flask_app.run(host="0.0.0.0", port=8080, debug=True)
149 changes: 101 additions & 48 deletions src/actinia_satellite_plugin/aws_sentinel2a_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,23 +27,29 @@ class BandInformationEntry(Schema):
properties = {
"file_name": {
"type": "string",
"description": "The suggested file name of this band from the requested satellite scene",
"description": "The suggested file name of this band from the "
"requested satellite scene",
},
"map_name": {
"type": "string",
"description": "The suggested GRASS GIS raster map name of this band from the requested satellite scene",
"description": "The suggested GRASS GIS raster map name of this "
"band from the requested satellite scene",
},
"public_url": {
"type": "string",
"description": "The download URl of the band from requested satellite scene",
"description": "The download URl of the band from requested "
"satellite scene",
},
}
required = ["public_url", "map_name", "file_name"]

example = {
"file_name": "S2A_MSIL1C_20170202T090201_N0204_R007_T36TVT_20170202T090155_tile_1_band_B04.jp2",
"map_name": "S2A_MSIL1C_20170202T090201_N0204_R007_T36TVT_20170202T090155_tile_1_band_B04",
"public_url": "http://sentinel-s2-l1c.s3.amazonaws.com/tiles/36/T/VT/2017/2/2/0/B04.jp2",
"file_name": "S2A_MSIL1C_20170202T090201_N0204_R007_T36TVT_"
"20170202T090155_tile_1_band_B04.jp2",
"map_name": "S2A_MSIL1C_20170202T090201_N0204_R007_T36TVT_"
"20170202T090155_tile_1_band_B04",
"public_url": "http://sentinel-s2-l1c.s3.amazonaws.com/tiles/36/T/"
"VT/2017/2/2/0/B04.jp2",
}


Expand Down Expand Up @@ -76,7 +82,8 @@ class Sentinel2ATileEntry(Schema):
},
"url": {
"type": "string",
"description": "The url to Sentinel2A scene root directory that contains all informations about the scene",
"description": "The url to Sentinel2A scene root directory that "
"contains all informations about the scene",
},
"timestamp": {
"type": "string",
Expand All @@ -88,20 +95,30 @@ class Sentinel2ATileEntry(Schema):

example = {
"B04": {
"file_name": "S2A_OPER_PRD_MSIL1C_PDMC_20151207T031157_R102_V20151207T003302_20151207T003302_tile_14_band_B04.jp2",
"map_name": "S2A_OPER_PRD_MSIL1C_PDMC_20151207T031157_R102_V20151207T003302_20151207T003302_tile_14_band_B04",
"public_url": "http://sentinel-s2-l1c.s3.amazonaws.com/tiles/57/V/XE/2015/12/7/0/B04.jp2",
"file_name": "S2A_OPER_PRD_MSIL1C_PDMC_20151207T031157_R102_V20"
"151207T003302_20151207T003302_tile_14_band_B04.jp2",
"map_name": "S2A_OPER_PRD_MSIL1C_PDMC_20151207T031157_R102_"
"V20151207T003302_20151207T003302_tile_14_band_B04",
"public_url": "http://sentinel-s2-l1c.s3.amazonaws.com/tiles/57/V/"
"XE/2015/12/7/0/B04.jp2",
},
"B08": {
"file_name": "S2A_OPER_PRD_MSIL1C_PDMC_20151207T031157_R102_V20151207T003302_20151207T003302_tile_14_band_B08.jp2",
"map_name": "S2A_OPER_PRD_MSIL1C_PDMC_20151207T031157_R102_V20151207T003302_20151207T003302_tile_14_band_B08",
"public_url": "http://sentinel-s2-l1c.s3.amazonaws.com/tiles/57/V/XE/2015/12/7/0/B08.jp2",
"file_name": "S2A_OPER_PRD_MSIL1C_PDMC_20151207T031157_R102_V20"
"151207T003302_20151207T003302_tile_14_band_B08.jp2",
"map_name": "S2A_OPER_PRD_MSIL1C_PDMC_20151207T031157_R102_"
"V20151207T003302_20151207T003302_tile_14_band_B08",
"public_url": "http://sentinel-s2-l1c.s3.amazonaws.com/tiles/57/V/"
"XE/2015/12/7/0/B08.jp2",
},
"info": "http://sentinel-s2-l1c.s3.amazonaws.com/tiles/57/V/XE/2015/12/7/0/tileInfo.json",
"metadata": "http://sentinel-s2-l1c.s3.amazonaws.com/tiles/57/V/XE/2015/12/7/0/metadata.xml",
"preview": "http://sentinel-s2-l1c.s3.amazonaws.com/tiles/57/V/XE/2015/12/7/0/preview.jpg",
"info": "http://sentinel-s2-l1c.s3.amazonaws.com/tiles/57/V/XE/2015/"
"12/7/0/tileInfo.json",
"metadata": "http://sentinel-s2-l1c.s3.amazonaws.com/tiles/57/V/XE/"
"2015/12/7/0/metadata.xml",
"preview": "http://sentinel-s2-l1c.s3.amazonaws.com/tiles/57/V/XE/"
"2015/12/7/0/preview.jpg",
"timestamp": "2015-12-07T00:33:02.634Z",
"url": "http://sentinel-s2-l1c.s3-website.eu-central-1.amazonaws.com/#tiles/57/V/XE/2015/12/7/0/",
"url": "http://sentinel-s2-l1c.s3-website.eu-central-1.amazonaws.com/"
"#tiles/57/V/XE/2015/12/7/0/",
}


Expand All @@ -120,24 +137,39 @@ class Sentinel2ASceneEntry(Schema):
}
required = ["product_id", "tiles"]
example = {
"product_id": "S2A_MSIL1C_20170202T090201_N0204_R007_T36TVT_20170202T090155",
"product_id": "S2A_MSIL1C_20170202T090201_N0204_R007_T36TVT_"
"20170202T090155",
"tiles": [
{
"B04": {
"file_name": "S2A_OPER_PRD_MSIL1C_PDMC_20151207T031157_R102_V20151207T003302_20151207T003302_tile_14_band_B04.jp2",
"map_name": "S2A_OPER_PRD_MSIL1C_PDMC_20151207T031157_R102_V20151207T003302_20151207T003302_tile_14_band_B04",
"public_url": "http://sentinel-s2-l1c.s3.amazonaws.com/tiles/57/V/XE/2015/12/7/0/B04.jp2",
"file_name": "S2A_OPER_PRD_MSIL1C_PDMC_20151207T031157_"
"R102_V20151207T003302_20151207T003302_tile_"
"14_band_B04.jp2",
"map_name": "S2A_OPER_PRD_MSIL1C_PDMC_20151207T031157_R102"
"_V20151207T003302_20151207T003302_tile_14_"
"band_B04",
"public_url": "http://sentinel-s2-l1c.s3.amazonaws.com/"
"tiles/57/V/XE/2015/12/7/0/B04.jp2",
},
"B08": {
"file_name": "S2A_OPER_PRD_MSIL1C_PDMC_20151207T031157_R102_V20151207T003302_20151207T003302_tile_14_band_B08.jp2",
"map_name": "S2A_OPER_PRD_MSIL1C_PDMC_20151207T031157_R102_V20151207T003302_20151207T003302_tile_14_band_B08",
"public_url": "http://sentinel-s2-l1c.s3.amazonaws.com/tiles/57/V/XE/2015/12/7/0/B08.jp2",
"file_name": "S2A_OPER_PRD_MSIL1C_PDMC_20151207T031157_"
"R102_V20151207T003302_20151207T003302_tile_"
"14_band_B08.jp2",
"map_name": "S2A_OPER_PRD_MSIL1C_PDMC_20151207T031157_R102"
"_V20151207T003302_20151207T003302_tile_14_"
"band_B08",
"public_url": "http://sentinel-s2-l1c.s3.amazonaws.com/"
"tiles/57/V/XE/2015/12/7/0/B08.jp2",
},
"info": "http://sentinel-s2-l1c.s3.amazonaws.com/tiles/57/V/XE/2015/12/7/0/tileInfo.json",
"metadata": "http://sentinel-s2-l1c.s3.amazonaws.com/tiles/57/V/XE/2015/12/7/0/metadata.xml",
"preview": "http://sentinel-s2-l1c.s3.amazonaws.com/tiles/57/V/XE/2015/12/7/0/preview.jpg",
"info": "http://sentinel-s2-l1c.s3.amazonaws.com/tiles/57/V/"
"XE/2015/12/7/0/tileInfo.json",
"metadata": "http://sentinel-s2-l1c.s3.amazonaws.com/tiles/"
"57/V/XE/2015/12/7/0/metadata.xml",
"preview": "http://sentinel-s2-l1c.s3.amazonaws.com/tiles/"
"57/V/XE/2015/12/7/0/preview.jpg",
"timestamp": "2015-12-07T00:33:02.634Z",
"url": "http://sentinel-s2-l1c.s3-website.eu-central-1.amazonaws.com/#tiles/57/V/XE/2015/12/7/0/",
"url": "http://sentinel-s2-l1c.s3-website.eu-central-1."
"amazonaws.com/#tiles/57/V/XE/2015/12/7/0/",
}
],
}
Expand All @@ -154,47 +186,66 @@ class Sentinel2ASceneList(Schema):
}
example = [
{
"product_id": "S2A_MSIL1C_20170202T090201_N0204_R007_T36TVT_20170202T090155",
"product_id": "S2A_MSIL1C_20170202T090201_N0204_R007_T36TVT_"
"20170202T090155",
"tiles": [
{
"B04": {
"file_name": "S2A_OPER_PRD_MSIL1C_PDMC_20151207T031157_R102_V20151207T003302_20151207T003302_tile_14_band_B04.jp2",
"map_name": "S2A_OPER_PRD_MSIL1C_PDMC_20151207T031157_R102_V20151207T003302_20151207T003302_tile_14_band_B04",
"public_url": "http://sentinel-s2-l1c.s3.amazonaws.com/tiles/57/V/XE/2015/12/7/0/B04.jp2",
"file_name": "S2A_OPER_PRD_MSIL1C_PDMC_20151207T031157"
"_R102_V20151207T003302_20151207T003302_"
"tile_14_band_B04.jp2",
"map_name": "S2A_OPER_PRD_MSIL1C_PDMC_20151207T031157_"
"R102_V20151207T003302_20151207T003302_"
"tile_14_band_B04",
"public_url": "http://sentinel-s2-l1c.s3.amazonaws."
"com/tiles/57/V/XE/2015/12/7/0/B04.jp2",
},
"B08": {
"file_name": "S2A_OPER_PRD_MSIL1C_PDMC_20151207T031157_R102_V20151207T003302_20151207T003302_tile_14_band_B08.jp2",
"map_name": "S2A_OPER_PRD_MSIL1C_PDMC_20151207T031157_R102_V20151207T003302_20151207T003302_tile_14_band_B08",
"public_url": "http://sentinel-s2-l1c.s3.amazonaws.com/tiles/57/V/XE/2015/12/7/0/B08.jp2",
"file_name": "S2A_OPER_PRD_MSIL1C_PDMC_20151207T031157"
"_R102_V20151207T003302_20151207T003302_"
"tile_14_band_B08.jp2",
"map_name": "S2A_OPER_PRD_MSIL1C_PDMC_20151207T031157"
"_R102_V20151207T003302_20151207T003302_"
"tile_14_band_B08",
"public_url": "http://sentinel-s2-l1c.s3.amazonaws.com"
"/tiles/57/V/XE/2015/12/7/0/B08.jp2",
},
"info": "http://sentinel-s2-l1c.s3.amazonaws.com/tiles/57/V/XE/2015/12/7/0/tileInfo.json",
"metadata": "http://sentinel-s2-l1c.s3.amazonaws.com/tiles/57/V/XE/2015/12/7/0/metadata.xml",
"preview": "http://sentinel-s2-l1c.s3.amazonaws.com/tiles/57/V/XE/2015/12/7/0/preview.jpg",
"info": "http://sentinel-s2-l1c.s3.amazonaws.com/tiles/57/"
"V/XE/2015/12/7/0/tileInfo.json",
"metadata": "http://sentinel-s2-l1c.s3.amazonaws.com/tiles"
"/57/V/XE/2015/12/7/0/metadata.xml",
"preview": "http://sentinel-s2-l1c.s3.amazonaws.com/tiles"
"/57/V/XE/2015/12/7/0/preview.jpg",
"timestamp": "2015-12-07T00:33:02.634Z",
"url": "http://sentinel-s2-l1c.s3-website.eu-central-1.amazonaws.com/#tiles/57/V/XE/2015/12/7/0/",
"url": "http://sentinel-s2-l1c.s3-website.eu-central-1."
"amazonaws.com/#tiles/57/V/XE/2015/12/7/0/",
}
],
}
]


class Sentinel2ASceneListModel(Schema):
"""This schema defines the JSON input of the sentinel time series creator resource"""
"""This schema defines the JSON input of the sentinel time series creator
resource
"""

type = "object"
properties = {
"bands": {
"type": "array",
"items": {"type": "string"},
"description": "A list of band names that should be downloaded and imported for each Sentinel-2 scene."
'Available are the following band names: "B01", "B02", "B03", "B04", "B05", "B06", "B07",'
'"B08", "B8A", "B09" "B10", "B11", "B12"',
"description": "A list of band names that should be downloaded "
"and imported for each Sentinel-2 scene."
'Available are the following band names: "B01", "B02", "B03", '
'"B04", "B05", "B06", "B07", "B08", "B8A", "B09" "B10", "B11", '
'"B12"',
},
"product_ids": {
"type": "array",
"items": {"type": "string"},
"description": "A list of Sentinel-2 scene names of which the tile download urls "
"and metadata infor urls should be provided.",
"description": "A list of Sentinel-2 scene names of which the tile"
" download urls and metadata infor urls should be provided.",
},
}
example = {
Expand All @@ -211,8 +262,8 @@ class Sentinel2ASceneListModel(Schema):

SCHEMA_DOC = {
"tags": ["Satellite Image Algorithms"],
"description": "Generate the download urls for a list of sentinel2A scenes and band numbers. "
"Minimum required user role: user.",
"description": "Generate the download urls for a list of sentinel2A scenes"
" and band numbers. Minimum required user role: user.",
"consumes": ["application/json"],
"parameters": [
{
Expand Down Expand Up @@ -244,7 +295,9 @@ class AWSSentinel2ADownloadLinkQuery(ResourceBase):

@swagger.doc(deepcopy(SCHEMA_DOC))
def post(self):
"""Generate the download urls for a list of sentinel2A scenes and band numbers."""
"""Generate the download urls for a list of sentinel2A scenes and band
numbers.
"""

try:
iface = AWSSentinel2AInterface(global_config)
Expand Down
Loading

0 comments on commit ff3aeb2

Please sign in to comment.