Skip to content

Commit

Permalink
tuple to Tuple
Browse files Browse the repository at this point in the history
  • Loading branch information
krishnaglodha committed Jul 18, 2023
1 parent 2481732 commit c5e670e
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
14 changes: 7 additions & 7 deletions leafmap/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import ipyleaflet
import ipywidgets as widgets
import whitebox
from typing import Union, List, Dict, Optional
from typing import Union, List, Dict, Optional, Tuple
from .stac import *

try:
Expand Down Expand Up @@ -437,7 +437,7 @@ def upload_to_imgur(in_gif: str):
raise Exception(e)


def rgb_to_hex(rgb: Optional[tuple[int, int, int]] = (255, 255, 255)) -> str:
def rgb_to_hex(rgb: Optional[Tuple[int, int, int]] = (255, 255, 255)) -> str:
"""Converts RGB to hex color. In RGB color R stands for Red, G stands for Green, and B stands for Blue, and it ranges from the decimal value of 0 – 255.
Args:
Expand Down Expand Up @@ -5449,7 +5449,7 @@ def find_tiles(self, region=None, return_type="list", geopandas_args={}, API={})
def find_details(
self,
bbox: List[float] = None,
polygon: List[tuple[float, float]] = None,
polygon: List[Tuple[float, float]] = None,
datasets: str = None,
prodFormats: str = None,
prodExtents: str = None,
Expand Down Expand Up @@ -7338,15 +7338,15 @@ def create_timelapse(
out_gif: str,
ext: str = ".tif",
bands: Optional[List] = None,
size: Optional[tuple] = None,
size: Optional[Tuple] = None,
bbox: Optional[List] = None,
fps: int = 5,
loop: int = 0,
add_progress_bar: bool = True,
progress_bar_color: str = "blue",
progress_bar_height: int = 5,
add_text: bool = False,
text_xy: Optional[tuple] = None,
text_xy: Optional[Tuple] = None,
text_sequence: Optional[List] = None,
font_type: str = "arial.ttf",
font_size: int = 20,
Expand All @@ -7365,15 +7365,15 @@ def create_timelapse(
out_gif (str): File path to the output gif.
ext (str, optional): The extension of the images. Defaults to '.tif'.
bands (Optional[list], optional): The bands to use for the gif. For example, [0, 1, 2] for RGB, and [0] for grayscale. Defaults to None.
size (Optional[tuple], optional): The size of the gif. For example, (500, 500). Defaults to None, using the original size.
size (Optional[Tuple], optional): The size of the gif. For example, (500, 500). Defaults to None, using the original size.
bbox (Optional[list], optional): The bounding box of the gif. For example, [xmin, ymin, xmax, ymax]. Defaults to None, using the original bounding box.
fps (int, optional): The frames per second of the gif. Defaults to 5.
loop (int, optional): The number of times to loop the gif. Defaults to 0, looping forever.
add_progress_bar (bool, optional): Whether to add a progress bar to the gif. Defaults to True.
progress_bar_color (str, optional): The color of the progress bar, can be color name or hex code. Defaults to 'blue'.
progress_bar_height (int, optional): The height of the progress bar. Defaults to 5.
add_text (bool, optional): Whether to add text to the gif. Defaults to False.
text_xy (Optional[tuple], optional): The x, y coordinates of the text. For example, ('10%', '10%').
text_xy (Optional[Tuple], optional): The x, y coordinates of the text. For example, ('10%', '10%').
Defaults to None, using the bottom left corner.
text_sequence (Optional[list], optional): The sequence of text to add to the gif. For example, ['year 1', 'year 2', ...].
font_type (str, optional): The font type of the text, can be 'arial.ttf' or 'alibaba.otf', or any system font. Defaults to 'arial.ttf'.
Expand Down
8 changes: 4 additions & 4 deletions leafmap/foliumap.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

basemaps = Box(xyz_to_folium(), frozen_box=True)
import pandas as pd
from typing import Optional, Union, Any, Callable, Dict
from typing import Optional, Union, Any, Callable, Dict, Tuple
import shapely
from sqlalchemy.engine import Engine
from ipywidgets.widgets import Image as ipywidgetsImage
Expand Down Expand Up @@ -1457,7 +1457,7 @@ def add_vector(
filename: str,
layer_name: Optional[str] = "Untitled",
bbox: Optional[
Union[tuple, GeoDataFrame, GeoSeries, shapely.geometry.base.BaseGeometry]
Union[Tuple, GeoDataFrame, GeoSeries, shapely.geometry.base.BaseGeometry]
] = None,
mask: Optional[
Union[Dict, GeoDataFrame, GeoSeries, shapely.geometry.base.BaseGeometry]
Expand Down Expand Up @@ -1972,7 +1972,7 @@ def add_colormap(
orientation: Optional[str] = "horizontal",
dpi: Optional[Union[str, float]] = "figure",
transparent: Optional[bool] = False,
position: Optional[tuple] = (70, 5),
position: Optional[Tuple] = (70, 5),
**kwargs,
):
"""Add a colorbar to the map. Under the hood, it uses matplotlib to generate the colorbar, save it as a png file, and add it to the map using m.add_image().
Expand Down Expand Up @@ -2675,7 +2675,7 @@ def add_data(
def add_image(
self,
image: Union[str, ipywidgetsImage],
position: Optional[tuple] = (0, 0),
position: Optional[Tuple] = (0, 0),
**kwargs,
):
"""Add an image to the map.
Expand Down
4 changes: 2 additions & 2 deletions leafmap/heremap.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from .basemaps import xyz_to_heremap
from .common import shp_to_geojson, gdf_to_geojson, vector_to_geojson, random_string
from . import examples
from typing import Optional, Union, List, Dict, Callable, Any
from typing import Optional, Union, List, Dict, Callable, Any, Tuple
from geopandas import GeoDataFrame, GeoSeries
import shapely.geometry.base.BaseGeometry

Expand Down Expand Up @@ -482,7 +482,7 @@ def add_vector(
filename: str,
layer_name: Optional[str] = "Untitled",
bbox: Optional[
Union[tuple, GeoDataFrame, GeoSeries, shapely.geometry.base.BaseGeometry]
Union[Tuple, GeoDataFrame, GeoSeries, shapely.geometry.base.BaseGeometry]
] = None,
mask: Optional[
Union[Dict, GeoDataFrame, GeoSeries, shapely.geometry.base.BaseGeometry]
Expand Down
4 changes: 2 additions & 2 deletions leafmap/plotlymap.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from .common import *
from .osm import *
from . import examples
from typing import Optional, List, Union, Dict
from typing import Optional, List, Union, Dict, Tuple
from plotly import graph_objects
from pandas import DataFrame

Expand Down Expand Up @@ -77,7 +77,7 @@ class Map(go.FigureWidget):

def __init__(
self,
center: Optional[tuple[float, float]] = (20, 0),
center: Optional[Tuple[float, float]] = (20, 0),
zoom: Optional[float] = 1,
basemap: Optional[str] = "open-street-map",
height: Optional[int] = 600,
Expand Down

0 comments on commit c5e670e

Please sign in to comment.