@@ -145,7 +145,17 @@ def plot_magnitude_versus_time(
145145 matplotlib.axes.Axes: The Matplotlib axes object with the plotted data.
146146 """
147147 # Initialize plot
148- plot_args = {** DEFAULT_PLOT_ARGS , ** kwargs }
148+ if "plot_args" in kwargs :
149+ warnings .warn (
150+ "'plot_args' usage is deprecated and will be removed in version 1.0.\n "
151+ "Fine-tuning of plot appearance may not behave as expected'.\n "
152+ "Please use explicit arguments instead (e.g., color='red').\n "
153+ "Refer to the function's documentation for supported keyword arguments:\n "
154+ " https://docs.cseptesting.org/reference/generated/csep.utils.plots.plot_magnitude_versus_time.html" ,
155+ DeprecationWarning ,
156+ stacklevel = 2
157+ )
158+ plot_args = {** DEFAULT_PLOT_ARGS , ** kwargs .get ("plot_args" , {}), ** kwargs }
149159 fig , ax = pyplot .subplots (figsize = plot_args ["figsize" ]) if ax is None else (ax .figure , ax )
150160
151161 # Plot data
@@ -247,7 +257,17 @@ def _plot_cumulative_events_versus_time(
247257 matplotlib.axes.Axes: The Matplotlib axes object with the plotted data.
248258 """
249259 # Initialize plot
250- plot_args = {** DEFAULT_PLOT_ARGS , ** kwargs }
260+ if "plot_args" in kwargs :
261+ warnings .warn (
262+ "'plot_args' usage is deprecated and will be removed in version 1.0.\n "
263+ "Fine-tuning of plot appearance may not behave as expected'.\n "
264+ "Please use explicit arguments instead (e.g., color='red').\n "
265+ "Refer to the function's documentation for supported keyword arguments:\n "
266+ " https://docs.cseptesting.org/reference/generated/csep.utils.plots.plot_cumulative_events_versus_time.html" ,
267+ DeprecationWarning ,
268+ stacklevel = 2
269+ )
270+ plot_args = {** DEFAULT_PLOT_ARGS , ** kwargs .get ("plot_args" , {}), ** kwargs }
251271 fig , ax = pyplot .subplots (figsize = plot_args ["figsize" ]) if ax is None else (ax .figure , ax )
252272
253273 # Get information from stochastic event set
@@ -419,7 +439,17 @@ def plot_magnitude_histogram(
419439 """
420440
421441 # Initialize plot
422- plot_args = {** DEFAULT_PLOT_ARGS , ** kwargs }
442+ if "plot_args" in kwargs :
443+ warnings .warn (
444+ "'plot_args' usage is deprecated and will be removed in version 1.0.\n "
445+ "Fine-tuning of plot appearance may not behave as expected'.\n "
446+ "Please use explicit arguments instead (e.g., color='red').\n "
447+ "Refer to the function's documentation for supported keyword arguments:\n "
448+ " https://docs.cseptesting.org/reference/generated/csep.utils.plots.plot_magnitude_histogram.html" ,
449+ DeprecationWarning ,
450+ stacklevel = 2
451+ )
452+ plot_args = {** DEFAULT_PLOT_ARGS , ** kwargs .get ("plot_args" , {}), ** kwargs }
423453 fig , ax = pyplot .subplots (figsize = plot_args ["figsize" ]) if ax is None else (ax .figure , ax )
424454
425455 # Get magnitudes from observations and (lazily) from forecast
@@ -691,7 +721,17 @@ def plot_catalog(
691721 matplotlib.axes.Axes: The Matplotlib axes object with the plotted data.
692722 """
693723
694- plot_args = {** DEFAULT_PLOT_ARGS , ** kwargs }
724+ if "plot_args" in kwargs :
725+ warnings .warn (
726+ "'plot_args' usage is deprecated and will be removed in version 1.0.\n "
727+ "Fine-tuning of plot appearance may not behave as expected'.\n "
728+ "Please use explicit arguments instead (e.g., color='red').\n "
729+ "Refer to the function's documentation for supported keyword arguments:\n "
730+ " https://docs.cseptesting.org/reference/generated/csep.utils.plots.plot_catalog.html" ,
731+ DeprecationWarning ,
732+ stacklevel = 2
733+ )
734+ plot_args = {** DEFAULT_PLOT_ARGS , ** kwargs .get ("plot_args" , {}), ** kwargs }
695735 # Get spatial information for plotting
696736 extent = extent or _calculate_spatial_extent (catalog , set_global , plot_region )
697737 # Instantiate GeoAxes object
@@ -844,8 +884,17 @@ def plot_gridded_dataset(
844884 matplotlib.axes.Axes: Matplotlib axes object.
845885 """
846886
847- plot_args = {** DEFAULT_PLOT_ARGS , ** kwargs }
848-
887+ if "plot_args" in kwargs :
888+ warnings .warn (
889+ "'plot_args' usage is deprecated and will be removed in version 1.0.\n "
890+ "Fine-tuning of plot appearance may not behave as expected'.\n "
891+ "Please use explicit arguments instead (e.g., color='red').\n "
892+ "Refer to the function's documentation for supported keyword arguments:\n "
893+ " https://docs.cseptesting.org/reference/generated/csep.utils.plots.plot_gridded_dataset.html" ,
894+ DeprecationWarning ,
895+ stacklevel = 2
896+ )
897+ plot_args = {** DEFAULT_PLOT_ARGS , ** kwargs .get ("plot_args" , {}), ** kwargs }
849898 # Get spatial information for plotting
850899 extent = extent or _calculate_spatial_extent (region , set_global , plot_region )
851900 # Instantiate GeoAxes object
@@ -955,8 +1004,18 @@ def plot_test_distribution(
9551004 matplotlib.axes.Axes: Matplotlib axes handle.
9561005 """
9571006
958- # Initialize plot
959- plot_args = {** DEFAULT_PLOT_ARGS , ** kwargs }
1007+ # Initialize plot]
1008+ if "plot_args" in kwargs :
1009+ warnings .warn (
1010+ "'plot_args' usage is deprecated and will be removed in version 1.0.\n "
1011+ "Fine-tuning of plot appearance may not behave as expected'.\n "
1012+ "Please use explicit arguments instead (e.g., color='red').\n "
1013+ "Refer to the function's documentation for supported keyword arguments:\n "
1014+ " https://docs.cseptesting.org/reference/generated/csep.utils.plots.plot_test_distribution.html" ,
1015+ DeprecationWarning ,
1016+ stacklevel = 2
1017+ )
1018+ plot_args = {** DEFAULT_PLOT_ARGS , ** kwargs .get ("plot_args" , {}), ** kwargs }
9601019 fig , ax = pyplot .subplots (figsize = plot_args ["figsize" ]) if ax is None else (ax .figure , ax )
9611020
9621021 # Get distributions
@@ -1075,7 +1134,17 @@ def plot_calibration_test(
10751134 matplotlib.axes.Axes: The Matplotlib axes object containing the plot.
10761135 """
10771136 # Initialize plot
1078- plot_args = {** DEFAULT_PLOT_ARGS , ** kwargs }
1137+ if "plot_args" in kwargs :
1138+ warnings .warn (
1139+ "'plot_args' usage is deprecated and will be removed in version 1.0.\n "
1140+ "Fine-tuning of plot appearance may not behave as expected'.\n "
1141+ "Please use explicit arguments instead (e.g., color='red').\n "
1142+ "Refer to the function's documentation for supported keyword arguments:\n "
1143+ " https://docs.cseptesting.org/reference/generated/csep.utils.plots.plot_calibration_test.html" ,
1144+ DeprecationWarning ,
1145+ stacklevel = 2
1146+ )
1147+ plot_args = {** DEFAULT_PLOT_ARGS , ** kwargs .get ("plot_args" , {}), ** kwargs }
10791148 fig , ax = pyplot .subplots (figsize = plot_args ["figsize" ]) if ax is None else (ax .figure , ax )
10801149
10811150 # Set up QQ plots and KS test
@@ -1179,7 +1248,17 @@ def _plot_comparison_test(
11791248 """
11801249
11811250 # Initialize plot
1182- plot_args = {** DEFAULT_PLOT_ARGS , ** kwargs }
1251+ if "plot_args" in kwargs :
1252+ warnings .warn (
1253+ "'plot_args' usage is deprecated and will be removed in version 1.0.\n "
1254+ "Fine-tuning of plot appearance may not behave as expected'.\n "
1255+ "Please use explicit arguments instead (e.g., color='red').\n "
1256+ "Refer to the function's documentation for supported keyword arguments:\n "
1257+ " https://docs.cseptesting.org/reference/generated/csep.utils.plots.plot_comparison_test.html" ,
1258+ DeprecationWarning ,
1259+ stacklevel = 2
1260+ )
1261+ plot_args = {** DEFAULT_PLOT_ARGS , ** kwargs .get ("plot_args" , {}), ** kwargs }
11831262 fig , ax = pyplot .subplots (figsize = plot_args ["figsize" ]) if ax is None else (ax .figure , ax )
11841263
11851264 # Iterate through T-test results, or jointly through t- and w- test results
@@ -1347,7 +1426,17 @@ def _plot_consistency_test(
13471426 """
13481427
13491428 # Initialize plot
1350- plot_args = {** DEFAULT_PLOT_ARGS , ** kwargs }
1429+ if "plot_args" in kwargs :
1430+ warnings .warn (
1431+ "'plot_args' usage is deprecated and will be removed in version 1.0.\n "
1432+ "Fine-tuning of plot appearance may not behave as expected'.\n "
1433+ "Please use explicit arguments instead (e.g., color='red').\n "
1434+ "Refer to the function's documentation for supported keyword arguments:\n "
1435+ " https://docs.cseptesting.org/reference/generated/csep.utils.plots.plot_consistency_test.html" ,
1436+ DeprecationWarning ,
1437+ stacklevel = 2
1438+ )
1439+ plot_args = {** DEFAULT_PLOT_ARGS , ** kwargs .get ("plot_args" , {}), ** kwargs }
13511440 fig , ax = pyplot .subplots (figsize = plot_args ["figsize" ]) if ax is None else (ax .figure , ax )
13521441
13531442 # Ensure eval_results is a list
@@ -1478,7 +1567,17 @@ def _plot_concentration_ROC_diagram(
14781567 """
14791568
14801569 # Initialize plot
1481- plot_args = {** DEFAULT_PLOT_ARGS , ** kwargs }
1570+ if "plot_args" in kwargs :
1571+ warnings .warn (
1572+ "'plot_args' usage is deprecated and will be removed in version 1.0.\n "
1573+ "Fine-tuning of plot appearance may not behave as expected'.\n "
1574+ "Please use explicit arguments instead (e.g., color='red').\n "
1575+ "Refer to the function's documentation for supported keyword arguments:\n "
1576+ " https://docs.cseptesting.org/reference/generated/csep.utils.plots.plot_concentration_ROC_diagram.html" ,
1577+ DeprecationWarning ,
1578+ stacklevel = 2
1579+ )
1580+ plot_args = {** DEFAULT_PLOT_ARGS , ** kwargs .get ("plot_args" , {}), ** kwargs }
14821581 fig , ax = pyplot .subplots (figsize = plot_args ["figsize" ]) if ax is None else (ax .figure , ax )
14831582
14841583 if not catalog .region == forecast .region :
@@ -1591,7 +1690,17 @@ def _plot_ROC_diagram(
15911690 """
15921691
15931692 # Initialize plot
1594- plot_args = {** DEFAULT_PLOT_ARGS , ** kwargs }
1693+ if "plot_args" in kwargs :
1694+ warnings .warn (
1695+ "'plot_args' usage is deprecated and will be removed in version 1.0.\n "
1696+ "Fine-tuning of plot appearance may not behave as expected'.\n "
1697+ "Please use explicit arguments instead (e.g., color='red').\n "
1698+ "Refer to the function's documentation for supported keyword arguments:\n "
1699+ " https://docs.cseptesting.org/reference/generated/csep.utils.plots.plot_ROC_diagram.html" ,
1700+ DeprecationWarning ,
1701+ stacklevel = 2
1702+ )
1703+ plot_args = {** DEFAULT_PLOT_ARGS , ** kwargs .get ("plot_args" , {}), ** kwargs }
15951704 fig , ax = pyplot .subplots (figsize = plot_args ["figsize" ]) if ax is None else (ax .figure , ax )
15961705
15971706 if not catalog .region == forecast .region :
@@ -1738,7 +1847,17 @@ def _plot_Molchan_diagram(
17381847 RuntimeError: If the catalog and forecast do not have the same region.
17391848 """
17401849
1741- plot_args = {** DEFAULT_PLOT_ARGS , ** kwargs }
1850+ if "plot_args" in kwargs :
1851+ warnings .warn (
1852+ "'plot_args' usage is deprecated and will be removed in version 1.0.\n "
1853+ "Fine-tuning of plot appearance may not behave as expected'.\n "
1854+ "Please use explicit arguments instead (e.g., color='red').\n "
1855+ "Refer to the function's documentation for supported keyword arguments:\n "
1856+ " https://docs.cseptesting.org/reference/generated/csep.utils.plots.plot_Molchan_diagram.html" ,
1857+ DeprecationWarning ,
1858+ stacklevel = 2
1859+ )
1860+ plot_args = {** DEFAULT_PLOT_ARGS , ** kwargs .get ("plot_args" , {}), ** kwargs }
17421861 fig , ax = pyplot .subplots (figsize = plot_args ["figsize" ]) if ax is None else (ax .figure , ax )
17431862
17441863 if not catalog .region == forecast .region :
0 commit comments