|
24 | 24 | RBFInterpolator, |
25 | 25 | ) |
26 | 26 |
|
27 | | -from rocketpy.tools import from_hex_decode, to_hex_encode |
| 27 | +from rocketpy.tools import deprecated, from_hex_decode, to_hex_encode |
28 | 28 |
|
29 | 29 | from ..plots.plot_helpers import show_or_save_plot |
30 | 30 |
|
@@ -1459,14 +1459,13 @@ def plot(self, *args, **kwargs): |
1459 | 1459 | else: |
1460 | 1460 | print("Error: Only functions with 1D or 2D domains can be plotted.") |
1461 | 1461 |
|
| 1462 | + @deprecated( |
| 1463 | + reason="The `Function.plot1D` method is set to be deprecated and fully " |
| 1464 | + "removed in rocketpy v2.0.0", |
| 1465 | + alternative="Function.plot_1d", |
| 1466 | + ) |
1462 | 1467 | def plot1D(self, *args, **kwargs): # pragma: no cover |
1463 | 1468 | """Deprecated method, use Function.plot_1d instead.""" |
1464 | | - warnings.warn( |
1465 | | - "The `Function.plot1D` method is set to be deprecated and fully " |
1466 | | - + "removed in rocketpy v2.0.0, use `Function.plot_1d` instead. " |
1467 | | - + "This method is calling `Function.plot_1d`.", |
1468 | | - DeprecationWarning, |
1469 | | - ) |
1470 | 1469 | return self.plot_1d(*args, **kwargs) |
1471 | 1470 |
|
1472 | 1471 | def plot_1d( # pylint: disable=too-many-statements |
@@ -1559,14 +1558,13 @@ def plot_1d( # pylint: disable=too-many-statements |
1559 | 1558 | if return_object: |
1560 | 1559 | return fig, ax |
1561 | 1560 |
|
| 1561 | + @deprecated( |
| 1562 | + reason="The `Function.plot2D` method is set to be deprecated and fully " |
| 1563 | + "removed in rocketpy v2.0.0", |
| 1564 | + alternative="Function.plot_2d", |
| 1565 | + ) |
1562 | 1566 | def plot2D(self, *args, **kwargs): # pragma: no cover |
1563 | 1567 | """Deprecated method, use Function.plot_2d instead.""" |
1564 | | - warnings.warn( |
1565 | | - "The `Function.plot2D` method is set to be deprecated and fully " |
1566 | | - + "removed in rocketpy v2.0.0, use `Function.plot_2d` instead. " |
1567 | | - + "This method is calling `Function.plot_2d`.", |
1568 | | - DeprecationWarning, |
1569 | | - ) |
1570 | 1568 | return self.plot_2d(*args, **kwargs) |
1571 | 1569 |
|
1572 | 1570 | def plot_2d( # pylint: disable=too-many-statements |
|
0 commit comments