Skip to content

Commit

Permalink
deprecation warning added to plotting.
Browse files Browse the repository at this point in the history
  • Loading branch information
millen1m committed Apr 5, 2018
1 parent f04fe01 commit 30a26bf
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion eqsig/__about__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.5.12"
__version__ = "0.5.13"
13 changes: 12 additions & 1 deletion eqsig/plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,16 @@
# from bwplot import spectra as cbox
from bwplot import cbox

import warnings


def deprecation(message):
warnings.warn(message, stacklevel=3)


def plot_response_spectrum(rec, **kwargs):
deprecation('Deprecated, switch to: plotting functions moved to engformat package')

rec.generate_response_spectrum()
plot_on = 1
legend_off = kwargs.get('legend_off', False)
Expand Down Expand Up @@ -81,6 +89,7 @@ def plot_response_spectrum(rec, **kwargs):


def plot_time_series(rec, **kwargs):
deprecation('Deprecated, switch to: plotting functions moved to engformat package')
plot_on = kwargs.get('plot_on', False)
legend_off = kwargs.get('legend_off', False)
info_str = kwargs.get('info_str', '')
Expand Down Expand Up @@ -155,6 +164,7 @@ def plot_avd(rec, sub_plots=None, ccbox=0, **kwargs):
Plot acceleration, velocity and displacement
:return:
"""
deprecation('Deprecated, switch to: plotting functions moved to engformat package')
label = kwargs.get('label', rec.label)
legend_off = kwargs.get('legend_off', False)
if sub_plots is None:
Expand All @@ -172,6 +182,7 @@ def plot_avd(rec, sub_plots=None, ccbox=0, **kwargs):


def plot_fa_spectrum(rec, **kwargs):
deprecation('Deprecated, switch to: plotting functions moved to engformat package')
plot_on = kwargs.get('plot_on', False)
legend_off = kwargs.get('legend_off', False)
smooth = kwargs.get('smooth', False)
Expand Down Expand Up @@ -233,6 +244,7 @@ def plot_transfer_function(base_rec, recs, **kwargs):
:param kwargs:
:return:
"""
deprecation('Deprecated, switch to: plotting functions moved to engformat package')
plot_on = kwargs.get('plot_on', False)
legend_off = kwargs.get('legend_off', False)
smooth = kwargs.get('smooth', False)
Expand All @@ -256,7 +268,6 @@ def plot_transfer_function(base_rec, recs, **kwargs):
base_spectrum = abs(base_rec.smooth_fa_spectrum)
base_frequencies = base_rec.smooth_fa_frequencies


if sub_plot == 0:
sub_plot = plt.figure().add_subplot(111)
else:
Expand Down

0 comments on commit 30a26bf

Please sign in to comment.