Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/addtyping #494

Merged
merged 49 commits into from
Aug 9, 2023
Merged

Fix/addtyping #494

merged 49 commits into from
Aug 9, 2023

Conversation

krishnaglodha
Copy link
Collaborator

fixed basemaps and bokehmap file

@krishnaglodha
Copy link
Collaborator Author

@giswqs can you please approve test CI file

@giswqs
Copy link
Member

giswqs commented Jul 18, 2023

I just did. CI is automatically disabled for new contributors. It should run automatically after your first PR.

@krishnaglodha
Copy link
Collaborator Author

I see

@krishnaglodha
Copy link
Collaborator Author

I'll need a bit of to and fro for this PR as I am relying on testing from CI

@giswqs
Copy link
Member

giswqs commented Jul 18, 2023

Check your email for the invite to become a collaborator for the project. CI should be able to run automatically for all collaborators.

@@ -286,7 +291,7 @@ def random_string(string_length=3):
return "".join(random.choice(letters) for i in range(string_length))


def open_image_from_url(url):
def open_image_from_url(url: str) -> dict:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing the return data type -> dict, which is incorrect.

leafmap/deck.py Outdated
@@ -3,7 +3,7 @@
from .osm import *
from .leafmap import basemaps
from . import examples

from geopandas import GeoDataFrame
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing this line as GeoPandas is not a required dependency.

@@ -14,6 +14,9 @@
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, Tuple
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The heremap package has not update since October 2021. I am going to remove this module.
https://github.com/heremaps/here-map-widget-for-jupyter

@@ -13,8 +13,14 @@
from folium.elements import JSCSSMixin
from folium.map import Layer
from jinja2 import Template
from geopandas import GeoDataFrame, GeoSeries
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing this line. GeoPandas is not a required dependency.

from typing import Optional, Union, Any, Callable, Dict, Tuple
import shapely
from sqlalchemy.engine import Engine
from ipywidgets.widgets import Image as ipywidgetsImage

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing shapely and sqlalchemy that are not required dependencies.

opacity: Optional[float] = 1.0,
shown: Optional[bool] = True,
bands: Optional[List] = None,
titiler_endpoint: Optional[str] = "https://titiler.xyz",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default value should be None.

@@ -1707,7 +1734,7 @@ def st_map_bounds(self, st_component):
bounds = [[south, west], [north, east]]
return bounds

def st_fit_bounds(self):
def st_fit_bounds(self) -> folium.Map:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The function does not return values. Removing -> folium.Map

popup: Optional[List] = None,
min_width: Optional[int] = 100,
max_width: Optional[int] = 200,
layer_name: Optional[str] = "Points",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default layer name is Marker Cluster, not Points

layer_name: Optional[str] = "Points",
color_column: Optional[str] = None,
marker_colors: Optional[List] = None,
icon_colors: Optional[List] = None,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default icon_colors is ["white"]

color_column: Optional[str] = None,
marker_colors: Optional[List] = None,
icon_colors: Optional[List] = None,
icon_names: Optional[List] = None,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default icon_names is ["info"]

@@ -9,6 +9,10 @@
from .common import *
from .osm import *
from . import examples
from typing import Optional, Union, Dict
from geopandas import GeoDataFrame
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing geopandas

from typing import Optional, Union, Dict
from geopandas import GeoDataFrame
from pandas import DataFrame
from sqlalchemy.engine import Engine
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing sqlalchemy

leafmap/osm.py Outdated

warnings.filterwarnings("ignore")
from geopandas import GeoDataFrame
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing Geopandas


warnings.filterwarnings("ignore")
from geopandas import GeoDataFrame
from shapely.geometry import Polygon, MultiPolygon
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing shapely. Not a required dependency.

leafmap/osm.py Outdated
webbrowser.open_new_tab("https://wiki.openstreetmap.org/wiki/Map_features")


