Skip to content

Commit ac88644

Browse files
committed
ft: added backwards compatibility for pycsep reproducibility package
1 parent 9888bcf commit ac88644

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

csep/utils/plots.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2174,7 +2174,7 @@ def _get_axis_limits(points: Union[Sequence, numpy.ndarray],
21742174
return x_min - xd, x_max + xd
21752175

21762176

2177-
def _get_basemap(basemap: str) -> Union[img_tiles.GoogleTiles, DatasetReader]:
2177+
def _get_basemap(basemap: str) -> Union[img_tiles.GoogleTiles, DatasetReader, None]:
21782178
"""
21792179
Returns the basemap tiles for a given basemap type or web service.
21802180
@@ -2251,6 +2251,14 @@ def _save_cache_src(basemap_):
22512251
)
22522252
tiles = img_tiles.GoogleTiles(url=webservice, cache=cache)
22532253
_save_cache_src(basemap)
2254+
elif basemap == 'stamen_terrain-background' or basemap == 'stamen_terrain':
2255+
warnings.warn(
2256+
f"stamen basemaps are no longer supported. Please try one of:"
2257+
f" 'google-satellite`, `ESRI_terrain`, `ESRI_relief`, etc.\n",
2258+
DeprecationWarning,
2259+
stacklevel=2
2260+
)
2261+
return None
22542262

22552263
elif os.path.isfile(basemap):
22562264
return rio_open(basemap)
@@ -2699,4 +2707,5 @@ def _warning_plot_args(func_name: str):
26992707
plot_pvalues_and_intervals,
27002708
plot_concentration_ROC_diagram,
27012709
plot_ROC_diagram,
2702-
plot_Molchan_diagram)
2710+
plot_Molchan_diagram,
2711+
add_labels_for_publication)

csep/utils/plots_legacy.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2023,11 +2023,9 @@ def add_labels_for_publication(figure, style='bssa', labelsize=16):
20232023
This function is deprecated and will be removed in version 1.0.
20242024
20252025
"""
2026-
2026+
import string
20272027
warnings.warn(
2028-
"'plot_spatial_test' is deprecated and will be removed in version 1.0.\n"
2029-
"Use 'plot_test_distribution' instead.\n"
2030-
"Documentation: https://docs.cseptesting.org/reference/generated/csep.utils.plots.plot_test_distribution.html",
2028+
"'add_labels_for_publication' is deprecated and will be removed in version 1.0.\n",
20312029
DeprecationWarning,
20322030
stacklevel=2
20332031
)

0 commit comments

Comments
 (0)