From d24931a77c4e5fafaf48e8ee2cf8b7ac9b16585c Mon Sep 17 00:00:00 2001
From: Remi Cresson <remi.cresson@irstea.fr>
Date: Fri, 13 May 2022 15:59:56 +0200
Subject: [PATCH] DOC: fix mkdocs
---
doc/arch.md | 100 +++++++++++++++++++++++++++----------------
doc/gen_ref_pages.py | 12 ++++--
2 files changed, 72 insertions(+), 40 deletions(-)
diff --git a/doc/arch.md b/doc/arch.md
index 5840f4e..47084e8 100644
--- a/doc/arch.md
+++ b/doc/arch.md
@@ -45,6 +45,10 @@ superimposed.write("superimposed.tif")
# Classes
+## Scene class
+
+The scene class handles all the metadata and the imagery.
+
```mermaid
classDiagram
@@ -55,16 +59,6 @@ classDiagram
Sentinel2SceneBase <|-- Sentinel23AScene
Scene --* Imagery: root_scene
- Imagery <|-- Spot67Imagery
- Imagery <|-- Sentinel2ImageryBase
- Sentinel2ImageryBase <|-- Sentinel22AImagery
- Sentinel2ImageryBase <|-- Sentinel23AImagery
-
- Imagery --* Source: root_imagery
- Source <|-- Spot67Source
- Source <|-- Sentinel2Source
- Sentinel2Source <|-- Sentinel22ASource
- Sentinel2Source <|-- Sentinel23ASource
class Scene{
+datetime acquisition_date
@@ -109,7 +103,66 @@ classDiagram
+Sentinel3AImagery get_imagery()
+get_metadata()
}
+
+```
+
+## Imagery
+
+The imagery stores the images sources for a particular sensor.
+
+
+```mermaid
+classDiagram
+
+ Imagery <|-- Spot67Imagery
+ Imagery <|-- Sentinel2ImageryBase
+ Sentinel2ImageryBase <|-- Sentinel22AImagery
+ Sentinel2ImageryBase <|-- Sentinel23AImagery
+
+ Imagery --* Source: root_imagery
+
+ class Imagery{
+ +__init__(root_scene)
+ +Scene root_scene
+ }
+
+ class Spot67Imagery{
+ +__init__(root_scene)
+ +Source get_pxs()
+ +Source get_pan()
+ +Source get_xs()
+ }
+ class Sentinel2ImageryBase{
+ +_concatenate_10m_bands()
+ +_concatenate_20m_bands()
+ }
+
+ class Sentinel22AImagery{
+ +get_10m_bands()
+ +get_20m_bands()
+ }
+
+ class Sentinel23AImagery{
+ +get_10m_bands()
+ +get_20m_bands()
+ }
+
+```
+
+## Source
+
+The source stores the image pipeline that delivers the pixels.
+
+```mermaid
+classDiagram
+
+ Source <|-- Spot67Source
+ Source <|-- Sentinel2Source
+ Sentinel2Source <|-- Sentinel22ASource
+ Sentinel2Source <|-- Sentinel23ASource
+
+
class Source{
+__init__(root_imagery, out, parent=None)
+Imagery root_imagery
@@ -139,32 +192,5 @@ classDiagram
class Sentinel23ASource{
+Source flg_msk_drilled(keep_flags_values=(3, 4), nodata=0)
}
-
- class Imagery{
- +__init__(root_scene)
- +Scene root_scene
- }
-
- class Spot67Imagery{
- +__init__(root_scene)
- +Source get_pxs()
- +Source get_pan()
- +Source get_xs()
- }
-
- class Sentinel2ImageryBase{
- +_concatenate_10m_bands()
- +_concatenate_20m_bands()
- }
-
- class Sentinel22AImagery{
- +get_10m_bands()
- +get_20m_bands()
- }
-
- class Sentinel23AImagery{
- +get_10m_bands()
- +get_20m_bands()
- }
```
diff --git a/doc/gen_ref_pages.py b/doc/gen_ref_pages.py
index fd04d0b..8e3e2b2 100644
--- a/doc/gen_ref_pages.py
+++ b/doc/gen_ref_pages.py
@@ -6,16 +6,22 @@ import mkdocs_gen_files
nav = mkdocs_gen_files.Nav()
-for path in sorted(Path("scenes").rglob("*.py")):
+processed_paths = ["app", "scenes"]
+
+for path in sorted(Path(".").rglob("*.py")):
print(f"path: {path}")
- module_path = path.relative_to("scenes").with_suffix("")
- doc_path = path.relative_to("scenes").with_suffix(".md")
+ module_path = path.relative_to(".").with_suffix("")
+ doc_path = path.relative_to(".").with_suffix(".md")
full_doc_path = Path("reference", doc_path)
print(f"module path: {module_path}")
print(f"doc path:{doc_path}")
parts = tuple(module_path.parts)
print(f"parts: {parts}")
+ if parts[0] not in processed_paths:
+ continue
+ print("--------")
+
if parts[-1] == "__init__":
if len(parts) <= 1:
--
GitLab