Skip to content

Commit

Permalink
Merge pull request #126 from jaidevd/jd-maint
Browse files Browse the repository at this point in the history
Routine maintenance
  • Loading branch information
jaidevd committed Mar 10, 2016
2 parents 5b2d05e + 60bf216 commit f18a2bb
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 16 deletions.
4 changes: 3 additions & 1 deletion .landscape.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ pylint:
- star-args
- logging-format-interpolation
- bad-builtin
- too-many-arguments
- expression-not-assigned
ignore-paths:
- docs
- doc
pep8:
disable:
- E731
Expand Down
12 changes: 6 additions & 6 deletions tftb/generators/__init__.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
from amplitude_modulated import amexpos, amgauss, amrect, amtriang
from frequency_modulated import (fmconst, fmhyp, fmlin, fmodany, fmpar,
from .amplitude_modulated import amexpos, amgauss, amrect, amtriang
from .frequency_modulated import (fmconst, fmhyp, fmlin, fmodany, fmpar,
fmpower, fmsin)
from utils import sigmerge, scale
from noise import dopnoise, noisecg, noisecu
from analytic_signals import (anaask, anabpsk, anafsk, anapulse, anaqpsk,
from .utils import sigmerge, scale
from .noise import dopnoise, noisecg, noisecu
from .analytic_signals import (anaask, anabpsk, anafsk, anapulse, anaqpsk,
anasing, anastep)
from misc import doppler, gdpower, klauder, mexhat, altes, atoms
from .misc import doppler, gdpower, klauder, mexhat, altes, atoms

__all__ = ['amexpos', 'amgauss', 'amrect', 'amtriang', 'fmconst', 'fmhyp',
'fmlin', 'fmodany', 'fmpar', 'fmpower', 'fmsin', 'sigmerge',
Expand Down
4 changes: 2 additions & 2 deletions tftb/generators/analytic_signals.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def anaask(n_points, n_comp=None, f0=0.25):
m = int(np.ceil(n_points / n_comp))
jumps = np.random.rand(m)
am = np.kron(jumps, np.ones((n_comp,)))[:n_points]
fm, iflaw = fmconst(n_points, f0, 1)
fm, _ = fmconst(n_points, f0, 1)
y = am * fm
return y, am

Expand Down Expand Up @@ -149,6 +149,7 @@ def anaqpsk(n_points, n_comp=None, f0=0.25):

def anasing(n_points, t0=None, h=0.0):
"""Lipschitz singularity.
Refer to the wiki page on `Lipschitz condition`, good test case.
:param n_points: number of points in time.
:param t0: time localization of singularity
Expand All @@ -164,7 +165,6 @@ def anasing(n_points, t0=None, h=0.0):
.. plot:: docstring_plots/generators/analytic_signals/anasing.py
"""
"""Refer to the wiki page on `Lipschitz condition`, good test case."""
if t0 is None:
t0 = n_points / 2.0
if h <= 0:
Expand Down
2 changes: 1 addition & 1 deletion tftb/generators/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ def gdpower(n_points, degree=0.0, rate=1.0):
tfx[:lnu] = np.exp(-1j * 2 * np.pi * (t0 * nu + d * np.log(nu))) * am
x = np.fft.ifft(tfx)
elif degree == 1.:
from analytic_signals import anapulse
from tftb.generators.analytic_signals import anapulse
t0 = n_points
x = anapulse(n_points, t0)
elif degree > 1.:
Expand Down
2 changes: 1 addition & 1 deletion tftb/generators/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,4 @@ def scale(X, a, fmin, fmax, N):

if __name__ == '__main__':
from tftb.generators import altes
S = altes(256, 0.1, 0.45, 10000)
sig = altes(256, 0.1, 0.45, 10000)
2 changes: 1 addition & 1 deletion tftb/processing/affine.py
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@ def umaxdfla_solve(ratio):
from tftb.generators import altes
import matplotlib.pyplot as plt
sig = altes(64, 0.1, 0.45)
tfr, t, f = smoothed_pseudo_wigner(sig)
tfr, timestamps, frequencies = smoothed_pseudo_wigner(sig)
tfr = np.abs(tfr) ** 2
threshold = np.amax(tfr) * 0.05
tfr[tfr <= threshold] = 0.0
Expand Down
1 change: 0 additions & 1 deletion tftb/processing/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@ def _plot_spectrum(self, ax, freq_x, freq_y):
ax.set_ylim(0, freq_y.shape[0] - 1)
else:
ax.set_ylim(freq_y[0], freq_y[-1])
pass

def _annotate_spectrum(self, ax):
ax.set_ylabel('Spectrum')
Expand Down
4 changes: 1 addition & 3 deletions tftb/processing/postprocessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def ideal_tfr(iflaws, timestamps=None, n_fbins=None):
:return:
:rtype:
"""
ifrow, ifcol = iflaws.shape
ifrow = iflaws.shape[0]
if timestamps is None:
timestamps = np.arange(iflaws[0, :].shape[0])
if n_fbins is None:
Expand Down Expand Up @@ -145,7 +145,6 @@ def friedman_density(tfr, re_mat, timestamps=None):
:rtype:
"""
tfrrow, tfrcol = tfr.shape
hatrow, hatcol = re_mat.shape
if timestamps is None:
timestamps = np.arange(tfrcol)

Expand Down Expand Up @@ -179,7 +178,6 @@ def ridges(tfr, re_mat, timestamps=None, method='rsp'):
"""
method = method.lower()
tfrrow, tfrcol = tfr.shape
hatrow, hatcol = re_mat.shape
if timestamps is None:
timestamps = np.arange(tfrcol)

Expand Down

0 comments on commit f18a2bb

Please sign in to comment.