Skip to content

Commit

Permalink
Changed references-documentation page from project- to module-level
Browse files Browse the repository at this point in the history
  • Loading branch information
S-Holstein committed Aug 16, 2024
1 parent e74fa8b commit b3b416e
Show file tree
Hide file tree
Showing 25 changed files with 149 additions and 121 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@
venv
dist
.idea
.vscode
.vscode
.pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Reference
::: lib.lib
# Base
::: lib.lib.base
options:
show_submodules: true
4 changes: 4 additions & 0 deletions docs/design/common-library/api/datasets.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Datasets
::: lib.lib.datasets
options:
show_submodules: true
4 changes: 4 additions & 0 deletions docs/design/common-library/api/providers.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Providers
::: lib.lib.providers
options:
show_submodules: true
4 changes: 4 additions & 0 deletions docs/design/common-library/api/resources.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Resources
::: lib.lib.resources
options:
show_submodules: true
2 changes: 1 addition & 1 deletion lib/lib/base/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

def access_token():
"""
Description...
Description...
Returns:
(str): ...
Expand Down
10 changes: 5 additions & 5 deletions lib/lib/base/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def untar_file(tar_file, remove_tar=True, create_folder=False, base_folder=None)

def check_file_size(expected_file_size, file_path):
"""
Description...
Description...
Parameters:
expected_file_size: x
Expand All @@ -175,7 +175,7 @@ def check_file_size(expected_file_size, file_path):

def get_file_size(file_path):
"""
Description...
Description...
Parameters:
file_path: x
Expand All @@ -194,7 +194,7 @@ def get_file_size(file_path):

def get_folder_size(folder_path):
"""
Description...
Description...
Parameters:
folder_path: x
Expand All @@ -218,7 +218,7 @@ def get_folder_size(folder_path):

def calculate_checksum(algorithm, check_file):
"""
Description...
Description...
Parameters:
algorithm: x
Expand All @@ -238,7 +238,7 @@ def calculate_checksum(algorithm, check_file):

def delete_file(file: str):
"""
Description...
Description...
Parameters:
algorithm: x
Expand Down
6 changes: 3 additions & 3 deletions lib/lib/base/geometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

def wkt_to_geom(wkt):
"""
Description...
Description...
Parameters:
wkt: x
Expand All @@ -16,7 +16,7 @@ def wkt_to_geom(wkt):

def geom_to_wkt(geom):
"""
Description...
Description...
Parameters:
geom: x
Expand All @@ -29,7 +29,7 @@ def geom_to_wkt(geom):

def calculate_bbox(geom):
"""
Description...
Description...
Parameters:
geom: x
Expand Down
2 changes: 1 addition & 1 deletion lib/lib/base/geoparquet.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

def get_max_datetime_from_geoparquet(geoparquet, column):
"""
Description...
Description...
Parameters:
geoparquet: x
Expand Down
24 changes: 12 additions & 12 deletions lib/lib/base/inventory.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

def update_inventory(scene_id, collection, inventory_dsn):
"""
Description...
Description...
Parameters:
scene_id: x
Expand Down Expand Up @@ -52,7 +52,7 @@ def update_inventory(scene_id, collection, inventory_dsn):

def get_scene_id_from_inventory_db(conn, collection, max_datetime=None):
"""
Description...
Description...
Parameters:
conn: x
Expand Down Expand Up @@ -85,7 +85,7 @@ def get_scene_id_from_inventory_db(conn, collection, max_datetime=None):

def get_scenes_from_inventory_file(db_file, date_column="ContentDate:Start", max_datetime=None):
"""
Description...
Description...
Parameters:
db_file: x
Expand Down Expand Up @@ -113,7 +113,7 @@ def get_scenes_from_inventory_file(db_file, date_column="ContentDate:Start", max

def get_scenes_diff(scenes_inventory, scenes_db, id_column):
"""
Description...
Description...
Parameters:
scenes_inventory: x
Expand Down Expand Up @@ -142,7 +142,7 @@ def get_scenes_diff(scenes_inventory, scenes_db, id_column):