"""The module contains functions for downloading OpenStreetMap data. It wraps the geometries module of the osmnx package
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicate copy of the modules. Removing all lines after 426

@@ -7,6 +7,9 @@
from .common import *
from .osm import *
from . import examples
from typing import Optional, List, Union, Dict, Tuple
from plotly import graph_objects
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing graph_objects import

attribution: Optional[str] = "",
opacity: Optional[float] = 1.0,
bands: Optional[List] = None,
titiler_endpoint: Optional[str] = "https://titiler.xyz",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default value should be None

leafmap/stac.py Outdated
@@ -1,16 +1,20 @@
import os
import pystac
import requests
from typing import Optional, Dict, List, Callable, Any, Tuple, Union
import pystac_client.item_search
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing pystac_client.item_search

leafmap/stac.py Outdated
@@ -105,7 +109,7 @@ def url_for_mosaic_lat_lon_assets(self, searchid, lon, lat):
return f"{self.endpoint}/mosaic/{searchid}/{lon},{lat}/assets"


def check_titiler_endpoint(titiler_endpoint=None):
def check_titiler_endpoint(titiler_endpoint: Optional[str] = None) -> Dict:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The return type is not Dict.

@@ -8,9 +8,14 @@
from ipyfilechooser import FileChooser
from .common import *
from .pc import *
from typing import Optional, Union, Dict, List
from leafmap import Map as leafMap
from ipyleaflet import Map as ipyleafletMap
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing leafMap and ipyleafletMap

@@ -579,7 +584,7 @@ def layers_btn_click(change):
m.add(toolbar_control)


def open_data_widget(m):
def open_data_widget(m: Dict):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

m is not Dict type.

@giswqs
Copy link
Member

giswqs commented Aug 9, 2023

All issues have been resolved. It is ready to be merged now. Thank you very much for your contribution, @krishnaglodha

@giswqs giswqs merged commit 1dc8e24 into opengeos:master Aug 9, 2023
11 checks passed
@giswqs giswqs mentioned this pull request Aug 9, 2023
sthagen pushed a commit to sthagen/giswqs-leafmap that referenced this pull request Jul 10, 2024
* first init

* added typing for map

* added colormaps

* working on common

* fix spell error

* added deck

* working on folium

* worked on folium map

* fixed common

* added heremap

* added kepler

* added osm

* updated pc

* changed Tuple to tuple

* added plotlymap

* working on stack

* updated osm.py and req

* updated stac

* updated all py files

* removed stac_io type hint

* tuple to Tuple

* tuple to Tuple

* fixed typos

* updated bokehmap to Sequency

* updated stac and plotlymap

* updated plotlymap

* access_token - None

* updated with black

* removed kml

* updated basemap and stac

* updated bokeh

* updated notebook

* Update mkdocs.yml

added "notebooks/38_plotly.ipynb", in execute_ignore

* updated req

* updated mkdocs

* removed geemap

* made collection as Optional

* added None to Collection

* Fix bokeh error

* Fix bokehmap typing

* Pin pyymal version

* Fix pyymal error

* Skip notebook 71

* Fix button width error

* Fix basemap notebook error

* Improve typing

* Improve typing

---------

Co-authored-by: Qiusheng Wu <giswqs@gmail.com>
kuzja111 pushed a commit to kuzja111/leafmap that referenced this pull request Jul 25, 2024
* first init

* added typing for map

* added colormaps

* working on common

* fix spell error

* added deck

* working on folium

* worked on folium map

* fixed common

* added heremap

* added kepler

* added osm

* updated pc

* changed Tuple to tuple

* added plotlymap

* working on stack

* updated osm.py and req

* updated stac

* updated all py files

* removed stac_io type hint

* tuple to Tuple

* tuple to Tuple

* fixed typos

* updated bokehmap to Sequency

* updated stac and plotlymap

* updated plotlymap

* access_token - None

* updated with black

* removed kml

* updated basemap and stac

* updated bokeh

* updated notebook

* Update mkdocs.yml

added "notebooks/38_plotly.ipynb", in execute_ignore

* updated req

* updated mkdocs

* removed geemap

* made collection as Optional

* added None to Collection

* Fix bokeh error

* Fix bokehmap typing

* Pin pyymal version

* Fix pyymal error

* Skip notebook 71

* Fix button width error

* Fix basemap notebook error

* Improve typing

* Improve typing

---------

Co-authored-by: Qiusheng Wu <giswqs@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants