Skip to content

Commit

Permalink
remove traces of stamen from climada_python
Browse files Browse the repository at this point in the history
for url argument demo in baseplot use NatGeoWorldMap instead
  • Loading branch information
emanuel-schmid committed Oct 27, 2023
1 parent c8a0587 commit 9ba8873
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 30 deletions.
8 changes: 4 additions & 4 deletions climada/engine/impact.py
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,7 @@ def plot_raster_eai_exposure(self, res=None, raster_res=None, save_tiff=None,

def plot_basemap_eai_exposure(self, mask=None, ignore_zero=False, pop_name=True,
buffer=0.0, extend='neither', zoom=10,
url=ctx.providers.Stamen.Terrain,
url=ctx.providers.OpenStreetMap.Mapnik,
axis=None, **kwargs):
"""Plot basemap expected impact of each exposure within a period of 1/frequency_unit.
Expand All @@ -694,7 +694,7 @@ def plot_basemap_eai_exposure(self, mask=None, ignore_zero=False, pop_name=True,
zoom : int, optional
zoom coefficient used in the satellite image
url : str, optional
image source, e.g. ctx.providers.OpenStreetMap.Mapnik
image source, default: ctx.providers.OpenStreetMap.Mapnik
axis : matplotlib.axes.Axes, optional
axis to use
kwargs : dict, optional
Expand Down Expand Up @@ -764,7 +764,7 @@ def plot_hexbin_impact_exposure(self, event_id=1, mask=None, ignore_zero=False,

def plot_basemap_impact_exposure(self, event_id=1, mask=None, ignore_zero=False,
pop_name=True, buffer=0.0, extend='neither', zoom=10,
url=ctx.providers.Stamen.Terrain,
url=ctx.providers.OpenStreetMap.Mapnik,
axis=None, **kwargs):
"""Plot basemap impact of an event at each exposure.
Requires attribute imp_mat.
Expand All @@ -789,7 +789,7 @@ def plot_basemap_impact_exposure(self, event_id=1, mask=None, ignore_zero=False,
zoom : int, optional
zoom coefficient used in the satellite image
url : str, optional
image source, e.g. ctx.providers.OpenStreetMap.Mapnik
image source, default: ctx.providers.OpenStreetMap.Mapnik
axis : matplotlib.axes.Axes, optional
axis to use
kwargs : dict, optional
Expand Down
4 changes: 2 additions & 2 deletions climada/entity/exposures/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -749,7 +749,7 @@ def plot_raster(self, res=None, raster_res=None, save_tiff=None,

def plot_basemap(self, mask=None, ignore_zero=False, pop_name=True,
buffer=0.0, extend='neither', zoom=10,
url=None, axis=None, **kwargs):
url=ctx.providers.OpenStreetMap.Mapnik, axis=None, **kwargs):
"""Scatter points over satellite image using contextily
Parameters
Expand All @@ -771,7 +771,7 @@ def plot_basemap(self, mask=None, ignore_zero=False, pop_name=True,
zoom coefficient used in the satellite image
url : Any, optional
image source, e.g., ``ctx.providers.OpenStreetMap.Mapnik``.
Default: ``ctx.providers.Stamen.Terrain``
Default: ``ctx.providers.OpenStreetMap.Mapnik``
axis : matplotlib.axes._subplots.AxesSubplot, optional
axis to use
kwargs : optional
Expand Down
5 changes: 1 addition & 4 deletions climada/test/test_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,7 @@ def test_ctx_osm_pass(self):
myexp.gdf['value'] = np.array([1, 1, 1])
myexp.check()

try:
myexp.plot_basemap(url=ctx.providers.OpenStreetMap.Mapnik)
except urllib.error.HTTPError:
self.assertEqual(1, 0)
myexp.plot_basemap(url=ctx.providers.OpenStreetMap.Mapnik)

def test_disc_rates(self):
"""Test plot function of discount rates."""
Expand Down
38 changes: 18 additions & 20 deletions doc/tutorial/climada_entity_Exposures.ipynb

Large diffs are not rendered by default.

0 comments on commit 9ba8873

Please sign in to comment.