Repository: 12rambau/sepal_ui

Issue:
deprecate zip_dir
https://github.com/12rambau/sepal_ui/blob/a9255e7c566aac31ee7f8303e74fb7e8a3d57e5f/sepal_ui/aoi/aoi_model.py#L64

This folder is created on AOI call but is not used anymore as we are using the tmp module to create the tmp directory.

Discussion:

Patch:
diff --git a/docs/source/modules/sepal_ui.aoi.AoiModel.rst b/docs/source/modules/sepal_ui.aoi.AoiModel.rst
index 0f5b8f1a..ccdcab52 100644
--- a/docs/source/modules/sepal_ui.aoi.AoiModel.rst
+++ b/docs/source/modules/sepal_ui.aoi.AoiModel.rst
@@ -12,7 +12,6 @@ sepal\_ui.aoi.AoiModel
        ~AoiModel.NAME
        ~AoiModel.ISO
        ~AoiModel.GADM_BASE_URL
-       ~AoiModel.GADM_ZIP_DIR
        ~AoiModel.GAUL_ASSET
        ~AoiModel.ASSET_SUFFIX
        ~AoiModel.CUSTOM
diff --git a/sepal_ui/aoi/aoi_model.py b/sepal_ui/aoi/aoi_model.py
index ad2a72fb..40f9b4e6 100644
--- a/sepal_ui/aoi/aoi_model.py
+++ b/sepal_ui/aoi/aoi_model.py
@@ -61,11 +61,6 @@ class AoiModel(Model):
     GADM_BASE_URL = "https://biogeo.ucdavis.edu/data/gadm3.6/gpkg/gadm36_{}_gpkg.zip"
     "str: the base url to download gadm maps"
 
-    GADM_ZIP_DIR = Path.home() / "tmp" / "GADM_zip"
-    "pathlib.Path: the zip dir where we download the zips"
-
-    GADM_ZIP_DIR.mkdir(parents=True, exist_ok=True)
-
     GAUL_ASSET = "FAO/GAUL/2015/level{}"
     "str: the GAUL asset name"
 
diff --git a/sepal_ui/mapping/sepal_map.py b/sepal_ui/mapping/sepal_map.py
index 6a518ccc..6ca115fc 100644
--- a/sepal_ui/mapping/sepal_map.py
+++ b/sepal_ui/mapping/sepal_map.py
@@ -16,7 +16,7 @@ import random
 from haversine import haversine
 import numpy as np
 import rioxarray
-import xarray_leaflet
+import xarray_leaflet  # noqa: F401
 import matplotlib.pyplot as plt
 from matplotlib import colors as mpc
 from matplotlib import colorbar
@@ -38,11 +38,6 @@ from sepal_ui.mapping.basemaps import basemap_tiles
 
 __all__ = ["SepalMap"]
 
-# call x_array leaflet at least once
-# flake8 will complain as it's a pluggin (i.e. never called)
-# We don't want to ignore testing F401
-xarray_leaflet
-
 
 class SepalMap(ipl.Map):
     """
diff --git a/sepal_ui/mapping/value_inspector.py b/sepal_ui/mapping/value_inspector.py
index f848018f..783d68ad 100644
--- a/sepal_ui/mapping/value_inspector.py
+++ b/sepal_ui/mapping/value_inspector.py
@@ -3,7 +3,7 @@ import ee
 import geopandas as gpd
 from shapely import geometry as sg
 import rioxarray
-import xarray_leaflet
+import xarray_leaflet  # noqa: F401
 from rasterio.crs import CRS
 import rasterio as rio
 import ipyvuetify as v
@@ -16,11 +16,6 @@ from sepal_ui.mapping.map_btn import MapBtn
 from sepal_ui.frontend.styles import COMPONENTS
 from sepal_ui.message import ms
 
-# call x_array leaflet at least once
-# flake8 will complain as it's a pluggin (i.e. never called)
-# We don't want to ignore testing F401
-xarray_leaflet
-
 
 class ValueInspector(WidgetControl):
     """
diff --git a/sepal_ui/sepalwidgets/tile.py b/sepal_ui/sepalwidgets/tile.py
index dec40168..69a92dc0 100644
--- a/sepal_ui/sepalwidgets/tile.py
+++ b/sepal_ui/sepalwidgets/tile.py
@@ -76,7 +76,7 @@ class Tile(v.Layout, SepalWidget):
         self._metadata["mount_id"] = "nested_tile"
 
         # remove elevation
-        self.elevation = False
+        self.children[0].elevation = False
 
         # remove title
         self.set_title()


Test patch:
diff --git a/tests/test_Tile.py b/tests/test_Tile.py
index aa22d301..de0de97e 100644
--- a/tests/test_Tile.py
+++ b/tests/test_Tile.py
@@ -81,7 +81,7 @@ class TestTile:
 
         assert res == tile
         assert tile._metadata["mount_id"] == "nested_tile"
-        assert tile.elevation is False
+        assert tile.children[0].elevation == 0
         assert len(tile.children[0].children) == 1
 
         return