def get_item_from_id(scene_id, collection, api_url="https://stac.terrabyte.lrz.de/inventory/api"):
"""
Description...
Description...
Parameters:
scene_id: x
Expand Down Expand Up @@ -170,7 +170,7 @@ def query_geoparquet(
id_column="id",
):
"""
Description...
Description...
Parameters:
inventory: x
Expand Down Expand Up @@ -229,7 +229,7 @@ def query_geoparquet(

def query_stac_db(cur, inventory, collection, max_datetime=None):
"""
Description...
Description...
Parameters:
cur: x
Expand Down Expand Up @@ -272,7 +272,7 @@ def query_stac_db(cur, inventory, collection, max_datetime=None):

def query_inventory_db(cur, inventory, collection, max_datetime=None):
"""
Description...
Description...
Parameters:
cur: x
Expand Down Expand Up @@ -328,7 +328,7 @@ def query_inventory_db(cur, inventory, collection, max_datetime=None):

def calculate_differences(collection, inventory_geoparquet, conn, id_column, date_column, max_datetime=None):
"""
Description...
Description...
Parameters:
collection: x
Expand Down Expand Up @@ -361,7 +361,7 @@ def calculate_differences(collection, inventory_geoparquet, conn, id_column, dat

def generate_stac_new_scenes(scenes, collection, inventory_fct):
"""
Description...
Description...
Parameters:
scenes: x
Expand All @@ -385,7 +385,7 @@ def generate_stac_new_scenes(scenes, collection, inventory_fct):

def import_new_scenes(scenes, collection, inventory_fct, dsn):
"""
Description...
Description...
Parameters:
scenes: x
Expand All @@ -402,7 +402,7 @@ def import_new_scenes(scenes, collection, inventory_fct, dsn):

def delete_removed_scenes(collection, to_be_removed, reasons, api_url, api_user, api_pw):
"""
Description...
Description...
Parameters:
collection: x
Expand Down
20 changes: 10 additions & 10 deletions lib/lib/base/order.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

def get_items_from_query(dsn, order_id, collections, where_query):
"""
Description...
Description...
Parameters:
dsn: x
Expand All @@ -31,7 +31,7 @@ def get_items_from_query(dsn, order_id, collections, where_query):

def get_last_items_from_collection(dsn, order_id, collection, max_items=1000):
"""
Description...
Description...
Parameters:
dsn: x
Expand All @@ -56,7 +56,7 @@ def get_last_items_from_collection(dsn, order_id, collection, max_items=1000):

def generate_batches_from_inventory(order_id, dsn, collections, where_query, batch_size=1000):
"""
Description...
Description...
Parameters:
order_id: x
Expand Down Expand Up @@ -99,7 +99,7 @@ def generate_batches_from_inventory(order_id, dsn, collections, where_query, bat

def update_database(cur, conn, order_id, where_query, order_status="ordered"):
"""
Description...
Description...
Parameters:
cur: x
Expand Down Expand Up @@ -127,7 +127,7 @@ def update_database(cur, conn, order_id, where_query, order_status="ordered"):

def update_database_batch(cur, conn, order_id, batch_id, where_query, batch_size):
"""
Description...
Description...
Parameters:
cur: x
Expand Down Expand Up @@ -161,7 +161,7 @@ def update_database_batch(cur, conn, order_id, batch_id, where_query, batch_size

def get_order_from_id(scene_id, dsn):
"""
Description...
Description...
Parameters:
scene_id: x
Expand All @@ -184,7 +184,7 @@ def get_order_from_id(scene_id, dsn):

def get_items_from_order_id(order_id, collections, dsn):
"""
Description...
Description...
Parameters:
order_id: x
Expand All @@ -211,7 +211,7 @@ def get_items_from_order_id(order_id, collections, dsn):

def insert_into_database(dsn, stac, method="insert_ignore"):
"""
Description...
Description...
Parameters:
dsn: x
Expand All @@ -235,7 +235,7 @@ def insert_into_database(dsn, stac, method="insert_ignore"):

def get_scenes_from_batch(batch_id, collections, dsn):
"""
Description...
Description...
Parameters:
batch_id: x
Expand Down Expand Up @@ -275,7 +275,7 @@ def get_scenes_from_batch(batch_id, collections, dsn):

def update_items_inventory_status(property, id, collection, dsn, status="pending"):
"""
Description...
Description...
Parameters:
property: x
Expand Down
11 changes: 5 additions & 6 deletions lib/lib/datasets/landsat.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@

def get_scene_id_info(scene_id):
"""
Description...
Description...
Parameters:
scene_id: x
Expand All @@ -122,7 +122,7 @@ def get_scene_id_info(scene_id):

def get_scene_id_folder(scene_id, folder_format=None):
"""
Description...
Description...
Parameters:
scene_id: x
Expand Down Expand Up @@ -150,7 +150,7 @@ def get_scene_id_folder(scene_id, folder_format=None):

def landsat_metadata(scene_path, scene_id, return_pystac=False, add_file_size=False):
"""
Description...
Description...
Parameters:
scene_path: x
Expand Down Expand Up @@ -204,7 +204,7 @@ def landsat_metadata(scene_path, scene_id, return_pystac=False, add_file_size=Fa

def adapt_stac_metadata(scene_path):
"""
Changes hrefs in existing Landsat STAC-Metadata
Changes hrefs in existing Landsat STAC-Metadata
Parameters:
scene_path: x
Expand Down Expand Up @@ -265,13 +265,12 @@ def adapt_stac_metadata(scene_path):
return stac_files



__log = logging.getLogger("Log Info")


def modify_landsat_stac(stac_item: pystac.item.Item):
"""
Modify the Asset-Keys and eo:bands:name for a Landsat L2 STAC-Item.
Modify the Asset-Keys and eo:bands:name for a Landsat L2 STAC-Item.
Args:
stac_item: The STAC item file to modify. Must be a STACObject.
Expand Down
4 changes: 2 additions & 2 deletions lib/lib/datasets/modis.preview.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os
from osgeo import gdal

#todo: modis.preview wird von docgenerator nicht gefunden. Möglicherweise wegen . im Namen
# todo: modis.preview wird von docgenerator nicht gefunden. Punkt im Namen müsste gegen anderes Zeichen ersetzt werden

modis_previews = {
"mod09ga": {
Expand Down Expand Up @@ -125,7 +125,7 @@

def create_preview(infile: str, outdir: str, outres: int) -> str:
"""
Creates an 8-Bit RGB COG preview of the MODIS hdf infile
Creates an 8-Bit RGB COG preview of the MODIS hdf infile
Args:
infile (str): Path to input HDF
Expand Down
Loading

0 comments on commit b3b416e

Please sign in to comment.