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
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
6083d96
first init
krishnaglodha Jul 15, 2023
fc2be1d
added typing for map
krishnaglodha Jul 15, 2023
64df97f
added colormaps
krishnaglodha Jul 16, 2023
dcb8364
working on common
krishnaglodha Jul 16, 2023
87ca1a6
fix spell error
krishnaglodha Jul 16, 2023
3f433b5
added deck
krishnaglodha Jul 16, 2023
afc49d2
working on folium
krishnaglodha Jul 16, 2023
addaae4
worked on folium map
krishnaglodha Jul 17, 2023
cc1b3d5
fixed common
krishnaglodha Jul 17, 2023
f78e85b
added heremap
krishnaglodha Jul 17, 2023
0763cc8
added kepler
krishnaglodha Jul 17, 2023
3c459ee
added osm
krishnaglodha Jul 17, 2023
4cf157b
updated pc
krishnaglodha Jul 17, 2023
661b9e7
changed Tuple to tuple
krishnaglodha Jul 17, 2023
43d03d8
added plotlymap
krishnaglodha Jul 17, 2023
4598bc3
working on stack
krishnaglodha Jul 17, 2023
5ad9fcc
updated osm.py and req
krishnaglodha Jul 18, 2023
ffaea01
updated stac
krishnaglodha Jul 18, 2023
fd43fbf
updated all py files
krishnaglodha Jul 18, 2023
2481732
removed stac_io type hint
krishnaglodha Jul 18, 2023
c5e670e
tuple to Tuple
krishnaglodha Jul 18, 2023
52ae83d
tuple to Tuple
krishnaglodha Jul 18, 2023
f6184f3
fixed typos
krishnaglodha Jul 18, 2023
1172614
updated bokehmap to Sequency
krishnaglodha Jul 19, 2023
5ccb401
updated stac and plotlymap
krishnaglodha Jul 19, 2023
4b80a57
updated plotlymap
krishnaglodha Jul 19, 2023
dca221b
access_token - None
krishnaglodha Jul 19, 2023
c16c880
updated with black
krishnaglodha Jul 19, 2023
76bf155
removed kml
krishnaglodha Jul 19, 2023
249a888
updated basemap and stac
krishnaglodha Jul 19, 2023
bd45c1e
updated bokeh
krishnaglodha Jul 19, 2023
d586515
Merge branch 'master' into fix/addtyping
krishnaglodha Jul 19, 2023
b47efef
updated notebook
krishnaglodha Jul 19, 2023
e962c5e
Merge branch 'fix/addtyping' of https://github.com/krishnaglodha/leaf…
krishnaglodha Jul 19, 2023
147552a
Update mkdocs.yml
krishnaglodha Jul 19, 2023
35b010e
updated req
krishnaglodha Jul 19, 2023
4ba8314
updated mkdocs
krishnaglodha Jul 19, 2023
de756ef
removed geemap
krishnaglodha Jul 20, 2023
f6c1a45
made collection as Optional
krishnaglodha Jul 20, 2023
c1a666a
added None to Collection
krishnaglodha Jul 21, 2023
6e43faf
Fix bokeh error
giswqs Aug 8, 2023
1794bf4
Fix bokehmap typing
giswqs Aug 8, 2023
cea8e8b
Pin pyymal version
giswqs Aug 8, 2023
fc6eaaf
Fix pyymal error
giswqs Aug 8, 2023
61d6a19
Skip notebook 71
giswqs Aug 8, 2023
e6bf16b
Fix button width error
giswqs Aug 8, 2023
e0ecdf5
Fix basemap notebook error
giswqs Aug 9, 2023
1224dcc
Improve typing
giswqs Aug 9, 2023
6ba14b8
Improve typing
giswqs Aug 9, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/docs-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
gdalinfo --version
- name: Install dependencies
run: |
pip install --no-cache-dir Cython
pip install --no-cache-dir Cython PyYAML==6.0.1
pip install -r requirements.txt -r requirements_dev.txt
pip install .
- name: Discover typos with codespell
Expand Down
61 changes: 0 additions & 61 deletions docs/notebooks/02_using_basemaps.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -167,67 +167,6 @@
"m.add_legend(builtin_legend=\"NWI\")\n",
"m"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Add a layer from [xyzservices](https://github.com/geopandas/xyzservices) provider object"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import os\n",
"import xyzservices.providers as xyz"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"basemap = xyz.HEREv3.basicMap\n",
"basemap"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Pass the api key to the xyzservices provider object or set it as an environment variable."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"basemap['apiKey'] = os.environ[\"HEREMAPS_API_KEY\"]"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Add the xyzservices provider object as a layer to the map."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"m = leafmap.Map()\n",
"m.add_basemap(basemap)\n",
"m"
]
}
],
"metadata": {
Expand Down
2 changes: 1 addition & 1 deletion docs/notebooks/38_plotly.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"metadata": {},
"outputs": [],
"source": [
"# leafmap.fix_widget_error()"
"leafmap.fix_widget_error()"
]
},
{
Expand Down
61 changes: 0 additions & 61 deletions examples/notebooks/02_using_basemaps.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -167,67 +167,6 @@
"m.add_legend(builtin_legend=\"NWI\")\n",
"m"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Add a layer from [xyzservices](https://github.com/geopandas/xyzservices) provider object"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import os\n",
"import xyzservices.providers as xyz"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"basemap = xyz.HEREv3.basicMap\n",
"basemap"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Pass the api key to the xyzservices provider object or set it as an environment variable."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"basemap['apiKey'] = os.environ[\"HEREMAPS_API_KEY\"]"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Add the xyzservices provider object as a layer to the map."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"m = leafmap.Map()\n",
"m.add_basemap(basemap)\n",
"m"
]
}
],
"metadata": {
Expand Down
19 changes: 10 additions & 9 deletions leafmap/basemaps.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import ipyleaflet
import xyzservices.providers as xyz
from .common import check_package, planet_tiles
from typing import Dict, Optional, List

# from box import Box

Expand Down Expand Up @@ -228,7 +229,7 @@ def _unpack_sub_parameters(var, param):
return temp


def get_xyz_dict(free_only=True, france=False):
def get_xyz_dict(free_only: bool = True, france: bool = False) -> Dict:
"""Returns a dictionary of xyz services.

Args:
Expand Down Expand Up @@ -279,7 +280,7 @@ def get_xyz_dict(free_only=True, france=False):
return xyz_dict


def xyz_to_leaflet():
def xyz_to_leaflet() -> Dict:
"""Convert xyz tile services to ipyleaflet tile layers.

Returns:
Expand All @@ -306,7 +307,7 @@ def xyz_to_leaflet():
return leaflet_dict


def xyz_to_pydeck():
def xyz_to_pydeck() -> Dict:
"""Convert xyz tile services to pydeck custom tile layers.

Returns:
Expand Down Expand Up @@ -345,7 +346,7 @@ def xyz_to_pydeck():
return pydeck_dict


def xyz_to_folium():
def xyz_to_folium() -> Dict:
"""Convert xyz tile services to folium tile layers.

Returns:
Expand Down Expand Up @@ -409,7 +410,7 @@ def xyz_to_folium():
return folium_dict


def xyz_to_heremap():
def xyz_to_heremap() -> Dict:
"""Convert xyz tile services to hermap tile layers.

Returns:
Expand Down Expand Up @@ -510,7 +511,7 @@ def xyz_to_heremap():
return heremap_dict


def xyz_to_plotly():
def xyz_to_plotly() -> Dict:
"""Convert xyz tile services to plotly tile layers.

Returns:
Expand Down Expand Up @@ -546,7 +547,7 @@ def xyz_to_plotly():
return plotly_dict


def xyz_to_bokeh():
def xyz_to_bokeh() -> Dict:
"""Convert xyz tile services to bokeh tile layers.

Returns:
Expand Down Expand Up @@ -600,13 +601,13 @@ def search_qms(keywords, limit=10):
return services["results"][:limit]


def get_qms(service_id):
def get_qms(service_id: str) -> Dict:
QMS_API = "https://qms.nextgis.com/api/v1/geoservices"
service_details = requests.get(f"{QMS_API}/{service_id}")
return service_details.json()


def qms_to_leafmap(service_id):
def qms_to_leafmap(service_id: str) -> Dict:
service_details = get_qms(service_id)
name = service_details["name"]
url = service_details["url"]
Expand Down
Loading