diff options
66 files changed, 855 insertions, 642 deletions
diff --git a/gnuradio-core/src/python/gnuradio/blks2impl/am_demod.py b/gnuradio-core/src/python/gnuradio/blks2impl/am_demod.py index 68d024565a..6420348be3 100644 --- a/gnuradio-core/src/python/gnuradio/blks2impl/am_demod.py +++ b/gnuradio-core/src/python/gnuradio/blks2impl/am_demod.py @@ -30,14 +30,11 @@ class am_demod_cf(gr.hier_block2): filtering to the audio output. It produces a float stream in the range [-1.0, +1.0]. - @param channel_rate: incoming sample rate of the AM baseband - @type sample_rate: integer - @param audio_decim: input to output decimation rate - @type audio_decim: integer - @param audio_pass: audio low pass filter passband frequency - @type audio_pass: float - @param audio_stop: audio low pass filter stop frequency - @type audio_stop: float + Args: + channel_rate: incoming sample rate of the AM baseband (integer) + audio_decim: input to output decimation rate (integer) + audio_pass: audio low pass filter passband frequency (float) + audio_stop: audio low pass filter stop frequency (float) """ def __init__(self, channel_rate, audio_decim, audio_pass, audio_stop): gr.hier_block2.__init__(self, "am_demod_cf", @@ -64,10 +61,9 @@ class demod_10k0a3e_cf(am_demod_cf): This block demodulates an AM channel conformant to 10K0A3E emission standards, such as broadcast band AM transmissions. - @param channel_rate: incoming sample rate of the AM baseband - @type sample_rate: integer - @param audio_decim: input to output decimation rate - @type audio_decim: integer + Args: + channel_rate: incoming sample rate of the AM baseband (integer) + audio_decim: input to output decimation rate (integer) """ def __init__(self, channel_rate, audio_decim): am_demod_cf.__init__(self, channel_rate, audio_decim, diff --git a/gnuradio-core/src/python/gnuradio/blks2impl/filterbank.py b/gnuradio-core/src/python/gnuradio/blks2impl/filterbank.py index 08f1d450ba..29e50bc2a3 100644 --- a/gnuradio-core/src/python/gnuradio/blks2impl/filterbank.py +++ b/gnuradio-core/src/python/gnuradio/blks2impl/filterbank.py @@ -45,8 +45,9 @@ class synthesis_filterbank(gr.hier_block2): Takes M complex streams in, produces single complex stream out that runs at M times the input sample rate - @param mpoints: number of freq bins/interpolation factor/subbands - @param taps: filter taps for subband filter + Args: + mpoints: number of freq bins/interpolation factor/subbands + taps: filter taps for subband filter The channel spacing is equal to the input sample rate. The total bandwidth and output sample rate are equal the input @@ -128,8 +129,9 @@ class analysis_filterbank(gr.hier_block2): Takes 1 complex stream in, produces M complex streams out that runs at 1/M times the input sample rate - @param mpoints: number of freq bins/interpolation factor/subbands - @param taps: filter taps for subband filter + Args: + mpoints: number of freq bins/interpolation factor/subbands + taps: filter taps for subband filter Same channel to frequency mapping as described above. """ diff --git a/gnuradio-core/src/python/gnuradio/blks2impl/fm_demod.py b/gnuradio-core/src/python/gnuradio/blks2impl/fm_demod.py index 6bc0d7ed0d..cc93d5b45c 100644 --- a/gnuradio-core/src/python/gnuradio/blks2impl/fm_demod.py +++ b/gnuradio-core/src/python/gnuradio/blks2impl/fm_demod.py @@ -33,20 +33,14 @@ class fm_demod_cf(gr.hier_block2): deemphasis. Low pass filtering is done on the resultant signal. It produces an output float strem in the range of [-1.0, +1.0]. - @param channel_rate: incoming sample rate of the FM baseband - @type sample_rate: integer - @param deviation: maximum FM deviation (default = 5000) - @type deviation: float - @param audio_decim: input to output decimation rate - @type audio_decim: integer - @param audio_pass: audio low pass filter passband frequency - @type audio_pass: float - @param audio_stop: audio low pass filter stop frequency - @type audio_stop: float - @param gain: gain applied to audio output (default = 1.0) - @type gain: float - @param tau: deemphasis time constant (default = 75e-6), specify 'None' - to prevent deemphasis + Args: + channel_rate: incoming sample rate of the FM baseband (integer) + deviation: maximum FM deviation (default = 5000) (float) + audio_decim: input to output decimation rate (integer) + audio_pass: audio low pass filter passband frequency (float) + audio_stop: audio low pass filter stop frequency (float) + gain: gain applied to audio output (default = 1.0) (float) + tau: deemphasis time constant (default = 75e-6), specify 'None' to prevent deemphasis """ def __init__(self, channel_rate, audio_decim, deviation, audio_pass, audio_stop, gain=1.0, tau=75e-6): @@ -79,10 +73,9 @@ class demod_20k0f3e_cf(fm_demod_cf): channel conforming to 20K0F3E emission standards, outputting floats in the range [-1.0, +1.0]. - @param sample_rate: incoming sample rate of the FM baseband - @type sample_rate: integer - @param audio_decim: input to output decimation rate - @type audio_decim: integer + Args: + sample_rate: incoming sample rate of the FM baseband (integer) + audio_decim: input to output decimation rate (integer) """ def __init__(self, channel_rate, audio_decim): fm_demod_cf.__init__(self, channel_rate, audio_decim, @@ -98,10 +91,9 @@ class demod_200kf3e_cf(fm_demod_cf): channel conforming to 200KF3E emission standards, outputting floats in the range [-1.0, +1.0]. - @param sample_rate: incoming sample rate of the FM baseband - @type sample_rate: integer - @param audio_decim: input to output decimation rate - @type audio_decim: integer + Args: + sample_rate: incoming sample rate of the FM baseband (integer) + audio_decim: input to output decimation rate (integer) """ def __init__(self, channel_rate, audio_decim): fm_demod_cf.__init__(self, channel_rate, audio_decim, diff --git a/gnuradio-core/src/python/gnuradio/blks2impl/fm_emph.py b/gnuradio-core/src/python/gnuradio/blks2impl/fm_emph.py index fc3f2d60d2..29e052f6f5 100644 --- a/gnuradio-core/src/python/gnuradio/blks2impl/fm_emph.py +++ b/gnuradio-core/src/python/gnuradio/blks2impl/fm_emph.py @@ -43,10 +43,10 @@ class fm_deemph(gr.hier_block2): def __init__(self, fs, tau=75e-6): """ - @param fs: sampling frequency in Hz - @type fs: float - @param tau: Time constant in seconds (75us in US, 50us in EUR) - @type tau: float + + Args: + fs: sampling frequency in Hz (float) + tau: Time constant in seconds (75us in US, 50us in EUR) (float) """ gr.hier_block2.__init__(self, "fm_deemph", gr.io_signature(1, 1, gr.sizeof_float), # Input signature @@ -126,10 +126,10 @@ class fm_preemph(gr.hier_block2): """ def __init__(self, fs, tau=75e-6): """ - @param fs: sampling frequency in Hz - @type fs: float - @param tau: Time constant in seconds (75us in US, 50us in EUR) - @type tau: float + + Args: + fs: sampling frequency in Hz (float) + tau: Time constant in seconds (75us in US, 50us in EUR) (float) """ gr.hier_block2.__init__(self, "fm_deemph", diff --git a/gnuradio-core/src/python/gnuradio/blks2impl/logpwrfft.py b/gnuradio-core/src/python/gnuradio/blks2impl/logpwrfft.py index 6f7fc520fa..35a0ad7978 100644 --- a/gnuradio-core/src/python/gnuradio/blks2impl/logpwrfft.py +++ b/gnuradio-core/src/python/gnuradio/blks2impl/logpwrfft.py @@ -32,13 +32,15 @@ class _logpwrfft_base(gr.hier_block2): """ Create an log10(abs(fft)) stream chain. Provide access to the setting the filter and sample rate. - @param sample_rate Incoming stream sample rate - @param fft_size Number of FFT bins - @param ref_scale Sets 0 dB value input amplitude - @param frame_rate Output frame rate - @param avg_alpha FFT averaging (over time) constant [0.0-1.0] - @param average Whether to average [True, False] - @param win the window taps generation function + + Args: + sample_rate: Incoming stream sample rate + fft_size: Number of FFT bins + ref_scale: Sets 0 dB value input amplitude + frame_rate: Output frame rate + avg_alpha: FFT averaging (over time) constant [0.0-1.0] + average: Whether to average [True, False] + win: the window taps generation function """ gr.hier_block2.__init__(self, self._name, gr.io_signature(1, 1, self._item_size), # Input signature @@ -70,28 +72,36 @@ class _logpwrfft_base(gr.hier_block2): def set_decimation(self, decim): """ Set the decimation on stream decimator. - @param decim the new decimation + + Args: + decim: the new decimation """ self._sd.set_decimation(decim) def set_vec_rate(self, vec_rate): """ Set the vector rate on stream decimator. - @param vec_rate the new vector rate + + Args: + vec_rate: the new vector rate """ self._sd.set_vec_rate(vec_rate) def set_sample_rate(self, sample_rate): """ Set the new sampling rate - @param sample_rate the new rate + + Args: + sample_rate: the new rate """ self._sd.set_sample_rate(sample_rate) def set_average(self, average): """ Set the averaging filter on/off. - @param average true to set averaging on + + Args: + average: true to set averaging on """ self._average = average if self._average: @@ -102,7 +112,9 @@ class _logpwrfft_base(gr.hier_block2): def set_avg_alpha(self, avg_alpha): """ Set the average alpha and set the taps if average was on. - @param avg_alpha the new iir filter tap + + Args: + avg_alpha: the new iir filter tap """ self._avg_alpha = avg_alpha self.set_average(self._average) diff --git a/gnuradio-core/src/python/gnuradio/blks2impl/nbfm_rx.py b/gnuradio-core/src/python/gnuradio/blks2impl/nbfm_rx.py index 8bcb47ae19..40eb255e1e 100644 --- a/gnuradio-core/src/python/gnuradio/blks2impl/nbfm_rx.py +++ b/gnuradio-core/src/python/gnuradio/blks2impl/nbfm_rx.py @@ -32,14 +32,11 @@ class nbfm_rx(gr.hier_block2): Takes a single complex baseband input stream and produces a single float output stream of audio sample in the range [-1, +1]. - @param audio_rate: sample rate of audio stream, >= 16k - @type audio_rate: integer - @param quad_rate: sample rate of output stream - @type quad_rate: integer - @param tau: preemphasis time constant (default 75e-6) - @type tau: float - @param max_dev: maximum deviation in Hz (default 5e3) - @type max_dev: float + Args: + audio_rate: sample rate of audio stream, >= 16k (integer) + quad_rate: sample rate of output stream (integer) + tau: preemphasis time constant (default 75e-6) (float) + max_dev: maximum deviation in Hz (default 5e3) (float) quad_rate must be an integer multiple of audio_rate. diff --git a/gnuradio-core/src/python/gnuradio/blks2impl/nbfm_tx.py b/gnuradio-core/src/python/gnuradio/blks2impl/nbfm_tx.py index 839cf6784a..a2c4310467 100644 --- a/gnuradio-core/src/python/gnuradio/blks2impl/nbfm_tx.py +++ b/gnuradio-core/src/python/gnuradio/blks2impl/nbfm_tx.py @@ -33,14 +33,11 @@ class nbfm_tx(gr.hier_block2): Takes a single float input stream of audio samples in the range [-1,+1] and produces a single FM modulated complex baseband output. - @param audio_rate: sample rate of audio stream, >= 16k - @type audio_rate: integer - @param quad_rate: sample rate of output stream - @type quad_rate: integer - @param tau: preemphasis time constant (default 75e-6) - @type tau: float - @param max_dev: maximum deviation in Hz (default 5e3) - @type max_dev: float + Args: + audio_rate: sample rate of audio stream, >= 16k (integer) + quad_rate: sample rate of output stream (integer) + tau: preemphasis time constant (default 75e-6) (float) + max_dev: maximum deviation in Hz (default 5e3) (float) quad_rate must be an integer multiple of audio_rate. """ diff --git a/gnuradio-core/src/python/gnuradio/blks2impl/rational_resampler.py b/gnuradio-core/src/python/gnuradio/blks2impl/rational_resampler.py index eea12af958..02c8421d9e 100644 --- a/gnuradio-core/src/python/gnuradio/blks2impl/rational_resampler.py +++ b/gnuradio-core/src/python/gnuradio/blks2impl/rational_resampler.py @@ -28,13 +28,12 @@ def design_filter(interpolation, decimation, fractional_bw): Given the interpolation rate, decimation rate and a fractional bandwidth, design a set of taps. - @param interpolation: interpolation factor - @type interpolation: integer > 0 - @param decimation: decimation factor - @type decimation: integer > 0 - @param fractional_bw: fractional bandwidth in (0, 0.5) 0.4 works well. - @type fractional_bw: float - @returns: sequence of numbers + Args: + interpolation: interpolation factor (integer > 0) + decimation: decimation factor (integer > 0) + fractional_bw: fractional bandwidth in (0, 0.5) 0.4 works well. (float) + Returns: + : sequence of numbers """ if fractional_bw >= 0.5 or fractional_bw <= 0: @@ -69,14 +68,11 @@ class _rational_resampler_base(gr.hier_block2): If neither is specified, a reasonable default, 0.4, is used as the fractional_bw. - @param interpolation: interpolation factor - @type interpolation: integer > 0 - @param decimation: decimation factor - @type decimation: integer > 0 - @param taps: optional filter coefficients - @type taps: sequence - @param fractional_bw: fractional bandwidth in (0, 0.5), measured at final freq (use 0.4) - @type fractional_bw: float + Args: + interpolation: interpolation factor (integer > 0) + decimation: decimation factor (integer > 0) + taps: optional filter coefficients (sequence) + fractional_bw: fractional bandwidth in (0, 0.5), measured at final freq (use 0.4) (float) """ if not isinstance(interpolation, int) or interpolation < 1: diff --git a/gnuradio-core/src/python/gnuradio/blks2impl/stream_to_vector_decimator.py b/gnuradio-core/src/python/gnuradio/blks2impl/stream_to_vector_decimator.py index 8f75729c91..d6808b722f 100644 --- a/gnuradio-core/src/python/gnuradio/blks2impl/stream_to_vector_decimator.py +++ b/gnuradio-core/src/python/gnuradio/blks2impl/stream_to_vector_decimator.py @@ -29,10 +29,12 @@ class stream_to_vector_decimator(gr.hier_block2): def __init__(self, item_size, sample_rate, vec_rate, vec_len): """ Create the block chain. - @param item_size the number of bytes per sample - @param sample_rate the rate of incoming samples - @param vec_rate the rate of outgoing vectors (same units as sample_rate) - @param vec_len the length of the outgoing vectors in items + + Args: + item_size: the number of bytes per sample + sample_rate: the rate of incoming samples + vec_rate: the rate of outgoing vectors (same units as sample_rate) + vec_len: the length of the outgoing vectors in items """ self._vec_rate = vec_rate self._vec_len = vec_len @@ -50,7 +52,9 @@ class stream_to_vector_decimator(gr.hier_block2): def set_sample_rate(self, sample_rate): """ Set the new sampling rate and update the decimator. - @param sample_rate the new rate + + Args: + sample_rate: the new rate """ self._sample_rate = sample_rate self._update_decimator() @@ -58,7 +62,9 @@ class stream_to_vector_decimator(gr.hier_block2): def set_vec_rate(self, vec_rate): """ Set the new vector rate and update the decimator. - @param vec_rate the new rate + + Args: + vec_rate: the new rate """ self._vec_rate = vec_rate self._update_decimator() @@ -66,7 +72,9 @@ class stream_to_vector_decimator(gr.hier_block2): def set_decimation(self, decim): """ Set the decimation parameter directly. - @param decim the new decimation + + Args: + decim: the new decimation """ self._decim = max(1, int(round(decim))) self.one_in_n.set_n(self._decim) diff --git a/gnuradio-core/src/python/gnuradio/blks2impl/wfm_rcv.py b/gnuradio-core/src/python/gnuradio/blks2impl/wfm_rcv.py index d1cbcf9127..fe4fdd1a6a 100644 --- a/gnuradio-core/src/python/gnuradio/blks2impl/wfm_rcv.py +++ b/gnuradio-core/src/python/gnuradio/blks2impl/wfm_rcv.py @@ -31,10 +31,9 @@ class wfm_rcv(gr.hier_block2): The input is the downconverted complex baseband signal (gr_complex). The output is the demodulated audio (float). - @param quad_rate: input sample rate of complex baseband input. - @type quad_rate: float - @param audio_decimation: how much to decimate quad_rate to get to audio. - @type audio_decimation: integer + Args: + quad_rate: input sample rate of complex baseband input. (float) + audio_decimation: how much to decimate quad_rate to get to audio. (integer) """ gr.hier_block2.__init__(self, "wfm_rcv", gr.io_signature(1, 1, gr.sizeof_gr_complex), # Input signature diff --git a/gnuradio-core/src/python/gnuradio/blks2impl/wfm_rcv_fmdet.py b/gnuradio-core/src/python/gnuradio/blks2impl/wfm_rcv_fmdet.py index e229bcc2e6..24c710a494 100755 --- a/gnuradio-core/src/python/gnuradio/blks2impl/wfm_rcv_fmdet.py +++ b/gnuradio-core/src/python/gnuradio/blks2impl/wfm_rcv_fmdet.py @@ -32,10 +32,9 @@ class wfm_rcv_fmdet(gr.hier_block2): (gr_complex). The output is two streams of the demodulated audio (float) 0=Left, 1=Right. - @param demod_rate: input sample rate of complex baseband input. - @type demod_rate: float - @param audio_decimation: how much to decimate demod_rate to get to audio. - @type audio_decimation: integer + Args: + demod_rate: input sample rate of complex baseband input. (float) + audio_decimation: how much to decimate demod_rate to get to audio. (integer) """ gr.hier_block2.__init__(self, "wfm_rcv_fmdet", gr.io_signature(1, 1, gr.sizeof_gr_complex), # Input signature diff --git a/gnuradio-core/src/python/gnuradio/blks2impl/wfm_rcv_pll.py b/gnuradio-core/src/python/gnuradio/blks2impl/wfm_rcv_pll.py index d4ce6d2231..0b8706bf27 100644 --- a/gnuradio-core/src/python/gnuradio/blks2impl/wfm_rcv_pll.py +++ b/gnuradio-core/src/python/gnuradio/blks2impl/wfm_rcv_pll.py @@ -31,10 +31,9 @@ class wfm_rcv_pll(gr.hier_block2): The input is the downconverted complex baseband signal (gr_complex). The output is two streams of the demodulated audio (float) 0=Left, 1=Right. - @param demod_rate: input sample rate of complex baseband input. - @type demod_rate: float - @param audio_decimation: how much to decimate demod_rate to get to audio. - @type audio_decimation: integer + Args: + demod_rate: input sample rate of complex baseband input. (float) + audio_decimation: how much to decimate demod_rate to get to audio. (integer) """ gr.hier_block2.__init__(self, "wfm_rcv_pll", gr.io_signature(1, 1, gr.sizeof_gr_complex), # Input signature diff --git a/gnuradio-core/src/python/gnuradio/blks2impl/wfm_tx.py b/gnuradio-core/src/python/gnuradio/blks2impl/wfm_tx.py index 3fcf98f891..e7547d6524 100644 --- a/gnuradio-core/src/python/gnuradio/blks2impl/wfm_tx.py +++ b/gnuradio-core/src/python/gnuradio/blks2impl/wfm_tx.py @@ -31,14 +31,11 @@ class wfm_tx(gr.hier_block2): Takes a single float input stream of audio samples in the range [-1,+1] and produces a single FM modulated complex baseband output. - @param audio_rate: sample rate of audio stream, >= 16k - @type audio_rate: integer - @param quad_rate: sample rate of output stream - @type quad_rate: integer - @param tau: preemphasis time constant (default 75e-6) - @type tau: float - @param max_dev: maximum deviation in Hz (default 75e3) - @type max_dev: float + Args: + audio_rate: sample rate of audio stream, >= 16k (integer) + quad_rate: sample rate of output stream (integer) + tau: preemphasis time constant (default 75e-6) (float) + max_dev: maximum deviation in Hz (default 75e3) (float) quad_rate must be an integer multiple of audio_rate. """ diff --git a/gnuradio-core/src/python/gnuradio/eng_option.py b/gnuradio-core/src/python/gnuradio/eng_option.py index 02e9b0b6df..5d8660f0f2 100644 --- a/gnuradio-core/src/python/gnuradio/eng_option.py +++ b/gnuradio-core/src/python/gnuradio/eng_option.py @@ -43,7 +43,8 @@ def check_subdev (option, opt, value): """ Value has the form: (A|B)(:0|1)? - @returns a 2-tuple (0|1, 0|1) + Returns: + a 2-tuple (0|1, 0|1) """ d = { 'A' : (0, 0), 'A:0' : (0, 0), 'A:1' : (0, 1), 'A:2' : (0, 2), 'B' : (1, 0), 'B:0' : (1, 0), 'B:1' : (1, 1), 'B:2' : (1, 2) } diff --git a/gnuradio-core/src/python/gnuradio/gruimpl/socket_stuff.py b/gnuradio-core/src/python/gnuradio/gruimpl/socket_stuff.py index 329fd2ed3d..489b6ab255 100644 --- a/gnuradio-core/src/python/gnuradio/gruimpl/socket_stuff.py +++ b/gnuradio-core/src/python/gnuradio/gruimpl/socket_stuff.py @@ -27,9 +27,12 @@ import sys def tcp_connect_or_die(sock_addr): """ - @param sock_addr: (host, port) to connect to - @type sock_addr: tuple - @returns: socket or exits + + Args: + sock_addr: (host, port) to connect to (tuple) + + Returns: + : socket or exits """ s = socket.socket (socket.AF_INET, socket.SOCK_STREAM) try: @@ -42,9 +45,12 @@ def tcp_connect_or_die(sock_addr): def udp_connect_or_die(sock_addr): """ - @param sock_addr: (host, port) to connect to - @type sock_addr: tuple - @returns: socket or exits + + Args: + sock_addr: (host, port) to connect to (tuple) + + Returns: + : socket or exits """ s = socket.socket (socket.AF_INET, socket.SOCK_DGRAM) try: diff --git a/gnuradio-core/src/python/gnuradio/optfir.py b/gnuradio-core/src/python/gnuradio/optfir.py index bbf9ead747..bbd48dae75 100644 --- a/gnuradio-core/src/python/gnuradio/optfir.py +++ b/gnuradio-core/src/python/gnuradio/optfir.py @@ -32,18 +32,20 @@ from gnuradio import gr remez = gr.remez -# ---------------------------------------------------------------- - -## Builds a low pass filter. -# @param gain Filter gain in the passband (linear) -# @param Fs Sampling rate (sps) -# @param freq1 End of pass band (in Hz) -# @param freq2 Start of stop band (in Hz) -# @param passband_ripple_db Pass band ripple in dB (should be small, < 1) -# @param stopband_atten_db Stop band attenuation in dB (should be large, >= 60) -# @param nextra_taps Extra taps to use in the filter (default=2) def low_pass (gain, Fs, freq1, freq2, passband_ripple_db, stopband_atten_db, nextra_taps=2): + """ + Builds a low pass filter. + + Args: + gain: Filter gain in the passband (linear) + Fs: Sampling rate (sps) + freq1: End of pass band (in Hz) + freq2: Start of stop band (in Hz) + passband_ripple_db: Pass band ripple in dB (should be small, < 1) + stopband_atten_db: Stop band attenuation in dB (should be large, >= 60) + nextra_taps: Extra taps to use in the filter (default=2) + """ passband_dev = passband_ripple_to_dev (passband_ripple_db) stopband_dev = stopband_atten_to_dev (stopband_atten_db) desired_ampls = (gain, 0) @@ -53,19 +55,23 @@ def low_pass (gain, Fs, freq1, freq2, passband_ripple_db, stopband_atten_db, taps = gr.remez (n + nextra_taps, fo, ao, w, "bandpass") return taps -## Builds a band pass filter. -# @param gain Filter gain in the passband (linear) -# @param Fs Sampling rate (sps) -# @param freq_sb1 End of stop band (in Hz) -# @param freq_pb1 Start of pass band (in Hz) -# @param freq_pb2 End of pass band (in Hz) -# @param freq_sb2 Start of stop band (in Hz) -# @param passband_ripple_db Pass band ripple in dB (should be small, < 1) -# @param stopband_atten_db Stop band attenuation in dB (should be large, >= 60) -# @param nextra_taps Extra taps to use in the filter (default=2) def band_pass (gain, Fs, freq_sb1, freq_pb1, freq_pb2, freq_sb2, passband_ripple_db, stopband_atten_db, nextra_taps=2): + """ + Builds a band pass filter. + + Args: + gain: Filter gain in the passband (linear) + Fs: Sampling rate (sps) + freq_sb1: End of stop band (in Hz) + freq_pb1: Start of pass band (in Hz) + freq_pb2: End of pass band (in Hz) + freq_sb2: Start of stop band (in Hz) + passband_ripple_db: Pass band ripple in dB (should be small, < 1) + stopband_atten_db: Stop band attenuation in dB (should be large, >= 60) + nextra_taps: Extra taps to use in the filter (default=2) + """ passband_dev = passband_ripple_to_dev (passband_ripple_db) stopband_dev = stopband_atten_to_dev (stopband_atten_db) desired_ampls = (0, gain, 0) @@ -78,20 +84,24 @@ def band_pass (gain, Fs, freq_sb1, freq_pb1, freq_pb2, freq_sb2, return taps -## Builds a band pass filter with complex taps by making an LPF and -# spinning it up to the right center frequency -# @param gain Filter gain in the passband (linear) -# @param Fs Sampling rate (sps) -# @param freq_sb1 End of stop band (in Hz) -# @param freq_pb1 Start of pass band (in Hz) -# @param freq_pb2 End of pass band (in Hz) -# @param freq_sb2 Start of stop band (in Hz) -# @param passband_ripple_db Pass band ripple in dB (should be small, < 1) -# @param stopband_atten_db Stop band attenuation in dB (should be large, >= 60) -# @param nextra_taps Extra taps to use in the filter (default=2) def complex_band_pass (gain, Fs, freq_sb1, freq_pb1, freq_pb2, freq_sb2, passband_ripple_db, stopband_atten_db, nextra_taps=2): + """ + Builds a band pass filter with complex taps by making an LPF and + spinning it up to the right center frequency + + Args: + gain: Filter gain in the passband (linear) + Fs: Sampling rate (sps) + freq_sb1: End of stop band (in Hz) + freq_pb1: Start of pass band (in Hz) + freq_pb2: End of pass band (in Hz) + freq_sb2: Start of stop band (in Hz) + passband_ripple_db: Pass band ripple in dB (should be small, < 1) + stopband_atten_db: Stop band attenuation in dB (should be large, >= 60) + nextra_taps: Extra taps to use in the filter (default=2) + """ center_freq = (freq_pb2 + freq_pb1) / 2.0 lp_pb = (freq_pb2 - center_freq)/1.0 lp_sb = freq_sb2 - center_freq @@ -102,20 +112,24 @@ def complex_band_pass (gain, Fs, freq_sb1, freq_pb1, freq_pb2, freq_sb2, return taps -## Builds a band reject filter -# spinning it up to the right center frequency -# @param gain Filter gain in the passband (linear) -# @param Fs Sampling rate (sps) -# @param freq_pb1 End of pass band (in Hz) -# @param freq_sb1 Start of stop band (in Hz) -# @param freq_sb2 End of stop band (in Hz) -# @param freq_pb2 Start of pass band (in Hz) -# @param passband_ripple_db Pass band ripple in dB (should be small, < 1) -# @param stopband_atten_db Stop band attenuation in dB (should be large, >= 60) -# @param nextra_taps Extra taps to use in the filter (default=2) def band_reject (gain, Fs, freq_pb1, freq_sb1, freq_sb2, freq_pb2, passband_ripple_db, stopband_atten_db, nextra_taps=2): + """ + Builds a band reject filter + spinning it up to the right center frequency + + Args: + gain: Filter gain in the passband (linear) + Fs: Sampling rate (sps) + freq_pb1: End of pass band (in Hz) + freq_sb1: Start of stop band (in Hz) + freq_sb2: End of stop band (in Hz) + freq_pb2: Start of pass band (in Hz) + passband_ripple_db: Pass band ripple in dB (should be small, < 1) + stopband_atten_db: Stop band attenuation in dB (should be large, >= 60) + nextra_taps: Extra taps to use in the filter (default=2) + """ passband_dev = passband_ripple_to_dev (passband_ripple_db) stopband_dev = stopband_atten_to_dev (stopband_atten_db) desired_ampls = (gain, 0, gain) @@ -131,16 +145,20 @@ def band_reject (gain, Fs, freq_pb1, freq_sb1, freq_sb2, freq_pb2, return taps -## Builds a high pass filter. -# @param gain Filter gain in the passband (linear) -# @param Fs Sampling rate (sps) -# @param freq1 End of stop band (in Hz) -# @param freq2 Start of pass band (in Hz) -# @param passband_ripple_db Pass band ripple in dB (should be small, < 1) -# @param stopband_atten_db Stop band attenuation in dB (should be large, >= 60) -# @param nextra_taps Extra taps to use in the filter (default=2) def high_pass (gain, Fs, freq1, freq2, passband_ripple_db, stopband_atten_db, nextra_taps=2): + """ + Builds a high pass filter. + + Args: + gain: Filter gain in the passband (linear) + Fs: Sampling rate (sps) + freq1: End of stop band (in Hz) + freq2: Start of pass band (in Hz) + passband_ripple_db: Pass band ripple in dB (should be small, < 1) + stopband_atten_db: Stop band attenuation in dB (should be large, >= 60) + nextra_taps: Extra taps to use in the filter (default=2) + """ passband_dev = passband_ripple_to_dev (passband_ripple_db) stopband_dev = stopband_atten_to_dev (stopband_atten_db) desired_ampls = (0, 1) diff --git a/gr-atsc/src/python/atsc_utils.py b/gr-atsc/src/python/atsc_utils.py index fced6d1902..fc2465bed2 100644 --- a/gr-atsc/src/python/atsc_utils.py +++ b/gr-atsc/src/python/atsc_utils.py @@ -28,7 +28,8 @@ def make_fake_transport_stream_packet(npkts): """ Return a sequence of 8-bit ints that represents an MPEG Transport Stream packet. - @param npkts: how many 188-byte packets to return + Args: + npkts: how many 188-byte packets to return FYI, each ATSC Data Frame contains two Data Fields, each of which contains 312 data segments. Each transport stream packet maps to a data segment. diff --git a/gr-atsc/src/python/qa_atsc.py b/gr-atsc/src/python/qa_atsc.py index c6b8d2e957..ab3eb96d40 100755 --- a/gr-atsc/src/python/qa_atsc.py +++ b/gr-atsc/src/python/qa_atsc.py @@ -76,8 +76,8 @@ class vector_source_ts(gr.hier_block2): """ Pad tranport stream packets to 256 bytes and reformat appropriately. - @param ts: MPEG transport stream. - @type ts: sequence of ints in [0,255]; len(ts) % 188 == 0 + Args: + ts: MPEG transport stream. (sequence of ints in [0,255]; len(ts) % 188 == 0) """ src = gr.vector_source_b(pad_transport_stream(ts)) diff --git a/gr-digital/examples/narrowband/receive_path.py b/gr-digital/examples/narrowband/receive_path.py index 1f93105068..363cb1e240 100644 --- a/gr-digital/examples/narrowband/receive_path.py +++ b/gr-digital/examples/narrowband/receive_path.py @@ -119,8 +119,8 @@ class receive_path(gr.hier_block2): """ Set carrier threshold. - @param threshold_in_db: set detection threshold - @type threshold_in_db: float (dB) + Args: + threshold_in_db: set detection threshold (float (dB)) """ self.probe.set_threshold(threshold_in_db) diff --git a/gr-digital/examples/narrowband/transmit_path.py b/gr-digital/examples/narrowband/transmit_path.py index 4d6162ed61..ec87ecd825 100644 --- a/gr-digital/examples/narrowband/transmit_path.py +++ b/gr-digital/examples/narrowband/transmit_path.py @@ -71,7 +71,9 @@ class transmit_path(gr.hier_block2): def set_tx_amplitude(self, ampl): """ Sets the transmit amplitude sent to the USRP in volts - @param: ampl 0 <= ampl < 1. + + Args: + : ampl 0 <= ampl < 1. """ self._tx_amplitude = max(0.0, min(ampl, 1)) self.amp.set_k(self._tx_amplitude) diff --git a/gr-digital/examples/narrowband/tunnel.py b/gr-digital/examples/narrowband/tunnel.py index 65205b9f6f..7b9b69cc8a 100755 --- a/gr-digital/examples/narrowband/tunnel.py +++ b/gr-digital/examples/narrowband/tunnel.py @@ -161,8 +161,9 @@ class cs_mac(object): """ Invoked by thread associated with PHY to pass received packet up. - @param ok: bool indicating whether payload CRC was OK - @param payload: contents of the packet (string) + Args: + ok: bool indicating whether payload CRC was OK + payload: contents of the packet (string) """ if self.verbose: print "Rx: ok = %r len(payload) = %4d" % (ok, len(payload)) diff --git a/gr-digital/examples/ofdm/receive_path.py b/gr-digital/examples/ofdm/receive_path.py index e1c7868a0e..b5094ac24d 100644 --- a/gr-digital/examples/ofdm/receive_path.py +++ b/gr-digital/examples/ofdm/receive_path.py @@ -77,8 +77,8 @@ class receive_path(gr.hier_block2): """ Set carrier threshold. - @param threshold_in_db: set detection threshold - @type threshold_in_db: float (dB) + Args: + threshold_in_db: set detection threshold (float (dB)) """ self.probe.set_threshold(threshold_in_db) diff --git a/gr-digital/examples/ofdm/transmit_path.py b/gr-digital/examples/ofdm/transmit_path.py index ec357d6173..6fb66e4076 100644 --- a/gr-digital/examples/ofdm/transmit_path.py +++ b/gr-digital/examples/ofdm/transmit_path.py @@ -62,7 +62,9 @@ class transmit_path(gr.hier_block2): def set_tx_amplitude(self, ampl): """ Sets the transmit amplitude sent to the USRP - @param: ampl 0 <= ampl < 1.0. Try 0.10 + + Args: + : ampl 0 <= ampl < 1.0. Try 0.10 """ self._tx_amplitude = max(0.0, min(ampl, 1)) self.amp.set_k(self._tx_amplitude) diff --git a/gr-digital/examples/ofdm/tunnel.py b/gr-digital/examples/ofdm/tunnel.py index e253cf5161..f407aef8d6 100755 --- a/gr-digital/examples/ofdm/tunnel.py +++ b/gr-digital/examples/ofdm/tunnel.py @@ -146,8 +146,9 @@ class cs_mac(object): """ Invoked by thread associated with PHY to pass received packet up. - @param ok: bool indicating whether payload CRC was OK - @param payload: contents of the packet (string) + Args: + ok: bool indicating whether payload CRC was OK + payload: contents of the packet (string) """ if self.verbose: print "Rx: ok = %r len(payload) = %4d" % (ok, len(payload)) diff --git a/gr-digital/python/gfsk.py b/gr-digital/python/gfsk.py index c85fdf0e00..aa602d8b8d 100644 --- a/gr-digital/python/gfsk.py +++ b/gr-digital/python/gfsk.py @@ -68,14 +68,11 @@ class gfsk_mod(gr.hier_block2): The input is a byte stream (unsigned char) and the output is the complex modulated signal at baseband. - @param samples_per_symbol: samples per baud >= 2 - @type samples_per_symbol: integer - @param bt: Gaussian filter bandwidth * symbol time - @type bt: float - @param verbose: Print information about modulator? - @type verbose: bool - @param debug: Print modualtion data to files? - @type debug: bool + Args: + samples_per_symbol: samples per baud >= 2 (integer) + bt: Gaussian filter bandwidth * symbol time (float) + verbose: Print information about modulator? (bool) + debug: Print modualtion data to files? (bool) """ gr.hier_block2.__init__(self, "gfsk_mod", @@ -188,23 +185,19 @@ class gfsk_demod(gr.hier_block2): The input is the complex modulated signal at baseband. The output is a stream of bits packed 1 bit per byte (the LSB) - @param samples_per_symbol: samples per baud - @type samples_per_symbol: integer - @param verbose: Print information about modulator? - @type verbose: bool - @param log: Print modualtion data to files? - @type log: bool + Args: + samples_per_symbol: samples per baud (integer) + verbose: Print information about modulator? (bool) + log: Print modualtion data to files? (bool) Clock recovery parameters. These all have reasonble defaults. - @param gain_mu: controls rate of mu adjustment - @type gain_mu: float - @param mu: fractional delay [0.0, 1.0] - @type mu: float - @param omega_relative_limit: sets max variation in omega - @type omega_relative_limit: float, typically 0.000200 (200 ppm) - @param freq_error: bit rate error as a fraction - @param float + Args: + gain_mu: controls rate of mu adjustment (float) + mu: fractional delay [0.0, 1.0] (float) + omega_relative_limit: sets max variation in omega (float, typically 0.000200 (200 ppm)) + freq_error: bit rate error as a fraction + float: """ gr.hier_block2.__init__(self, "gfsk_demod", diff --git a/gr-digital/python/modulation_utils.py b/gr-digital/python/modulation_utils.py index cb3a9812d4..d499094d05 100644 --- a/gr-digital/python/modulation_utils.py +++ b/gr-digital/python/modulation_utils.py @@ -74,11 +74,10 @@ def extract_kwargs_from_options(function, excluded_args, options): but in that case the default provided in the __init__ argument list will be used since there is no kwargs entry.) - @param function: the function whose parameter list will be examined - @param excluded_args: function arguments that are NOT to be added to the dictionary - @type excluded_args: sequence of strings - @param options: result of command argument parsing - @type options: optparse.Values + Args: + function: the function whose parameter list will be examined + excluded_args: function arguments that are NOT to be added to the dictionary (sequence of strings) + options: result of command argument parsing (optparse.Values) """ # Try this in C++ ;) diff --git a/gr-digital/python/ofdm.py b/gr-digital/python/ofdm.py index 9f57920efc..4c53ad0108 100644 --- a/gr-digital/python/ofdm.py +++ b/gr-digital/python/ofdm.py @@ -46,10 +46,10 @@ class ofdm_mod(gr.hier_block2): Packets to be sent are enqueued by calling send_pkt. The output is the complex modulated signal at baseband. - @param options: pass modulation options from higher layers (fft length, occupied tones, etc.) - @param msgq_limit: maximum number of messages in message queue - @type msgq_limit: int - @param pad_for_usrp: If true, packets are padded such that they end up a multiple of 128 samples + Args: + options: pass modulation options from higher layers (fft length, occupied tones, etc.) + msgq_limit: maximum number of messages in message queue (int) + pad_for_usrp: If true, packets are padded such that they end up a multiple of 128 samples """ gr.hier_block2.__init__(self, "ofdm_mod", @@ -130,8 +130,8 @@ class ofdm_mod(gr.hier_block2): """ Send the payload. - @param payload: data to send - @type payload: string + Args: + payload: data to send (string) """ if eof: msg = gr.message(1) # tell self._pkt_input we're not sending any more packets @@ -188,9 +188,9 @@ class ofdm_demod(gr.hier_block2): The input is the complex modulated signal at baseband. Demodulated packets are sent to the handler. - @param options: pass modulation options from higher layers (fft length, occupied tones, etc.) - @param callback: function of two args: ok, payload - @type callback: ok: bool; payload: string + Args: + options: pass modulation options from higher layers (fft length, occupied tones, etc.) + callback: function of two args: ok, payload (ok: bool; payload: string) """ gr.hier_block2.__init__(self, "ofdm_demod", gr.io_signature(1, 1, gr.sizeof_gr_complex), # Input signature diff --git a/gr-digital/python/ofdm_packet_utils.py b/gr-digital/python/ofdm_packet_utils.py index d0000e6db5..c49dfe4f8e 100644 --- a/gr-digital/python/ofdm_packet_utils.py +++ b/gr-digital/python/ofdm_packet_utils.py @@ -101,14 +101,12 @@ def make_packet(payload, samples_per_symbol, bits_per_symbol, """ Build a packet, given access code, payload, and whitener offset - @param payload: packet payload, len [0, 4096] - @param samples_per_symbol: samples per symbol (needed for padding calculation) - @type samples_per_symbol: int - @param bits_per_symbol: (needed for padding calculation) - @type bits_per_symbol: int - @param whitener_offset offset into whitener string to use [0-16) - @param whitening: Turn whitener on or off - @type whitening: bool + Args: + payload: packet payload, len [0, 4096] + samples_per_symbol: samples per symbol (needed for padding calculation) (int) + bits_per_symbol: (needed for padding calculation) (int) + whitener_offset: offset into whitener string to use [0-16) + whitening: Turn whitener on or off (bool) Packet will have access code at the beginning, followed by length, payload and finally CRC-32. @@ -150,13 +148,13 @@ def _npadding_bytes(pkt_byte_len, samples_per_symbol, bits_per_symbol): we want to pad so that after modulation the resulting packet is a multiple of 128 samples. - @param ptk_byte_len: len in bytes of packet, not including padding. - @param samples_per_symbol: samples per bit (1 bit / symbolwidth GMSK) - @type samples_per_symbol: int - @param bits_per_symbol: bits per symbol (log2(modulation order)) - @type bits_per_symbol: int + Args: + ptk_byte_len: len in bytes of packet, not including padding. + samples_per_symbol: samples per bit (1 bit / symbolwidth GMSK) (int) + bits_per_symbol: bits per symbol (log2(modulation order)) (int) - @returns number of bytes of padding to append. + Returns: + number of bytes of padding to append. """ modulus = 128 byte_modulus = gru.lcm(modulus/8, samples_per_symbol) * bits_per_symbol / samples_per_symbol @@ -170,10 +168,10 @@ def unmake_packet(whitened_payload_with_crc, whitener_offset=0, dewhitening=1): """ Return (ok, payload) - @param whitened_payload_with_crc: string - @param whitener_offset offset into whitener string to use [0-16) - @param dewhitening: Turn whitener on or off - @type dewhitening: bool + Args: + whitened_payload_with_crc: string + whitener_offset: offset into whitener string to use [0-16) + dewhitening: Turn whitener on or off (bool) """ if dewhitening: diff --git a/gr-digital/python/ofdm_receiver.py b/gr-digital/python/ofdm_receiver.py index 9d4d6e559d..33d9b66268 100644 --- a/gr-digital/python/ofdm_receiver.py +++ b/gr-digital/python/ofdm_receiver.py @@ -47,18 +47,13 @@ class ofdm_receiver(gr.hier_block2): The input is the complex modulated signal at baseband. Synchronized packets are sent back to the demodulator. - @param fft_length: total number of subcarriers - @type fft_length: int - @param cp_length: length of cyclic prefix as specified in subcarriers (<= fft_length) - @type cp_length: int - @param occupied_tones: number of subcarriers used for data - @type occupied_tones: int - @param snr: estimated signal to noise ratio used to guide cyclic prefix synchronizer - @type snr: float - @param ks: known symbols used as preambles to each packet - @type ks: list of lists - @param logging: turn file logging on or off - @type logging: bool + Args: + fft_length: total number of subcarriers (int) + cp_length: length of cyclic prefix as specified in subcarriers (<= fft_length) (int) + occupied_tones: number of subcarriers used for data (int) + snr: estimated signal to noise ratio used to guide cyclic prefix synchronizer (float) + ks: known symbols used as preambles to each packet (list of lists) + logging: turn file logging on or off (bool) """ gr.hier_block2.__init__(self, "ofdm_receiver", diff --git a/gr-digital/python/packet_utils.py b/gr-digital/python/packet_utils.py index 2e216ff50e..2929758ef0 100644 --- a/gr-digital/python/packet_utils.py +++ b/gr-digital/python/packet_utils.py @@ -107,13 +107,12 @@ def make_packet(payload, samples_per_symbol, bits_per_symbol, """ Build a packet, given access code, payload, and whitener offset - @param payload: packet payload, len [0, 4096] - @param samples_per_symbol: samples per symbol (needed for padding calculation) - @type samples_per_symbol: int - @param bits_per_symbol: (needed for padding calculation) - @type bits_per_symbol: int - @param access_code: string of ascii 0's and 1's - @param whitener_offset offset into whitener string to use [0-16) + Args: + payload: packet payload, len [0, 4096] + samples_per_symbol: samples per symbol (needed for padding calculation) (int) + bits_per_symbol: (needed for padding calculation) (int) + access_code: string of ascii 0's and 1's + whitener_offset: offset into whitener string to use [0-16) Packet will have access code at the beginning, followed by length, payload and finally CRC-32. @@ -156,13 +155,13 @@ def _npadding_bytes(pkt_byte_len, samples_per_symbol, bits_per_symbol): we want to pad so that after modulation the resulting packet is a multiple of 128 samples. - @param ptk_byte_len: len in bytes of packet, not including padding. - @param samples_per_symbol: samples per bit (1 bit / symbolwidth GMSK) - @type samples_per_symbol: int - @param bits_per_symbol: bits per symbol (log2(modulation order)) - @type bits_per_symbol: int + Args: + ptk_byte_len: len in bytes of packet, not including padding. + samples_per_symbol: samples per bit (1 bit / symbolwidth GMSK) (int) + bits_per_symbol: bits per symbol (log2(modulation order)) (int) - @returns number of bytes of padding to append. + Returns: + number of bytes of padding to append. """ modulus = 128 byte_modulus = gru.lcm(modulus/8, samples_per_symbol) * bits_per_symbol / samples_per_symbol @@ -176,7 +175,8 @@ def unmake_packet(whitened_payload_with_crc, whitener_offset=0, dewhitening=True """ Return (ok, payload) - @param whitened_payload_with_crc: string + Args: + whitened_payload_with_crc: string """ if dewhitening: diff --git a/gr-digital/python/pkt.py b/gr-digital/python/pkt.py index 09254a7caa..283a150d2c 100644 --- a/gr-digital/python/pkt.py +++ b/gr-digital/python/pkt.py @@ -44,14 +44,12 @@ class mod_pkts(gr.hier_block2): Packets to be sent are enqueued by calling send_pkt. The output is the complex modulated signal at baseband. - @param modulator: instance of modulator class (gr_block or hier_block2) - @type modulator: complex baseband out - @param access_code: AKA sync vector - @type access_code: string of 1's and 0's between 1 and 64 long - @param msgq_limit: maximum number of messages in message queue - @type msgq_limit: int - @param pad_for_usrp: If true, packets are padded such that they end up a multiple of 128 samples - @param use_whitener_offset: If true, start of whitener XOR string is incremented each packet + Args: + modulator: instance of modulator class (gr_block or hier_block2) (complex baseband out) + access_code: AKA sync vector (string of 1's and 0's between 1 and 64 long) + msgq_limit: maximum number of messages in message queue (int) + pad_for_usrp: If true, packets are padded such that they end up a multiple of 128 samples + use_whitener_offset: If true, start of whitener XOR string is incremented each packet See gmsk_mod for remaining parameters """ @@ -79,8 +77,8 @@ class mod_pkts(gr.hier_block2): """ Send the payload. - @param payload: data to send - @type payload: string + Args: + payload: data to send (string) """ if eof: msg = gr.message(1) # tell self._pkt_input we're not sending any more packets @@ -116,14 +114,11 @@ class demod_pkts(gr.hier_block2): The input is the complex modulated signal at baseband. Demodulated packets are sent to the handler. - @param demodulator: instance of demodulator class (gr_block or hier_block2) - @type demodulator: complex baseband in - @param access_code: AKA sync vector - @type access_code: string of 1's and 0's - @param callback: function of two args: ok, payload - @type callback: ok: bool; payload: string - @param threshold: detect access_code with up to threshold bits wrong (-1 -> use default) - @type threshold: int + Args: + demodulator: instance of demodulator class (gr_block or hier_block2) (complex baseband in) + access_code: AKA sync vector (string of 1's and 0's) + callback: function of two args: ok, payload (ok: bool; payload: string) + threshold: detect access_code with up to threshold bits wrong (-1 -> use default) (int) """ gr.hier_block2.__init__(self, "demod_pkts", diff --git a/gr-filter/python/optfir.py b/gr-filter/python/optfir.py index bccb8c68d0..47b0ac4e8d 100644 --- a/gr-filter/python/optfir.py +++ b/gr-filter/python/optfir.py @@ -32,16 +32,20 @@ import filter_swig as filter # ---------------------------------------------------------------- -## Builds a low pass filter. -# @param gain Filter gain in the passband (linear) -# @param Fs Sampling rate (sps) -# @param freq1 End of pass band (in Hz) -# @param freq2 Start of stop band (in Hz) -# @param passband_ripple_db Pass band ripple in dB (should be small, < 1) -# @param stopband_atten_db Stop band attenuation in dB (should be large, >= 60) -# @param nextra_taps Extra taps to use in the filter (default=2) def low_pass (gain, Fs, freq1, freq2, passband_ripple_db, stopband_atten_db, nextra_taps=2): + """ + Builds a low pass filter. + + Args: + gain: Filter gain in the passband (linear) + Fs: Sampling rate (sps) + freq1: End of pass band (in Hz) + freq2: Start of stop band (in Hz) + passband_ripple_db: Pass band ripple in dB (should be small, < 1) + stopband_atten_db: Stop band attenuation in dB (should be large, >= 60) + nextra_taps: Extra taps to use in the filter (default=2) + """ passband_dev = passband_ripple_to_dev (passband_ripple_db) stopband_dev = stopband_atten_to_dev (stopband_atten_db) desired_ampls = (gain, 0) @@ -51,19 +55,23 @@ def low_pass (gain, Fs, freq1, freq2, passband_ripple_db, stopband_atten_db, taps = filter.pm_remez (n + nextra_taps, fo, ao, w, "bandpass") return taps -## Builds a band pass filter. -# @param gain Filter gain in the passband (linear) -# @param Fs Sampling rate (sps) -# @param freq_sb1 End of stop band (in Hz) -# @param freq_pb1 Start of pass band (in Hz) -# @param freq_pb2 End of pass band (in Hz) -# @param freq_sb2 Start of stop band (in Hz) -# @param passband_ripple_db Pass band ripple in dB (should be small, < 1) -# @param stopband_atten_db Stop band attenuation in dB (should be large, >= 60) -# @param nextra_taps Extra taps to use in the filter (default=2) def band_pass (gain, Fs, freq_sb1, freq_pb1, freq_pb2, freq_sb2, passband_ripple_db, stopband_atten_db, nextra_taps=2): + """ + Builds a band pass filter. + + Args: + gain: Filter gain in the passband (linear) + Fs: Sampling rate (sps) + freq_sb1: End of stop band (in Hz) + freq_pb1: Start of pass band (in Hz) + freq_pb2: End of pass band (in Hz) + freq_sb2: Start of stop band (in Hz) + passband_ripple_db: Pass band ripple in dB (should be small, < 1) + stopband_atten_db: Stop band attenuation in dB (should be large, >= 60) + nextra_taps: Extra taps to use in the filter (default=2) + """ passband_dev = passband_ripple_to_dev (passband_ripple_db) stopband_dev = stopband_atten_to_dev (stopband_atten_db) desired_ampls = (0, gain, 0) @@ -75,21 +83,24 @@ def band_pass (gain, Fs, freq_sb1, freq_pb1, freq_pb2, freq_sb2, taps = filter.pm_remez (n + nextra_taps, fo, ao, w, "bandpass") return taps - -## Builds a band pass filter with complex taps by making an LPF and -# spinning it up to the right center frequency -# @param gain Filter gain in the passband (linear) -# @param Fs Sampling rate (sps) -# @param freq_sb1 End of stop band (in Hz) -# @param freq_pb1 Start of pass band (in Hz) -# @param freq_pb2 End of pass band (in Hz) -# @param freq_sb2 Start of stop band (in Hz) -# @param passband_ripple_db Pass band ripple in dB (should be small, < 1) -# @param stopband_atten_db Stop band attenuation in dB (should be large, >= 60) -# @param nextra_taps Extra taps to use in the filter (default=2) def complex_band_pass (gain, Fs, freq_sb1, freq_pb1, freq_pb2, freq_sb2, passband_ripple_db, stopband_atten_db, nextra_taps=2): + """ + Builds a band pass filter with complex taps by making an LPF and + spinning it up to the right center frequency + + Args: + gain: Filter gain in the passband (linear) + Fs: Sampling rate (sps) + freq_sb1: End of stop band (in Hz) + freq_pb1: Start of pass band (in Hz) + freq_pb2: End of pass band (in Hz) + freq_sb2: Start of stop band (in Hz) + passband_ripple_db: Pass band ripple in dB (should be small, < 1) + stopband_atten_db: Stop band attenuation in dB (should be large, >= 60) + nextra_taps: Extra taps to use in the filter (default=2) + """ center_freq = (freq_pb2 + freq_pb1) / 2.0 lp_pb = (freq_pb2 - center_freq)/1.0 lp_sb = freq_sb2 - center_freq @@ -100,20 +111,24 @@ def complex_band_pass (gain, Fs, freq_sb1, freq_pb1, freq_pb2, freq_sb2, return taps -## Builds a band reject filter -# spinning it up to the right center frequency -# @param gain Filter gain in the passband (linear) -# @param Fs Sampling rate (sps) -# @param freq_pb1 End of pass band (in Hz) -# @param freq_sb1 Start of stop band (in Hz) -# @param freq_sb2 End of stop band (in Hz) -# @param freq_pb2 Start of pass band (in Hz) -# @param passband_ripple_db Pass band ripple in dB (should be small, < 1) -# @param stopband_atten_db Stop band attenuation in dB (should be large, >= 60) -# @param nextra_taps Extra taps to use in the filter (default=2) def band_reject (gain, Fs, freq_pb1, freq_sb1, freq_sb2, freq_pb2, passband_ripple_db, stopband_atten_db, nextra_taps=2): + """ + Builds a band reject filter + spinning it up to the right center frequency + + Args: + gain: Filter gain in the passband (linear) + Fs: Sampling rate (sps) + freq_pb1: End of pass band (in Hz) + freq_sb1: Start of stop band (in Hz) + freq_sb2: End of stop band (in Hz) + freq_pb2: Start of pass band (in Hz) + passband_ripple_db: Pass band ripple in dB (should be small, < 1) + stopband_atten_db: Stop band attenuation in dB (should be large, >= 60) + nextra_taps: Extra taps to use in the filter (default=2) + """ passband_dev = passband_ripple_to_dev (passband_ripple_db) stopband_dev = stopband_atten_to_dev (stopband_atten_db) desired_ampls = (gain, 0, gain) @@ -129,16 +144,20 @@ def band_reject (gain, Fs, freq_pb1, freq_sb1, freq_sb2, freq_pb2, return taps -## Builds a high pass filter. -# @param gain Filter gain in the passband (linear) -# @param Fs Sampling rate (sps) -# @param freq1 End of stop band (in Hz) -# @param freq2 Start of pass band (in Hz) -# @param passband_ripple_db Pass band ripple in dB (should be small, < 1) -# @param stopband_atten_db Stop band attenuation in dB (should be large, >= 60) -# @param nextra_taps Extra taps to use in the filter (default=2) def high_pass (gain, Fs, freq1, freq2, passband_ripple_db, stopband_atten_db, nextra_taps=2): + """ + Builds a high pass filter. + + Args: + gain: Filter gain in the passband (linear) + Fs: Sampling rate (sps) + freq1: End of stop band (in Hz) + freq2: Start of pass band (in Hz) + passband_ripple_db: Pass band ripple in dB (should be small, < 1) + stopband_atten_db: Stop band attenuation in dB (should be large, >= 60) + nextra_taps: Extra taps to use in the filter (default=2) + """ passband_dev = passband_ripple_to_dev (passband_ripple_db) stopband_dev = stopband_atten_to_dev (stopband_atten_db) desired_ampls = (0, 1) diff --git a/gr-filter/python/rational_resampler.py b/gr-filter/python/rational_resampler.py index 312b011d32..97df283e67 100644 --- a/gr-filter/python/rational_resampler.py +++ b/gr-filter/python/rational_resampler.py @@ -28,13 +28,12 @@ def design_filter(interpolation, decimation, fractional_bw): Given the interpolation rate, decimation rate and a fractional bandwidth, design a set of taps. - @param interpolation: interpolation factor - @type interpolation: integer > 0 - @param decimation: decimation factor - @type decimation: integer > 0 - @param fractional_bw: fractional bandwidth in (0, 0.5) 0.4 works well. - @type fractional_bw: float - @returns: sequence of numbers + Args: + interpolation: interpolation factor (integer > 0) + decimation: decimation factor (integer > 0) + fractional_bw: fractional bandwidth in (0, 0.5) 0.4 works well. (float) + Returns: + : sequence of numbers """ if fractional_bw >= 0.5 or fractional_bw <= 0: @@ -67,14 +66,11 @@ class _rational_resampler_base(gr.hier_block2): If neither is specified, a reasonable default, 0.4, is used as the fractional_bw. - @param interpolation: interpolation factor - @type interpolation: integer > 0 - @param decimation: decimation factor - @type decimation: integer > 0 - @param taps: optional filter coefficients - @type taps: sequence - @param fractional_bw: fractional bandwidth in (0, 0.5), measured at final freq (use 0.4) - @type fractional_bw: float + Args: + interpolation: interpolation factor (integer > 0) + decimation: decimation factor (integer > 0) + taps: optional filter coefficients (sequence) + fractional_bw: fractional bandwidth in (0, 0.5), measured at final freq (use 0.4) (float) """ if not isinstance(interpolation, int) or interpolation < 1: diff --git a/gr-uhd/apps/hf_radio/input.py b/gr-uhd/apps/hf_radio/input.py index 78e800bb6c..fd2ac47a5c 100644 --- a/gr-uhd/apps/hf_radio/input.py +++ b/gr-uhd/apps/hf_radio/input.py @@ -47,8 +47,8 @@ class uhd_input(gr.hier_block2): """ Set the center frequency. - @param target_freq: frequency in Hz - @type: bool + Args: + target_freq: frequency in Hz """ r = self.src.set_center_freq(target_freq, 0) diff --git a/gr-uhd/apps/uhd_siggen_base.py b/gr-uhd/apps/uhd_siggen_base.py index 8c69da1ccb..9eecddb756 100644 --- a/gr-uhd/apps/uhd_siggen_base.py +++ b/gr-uhd/apps/uhd_siggen_base.py @@ -151,7 +151,9 @@ class top_block(gr.top_block, pubsub): def _set_tx_amplitude(self, ampl): """ Sets the transmit amplitude sent to the USRP - @param ampl the amplitude or None for automatic + + Args: + ampl: the amplitude or None for automatic """ ampl_range = self[AMPL_RANGE_KEY] if ampl is None: diff --git a/gr-uhd/examples/python/fm_tx4.py b/gr-uhd/examples/python/fm_tx4.py index f412ffb5dc..255b436f56 100755 --- a/gr-uhd/examples/python/fm_tx4.py +++ b/gr-uhd/examples/python/fm_tx4.py @@ -179,7 +179,8 @@ class fm_tx_block(stdgui2.std_top_block): """ Set the center frequency we're interested in. - @param target_freq: frequency in Hz + Args: + target_freq: frequency in Hz @rypte: bool Tuning is a two step process. First we ask the front-end to diff --git a/gr-uhd/examples/python/fm_tx_2_daughterboards.py b/gr-uhd/examples/python/fm_tx_2_daughterboards.py index b5763e8e19..d98d655ab1 100755 --- a/gr-uhd/examples/python/fm_tx_2_daughterboards.py +++ b/gr-uhd/examples/python/fm_tx_2_daughterboards.py @@ -184,8 +184,9 @@ class my_top_block(gr.top_block): """ Set the center frequency we're interested in. - @param side: 0 = side A, 1 = side B - @param target_freq: frequency in Hz + Args: + side: 0 = side A, 1 = side B + target_freq: frequency in Hz @rtype: bool """ diff --git a/gr-uhd/examples/python/usrp_am_mw_rcv.py b/gr-uhd/examples/python/usrp_am_mw_rcv.py index 28262f2bd5..40a7fee68d 100755 --- a/gr-uhd/examples/python/usrp_am_mw_rcv.py +++ b/gr-uhd/examples/python/usrp_am_mw_rcv.py @@ -278,7 +278,8 @@ class wfm_rx_block (stdgui2.std_top_block): """ Set the center frequency we're interested in. - @param target_freq: frequency in Hz + Args: + target_freq: frequency in Hz @rypte: bool """ r = self.u.set_center_freq(target_freq + self.IF_freq, 0) diff --git a/gr-uhd/examples/python/usrp_nbfm_ptt.py b/gr-uhd/examples/python/usrp_nbfm_ptt.py index 8d26e656e1..af4c214795 100755 --- a/gr-uhd/examples/python/usrp_nbfm_ptt.py +++ b/gr-uhd/examples/python/usrp_nbfm_ptt.py @@ -344,7 +344,8 @@ class transmit_path(gr.hier_block2): """ Set the center frequency we're interested in. - @param target_freq: frequency in Hz + Args: + target_freq: frequency in Hz @rypte: bool """ r = self.u.set_center_freq(target_freq) @@ -464,7 +465,8 @@ class receive_path(gr.hier_block2): """ Set the center frequency we're interested in. - @param target_freq: frequency in Hz + Args: + target_freq: frequency in Hz @rypte: bool """ r = self.u.set_center_freq(target_freq) diff --git a/gr-uhd/examples/python/usrp_nbfm_rcv.py b/gr-uhd/examples/python/usrp_nbfm_rcv.py index 571abe8c90..4a8340ec7b 100755 --- a/gr-uhd/examples/python/usrp_nbfm_rcv.py +++ b/gr-uhd/examples/python/usrp_nbfm_rcv.py @@ -357,7 +357,8 @@ class receive_path(gr.hier_block2): """ Set the center frequency we're interested in. - @param target_freq: frequency in Hz + Args: + target_freq: frequency in Hz @rypte: bool """ diff --git a/gr-uhd/examples/python/usrp_spectrum_sense.py b/gr-uhd/examples/python/usrp_spectrum_sense.py index 32980adbfa..ce60241deb 100755 --- a/gr-uhd/examples/python/usrp_spectrum_sense.py +++ b/gr-uhd/examples/python/usrp_spectrum_sense.py @@ -213,7 +213,8 @@ class my_top_block(gr.top_block): """ Set the center frequency we're interested in. - @param target_freq: frequency in Hz + Args: + target_freq: frequency in Hz @rypte: bool """ r = self.u.set_center_freq(target_freq) diff --git a/gr-uhd/examples/python/usrp_tv_rcv.py b/gr-uhd/examples/python/usrp_tv_rcv.py index b49a5ea71a..b42cf57992 100755 --- a/gr-uhd/examples/python/usrp_tv_rcv.py +++ b/gr-uhd/examples/python/usrp_tv_rcv.py @@ -403,7 +403,8 @@ class tv_rx_block (stdgui2.std_top_block): """ Set the center frequency we're interested in. - @param target_freq: frequency in Hz + Args: + target_freq: frequency in Hz @rypte: bool Tuning is a two step process. First we ask the front-end to diff --git a/gr-uhd/examples/python/usrp_wfm_rcv.py b/gr-uhd/examples/python/usrp_wfm_rcv.py index bbb5990337..a7d114d8cc 100755 --- a/gr-uhd/examples/python/usrp_wfm_rcv.py +++ b/gr-uhd/examples/python/usrp_wfm_rcv.py @@ -252,7 +252,8 @@ class wfm_rx_block (stdgui2.std_top_block): """ Set the center frequency we're interested in. - @param target_freq: frequency in Hz + Args: + target_freq: frequency in Hz @rypte: bool """ diff --git a/gr-uhd/examples/python/usrp_wfm_rcv_fmdet.py b/gr-uhd/examples/python/usrp_wfm_rcv_fmdet.py index 514bd4faf7..b794825727 100755 --- a/gr-uhd/examples/python/usrp_wfm_rcv_fmdet.py +++ b/gr-uhd/examples/python/usrp_wfm_rcv_fmdet.py @@ -314,7 +314,8 @@ class wfm_rx_block (stdgui2.std_top_block): """ Set the center frequency we're interested in. - @param target_freq: frequency in Hz + Args: + target_freq: frequency in Hz @rypte: bool """ diff --git a/gr-uhd/examples/python/usrp_wfm_rcv_nogui.py b/gr-uhd/examples/python/usrp_wfm_rcv_nogui.py index 7d042983ef..6e9c830c61 100755 --- a/gr-uhd/examples/python/usrp_wfm_rcv_nogui.py +++ b/gr-uhd/examples/python/usrp_wfm_rcv_nogui.py @@ -137,7 +137,8 @@ class wfm_rx_block (gr.top_block): """ Set the center frequency we're interested in. - @param target_freq: frequency in Hz + Args: + target_freq: frequency in Hz @rypte: bool """ diff --git a/gr-uhd/examples/python/usrp_wfm_rcv_pll.py b/gr-uhd/examples/python/usrp_wfm_rcv_pll.py index 53b1e6feac..a5c78cb24b 100755 --- a/gr-uhd/examples/python/usrp_wfm_rcv_pll.py +++ b/gr-uhd/examples/python/usrp_wfm_rcv_pll.py @@ -311,7 +311,8 @@ class wfm_rx_block (stdgui2.std_top_block): """ Set the center frequency we're interested in. - @param target_freq: frequency in Hz + Args: + target_freq: frequency in Hz @rypte: bool """ diff --git a/gr-uhd/examples/python/usrp_wfm_rcv_sca.py b/gr-uhd/examples/python/usrp_wfm_rcv_sca.py index 646fe85870..0e93e22fcd 100755 --- a/gr-uhd/examples/python/usrp_wfm_rcv_sca.py +++ b/gr-uhd/examples/python/usrp_wfm_rcv_sca.py @@ -357,7 +357,8 @@ class wfm_rx_sca_block (stdgui2.std_top_block): """ Set the center frequency we're interested in. - @param target_freq: frequency in Hz + Args: + target_freq: frequency in Hz @rypte: bool Tuning is a two step process. First we ask the front-end to diff --git a/gr-uhd/examples/python/usrp_wxapt_rcv.py b/gr-uhd/examples/python/usrp_wxapt_rcv.py index 6b57de3bcf..5cceca1e98 100755 --- a/gr-uhd/examples/python/usrp_wxapt_rcv.py +++ b/gr-uhd/examples/python/usrp_wxapt_rcv.py @@ -247,7 +247,8 @@ class wxapt_rx_block (stdgui2.std_top_block): """ Set the center frequency we're interested in. - @param target_freq: frequency in Hz + Args: + target_freq: frequency in Hz @rypte: bool """ diff --git a/gr-wxgui/grc/panel.py b/gr-wxgui/grc/panel.py index e62133cac2..9bcb464701 100644 --- a/gr-wxgui/grc/panel.py +++ b/gr-wxgui/grc/panel.py @@ -33,17 +33,21 @@ class Panel(wx.Panel): def Add(self, win): """ Add a window to the wx vbox. - @param win the wx window + + Args: + win: the wx window """ self._box.Add(win, 0, wx.EXPAND) def GridAdd(self, win, row, col, row_span=1, col_span=1): """ Add a window to the wx grid at the given position. - @param win the wx window - @param row the row specification (integer >= 0) - @param col the column specification (integer >= 0) - @param row_span the row span specification (integer >= 1) - @param col_span the column span specification (integer >= 1) + + Args: + win: the wx window + row: the row specification (integer >= 0) + col: the column specification (integer >= 0) + row_span: the row span specification (integer >= 1) + col_span: the column span specification (integer >= 1) """ self._grid.Add(win, wx.GBPosition(row, col), wx.GBSpan(row_span, col_span), wx.EXPAND) diff --git a/gr-wxgui/grc/top_block_gui.py b/gr-wxgui/grc/top_block_gui.py index 479f55a302..c21e002c45 100644 --- a/gr-wxgui/grc/top_block_gui.py +++ b/gr-wxgui/grc/top_block_gui.py @@ -31,9 +31,11 @@ class top_block_gui(gr.top_block): """ Initialize the gr top block. Create the wx gui elements. - @param title the main window title - @param size the main window size tuple in pixels - @param icon the file path to an icon or None + + Args: + title: the main window title + size: the main window size tuple in pixels + icon: the file path to an icon or None """ #initialize gr.top_block.__init__(self) diff --git a/gr-wxgui/src/python/common.py b/gr-wxgui/src/python/common.py index 1410d29dfa..57fc530f88 100644 --- a/gr-wxgui/src/python/common.py +++ b/gr-wxgui/src/python/common.py @@ -64,8 +64,12 @@ class wxgui_hb(object): """ Create a function that will cache the visibility flag, and only call the handler when that flag changes. - @param handler the function to call on a change - @return a function of 1 argument + + Args: + handler: the function to call on a change + + Returns: + a function of 1 argument """ cache = [None] def callback(visible): @@ -84,8 +88,10 @@ class wxgui_hb(object): Bind a handler to a window when its visibility changes. Specifically, call the handler when the window visibility changes. This condition is checked on every update ui event. - @param win the wx window - @param handler a function of 1 param + + Args: + win: the wx window + handler: a function of 1 param """ #is the window visible in the hierarchy def is_wx_window_visible(my_win): @@ -126,8 +132,10 @@ def _register_access_method(destination, controller, key): def register_access_methods(destination, controller): """ Register setter and getter functions in the destination object for all keys in the controller. - @param destination the object to get new setter and getter methods - @param controller the pubsub controller + + Args: + destination: the object to get new setter and getter methods + controller: the pubsub controller """ for key in controller.keys(): _register_access_method(destination, controller, key) @@ -164,8 +172,12 @@ import math def get_exp(num): """ Get the exponent of the number in base 10. - @param num the floating point number - @return the exponent as an integer + + Args: + num: the floating point number + + Returns: + the exponent as an integer """ if num == 0: return 0 return int(math.floor(math.log10(abs(num)))) @@ -173,8 +185,12 @@ def get_exp(num): def get_clean_num(num): """ Get the closest clean number match to num with bases 1, 2, 5. - @param num the number - @return the closest number + + Args: + num: the number + + Returns: + the closest number """ if num == 0: return 0 sign = num > 0 and 1 or -1 @@ -185,8 +201,12 @@ def get_clean_num(num): def get_clean_incr(num): """ Get the next higher clean number with bases 1, 2, 5. - @param num the number - @return the next higher number + + Args: + num: the number + + Returns: + the next higher number """ num = get_clean_num(num) exp = get_exp(num) @@ -203,8 +223,12 @@ def get_clean_incr(num): def get_clean_decr(num): """ Get the next lower clean number with bases 1, 2, 5. - @param num the number - @return the next lower number + + Args: + num: the number + + Returns: + the next lower number """ num = get_clean_num(num) exp = get_exp(num) @@ -221,8 +245,12 @@ def get_clean_decr(num): def get_min_max(samples): """ Get the minimum and maximum bounds for an array of samples. - @param samples the array of real values - @return a tuple of min, max + + Args: + samples: the array of real values + + Returns: + a tuple of min, max """ factor = 2.0 mean = numpy.average(samples) @@ -235,8 +263,12 @@ def get_min_max(samples): def get_min_max_fft(fft_samps): """ Get the minimum and maximum bounds for an array of fft samples. - @param samples the array of real values - @return a tuple of min, max + + Args: + samples: the array of real values + + Returns: + a tuple of min, max """ #get the peak level (max of the samples) peak_level = numpy.max(fft_samps) diff --git a/gr-wxgui/src/python/const_window.py b/gr-wxgui/src/python/const_window.py index 2ad89b2a38..1295aff1fa 100644 --- a/gr-wxgui/src/python/const_window.py +++ b/gr-wxgui/src/python/const_window.py @@ -60,7 +60,9 @@ class control_panel(wx.Panel): def __init__(self, parent): """ Create a new control panel. - @param parent the wx parent window + + Args: + parent: the wx parent window """ self.parent = parent wx.Panel.__init__(self, parent, style=wx.SUNKEN_BORDER) @@ -174,7 +176,9 @@ class const_window(wx.Panel, pubsub.pubsub): def handle_msg(self, msg): """ Plot the samples onto the complex grid. - @param msg the array of complex samples + + Args: + msg: the array of complex samples """ if not self[RUNNING_KEY]: return #convert to complex floating point numbers diff --git a/gr-wxgui/src/python/fft_window.py b/gr-wxgui/src/python/fft_window.py index fac83a4a34..ada926c418 100644 --- a/gr-wxgui/src/python/fft_window.py +++ b/gr-wxgui/src/python/fft_window.py @@ -61,7 +61,9 @@ class control_panel(wx.Panel): def __init__(self, parent): """ Create a new control panel. - @param parent the wx parent window + + Args: + parent: the wx parent window """ self.parent = parent wx.Panel.__init__(self, parent, style=wx.SUNKEN_BORDER) @@ -324,7 +326,9 @@ class fft_window(wx.Panel, pubsub.pubsub): If real, keep take only the positive bins. Plot the samples onto the grid as channel 1. If peak hold is enabled, plot peak vals as channel 2. - @param msg the fft array as a character array + + Args: + msg: the fft array as a character array """ if not self[RUNNING_KEY]: return #convert to floating point numbers diff --git a/gr-wxgui/src/python/forms/__init__.py b/gr-wxgui/src/python/forms/__init__.py index 3068b18fe1..67d3b4a88a 100644 --- a/gr-wxgui/src/python/forms/__init__.py +++ b/gr-wxgui/src/python/forms/__init__.py @@ -48,13 +48,15 @@ import wx class static_box_sizer(wx.StaticBoxSizer): """ A box sizer with label and border. - @param parent the parent widget - @param sizer add this widget to sizer if provided (optional) - @param proportion the proportion when added to the sizer (default=0) - @param flag the flag argument when added to the sizer (default=wx.EXPAND) - @param label title label for this widget (optional) - @param bold true to boldify the label - @param orient the sizer orientation wx.VERTICAL or wx.HORIZONTAL (default=wx.VERTICAL) + + Args: + parent: the parent widget + sizer: add this widget to sizer if provided (optional) + proportion: the proportion when added to the sizer (default=0) + flag: the flag argument when added to the sizer (default=wx.EXPAND) + label: title label for this widget (optional) + bold: true to boldify the label + orient: the sizer orientation wx.VERTICAL or wx.HORIZONTAL (default=wx.VERTICAL) """ def __init__(self, parent, label='', bold=False, sizer=None, orient=wx.VERTICAL, proportion=0, flag=wx.EXPAND): box = wx.StaticBox(parent=parent, label=label) @@ -65,20 +67,17 @@ class static_box_sizer(wx.StaticBoxSizer): class incr_decr_buttons(wx.BoxSizer): """ A horizontal box sizer with a increment and a decrement button. - @param parent the parent widget - @param sizer add this widget to sizer if provided (optional) - @param proportion the proportion when added to the sizer (default=0) - @param flag the flag argument when added to the sizer (default=wx.EXPAND) - @param label title label for this widget (optional) - @param on_incr the callback for pressing the + button - @param on_decr the callback for pressing the - button + + Args: + parent: the parent widget + on_incr: the callback for pressing the + button + on_decr: the callback for pressing the - button + label: title label for this widget (optional) + sizer: add this widget to sizer if provided (optional) + proportion: the proportion when added to the sizer (default=0) + flag: the flag argument when added to the sizer (default=wx.EXPAND) """ def __init__(self, parent, on_incr, on_decr, label='', sizer=None, proportion=0, flag=wx.EXPAND): - """ - @param parent the parent window - @param on_incr the event handler for increment - @param on_decr the event handler for decrement - """ wx.BoxSizer.__init__(self, wx.HORIZONTAL) buttons_box = wx.BoxSizer(wx.HORIZONTAL) self._incr_button = wx.Button(parent, label='+', style=wx.BU_EXACTFIT) diff --git a/gr-wxgui/src/python/forms/forms.py b/gr-wxgui/src/python/forms/forms.py index f1d0038abd..6eee31585e 100644 --- a/gr-wxgui/src/python/forms/forms.py +++ b/gr-wxgui/src/python/forms/forms.py @@ -90,11 +90,13 @@ class _form_base(pubsub, wx.BoxSizer): Bind the update handler to the widget for data events. This ensures that the gui thread handles updating widgets. Setup the pusub triggers for external and internal. - @param widget the main widget - @param label the optional label - @param flag additional flags for widget - @param label_prop the proportion for the label - @param widget_prop the proportion for the widget + + Args: + widget: the main widget + label: the optional label + flag: additional flags for widget + label_prop: the proportion for the label + widget_prop: the proportion for the widget """ #setup data event widget.Bind(EVT_DATA, lambda x: self._update(x.data)) @@ -184,18 +186,20 @@ class _slider_base(_form_base): class static_text(_form_base): """ A text box form. - @param parent the parent widget - @param sizer add this widget to sizer if provided (optional) - @param proportion the proportion when added to the sizer (default=0) - @param flag the flag argument when added to the sizer (default=wx.EXPAND) - @param ps the pubsub object (optional) - @param key the pubsub key (optional) - @param value the default value (optional) - @param label title label for this widget (optional) - @param width the width of the form in px - @param bold true to bold-ify the text (default=False) - @param units a suffix to add after the text - @param converter forms.str_converter(), int_converter(), float_converter()... + + Args: + parent: the parent widget + sizer: add this widget to sizer if provided (optional) + proportion: the proportion when added to the sizer (default=0) + flag: the flag argument when added to the sizer (default=wx.EXPAND) + ps: the pubsub object (optional) + key: the pubsub key (optional) + value: the default value (optional) + label: title label for this widget (optional) + width: the width of the form in px + bold: true to bold-ify the text (default=False) + units: a suffix to add after the text + converter: forms.str_converter(), int_converter(), float_converter()... """ def __init__(self, label='', width=-1, bold=False, units='', converter=converters.str_converter(), **kwargs): self._units = units @@ -214,16 +218,18 @@ class static_text(_form_base): class text_box(_form_base): """ A text box form. - @param parent the parent widget - @param sizer add this widget to sizer if provided (optional) - @param proportion the proportion when added to the sizer (default=0) - @param flag the flag argument when added to the sizer (default=wx.EXPAND) - @param ps the pubsub object (optional) - @param key the pubsub key (optional) - @param value the default value (optional) - @param label title label for this widget (optional) - @param width the width of the form in px - @param converter forms.str_converter(), int_converter(), float_converter()... + + Args: + parent: the parent widget + sizer: add this widget to sizer if provided (optional) + proportion: the proportion when added to the sizer (default=0) + flag: the flag argument when added to the sizer (default=wx.EXPAND) + ps: the pubsub object (optional) + key: the pubsub key (optional) + value: the default value (optional) + label: title label for this widget (optional) + width: the width of the form in px + converter: forms.str_converter(), int_converter(), float_converter()... """ def __init__(self, label='', width=-1, converter=converters.eval_converter(), **kwargs): _form_base.__init__(self, converter=converter, **kwargs) @@ -249,21 +255,23 @@ class text_box(_form_base): class slider(_slider_base): """ A generic linear slider. - @param parent the parent widget - @param sizer add this widget to sizer if provided (optional) - @param proportion the proportion when added to the sizer (default=0) - @param flag the flag argument when added to the sizer (default=wx.EXPAND) - @param ps the pubsub object (optional) - @param key the pubsub key (optional) - @param value the default value (optional) - @param label title label for this widget (optional) - @param length the length of the slider in px (optional) - @param style wx.SL_HORIZONTAL or wx.SL_VERTICAL (default=horizontal) - @param minimum the minimum value - @param maximum the maximum value - @param num_steps the number of slider steps (or specify step_size) - @param step_size the step between slider jumps (or specify num_steps) - @param cast a cast function, int, or float (default=float) + + Args: + parent: the parent widget + sizer: add this widget to sizer if provided (optional) + proportion: the proportion when added to the sizer (default=0) + flag: the flag argument when added to the sizer (default=wx.EXPAND) + ps: the pubsub object (optional) + key: the pubsub key (optional) + value: the default value (optional) + label: title label for this widget (optional) + length: the length of the slider in px (optional) + style: wx.SL_HORIZONTAL or wx.SL_VERTICAL (default=horizontal) + minimum: the minimum value + maximum: the maximum value + num_steps: the number of slider steps (or specify step_size) + step_size: the step between slider jumps (or specify num_steps) + cast: a cast function, int, or float (default=float) """ def __init__(self, minimum=-100, maximum=100, num_steps=100, step_size=None, cast=float, **kwargs): assert step_size or num_steps @@ -275,21 +283,23 @@ class log_slider(_slider_base): """ A generic logarithmic slider. The sliders min and max values are base**min_exp and base**max_exp. - @param parent the parent widget - @param sizer add this widget to sizer if provided (optional) - @param proportion the proportion when added to the sizer (default=0) - @param flag the flag argument when added to the sizer (default=wx.EXPAND) - @param ps the pubsub object (optional) - @param key the pubsub key (optional) - @param value the default value (optional) - @param label title label for this widget (optional) - @param length the length of the slider in px (optional) - @param style wx.SL_HORIZONTAL or wx.SL_VERTICAL (default=horizontal) - @param min_exp the minimum exponent - @param max_exp the maximum exponent - @param base the exponent base in base**exp - @param num_steps the number of slider steps (or specify step_size) - @param step_size the exponent step size (or specify num_steps) + + Args: + parent: the parent widget + sizer: add this widget to sizer if provided (optional) + proportion: the proportion when added to the sizer (default=0) + flag: the flag argument when added to the sizer (default=wx.EXPAND) + ps: the pubsub object (optional) + key: the pubsub key (optional) + value: the default value (optional) + label: title label for this widget (optional) + length: the length of the slider in px (optional) + style: wx.SL_HORIZONTAL or wx.SL_VERTICAL (default=horizontal) + min_exp: the minimum exponent + max_exp: the maximum exponent + base: the exponent base in base**exp + num_steps: the number of slider steps (or specify step_size) + step_size: the exponent step size (or specify num_steps) """ def __init__(self, min_exp=0, max_exp=1, base=10, num_steps=100, step_size=None, **kwargs): assert step_size or num_steps @@ -304,20 +314,22 @@ class gauge(_form_base): """ A gauge bar. The gauge displays floating point values between the minimum and maximum. - @param parent the parent widget - @param sizer add this widget to sizer if provided (optional) - @param proportion the proportion when added to the sizer (default=0) - @param flag the flag argument when added to the sizer (default=wx.EXPAND) - @param ps the pubsub object (optional) - @param key the pubsub key (optional) - @param value the default value (optional) - @param label title label for this widget (optional) - @param length the length of the slider in px (optional) - @param style wx.GA_HORIZONTAL or wx.GA_VERTICAL (default=horizontal) - @param minimum the minimum value - @param maximum the maximum value - @param num_steps the number of slider steps (or specify step_size) - @param step_size the step between slider jumps (or specify num_steps) + + Args: + parent: the parent widget + sizer: add this widget to sizer if provided (optional) + proportion: the proportion when added to the sizer (default=0) + flag: the flag argument when added to the sizer (default=wx.EXPAND) + ps: the pubsub object (optional) + key: the pubsub key (optional) + value: the default value (optional) + label: title label for this widget (optional) + length: the length of the slider in px (optional) + style: wx.GA_HORIZONTAL or wx.GA_VERTICAL (default=horizontal) + minimum: the minimum value + maximum: the maximum value + num_steps: the number of slider steps (or specify step_size) + step_size: the step between slider jumps (or specify num_steps) """ def __init__(self, label='', length=-1, minimum=-100, maximum=100, num_steps=100, step_size=None, style=wx.GA_HORIZONTAL, **kwargs): assert step_size or num_steps @@ -338,16 +350,18 @@ class gauge(_form_base): class check_box(_form_base): """ Create a check box form. - @param parent the parent widget - @param sizer add this widget to sizer if provided (optional) - @param proportion the proportion when added to the sizer (default=0) - @param flag the flag argument when added to the sizer (default=wx.EXPAND) - @param ps the pubsub object (optional) - @param key the pubsub key (optional) - @param value the default value (optional) - @param true the value for form when checked (default=True) - @param false the value for form when unchecked (default=False) - @param label title label for this widget (optional) + + Args: + parent: the parent widget + sizer: add this widget to sizer if provided (optional) + proportion: the proportion when added to the sizer (default=0) + flag: the flag argument when added to the sizer (default=wx.EXPAND) + ps: the pubsub object (optional) + key: the pubsub key (optional) + value: the default value (optional) + true: the value for form when checked (default=True) + false: the value for form when unchecked (default=False) + label: title label for this widget (optional) """ def __init__(self, label='', true=True, false=False, **kwargs): _form_base.__init__(self, converter=converters.bool_converter(true=true, false=false), **kwargs) @@ -364,17 +378,19 @@ class check_box(_form_base): class drop_down(_chooser_base): """ Create a drop down menu form. - @param parent the parent widget - @param sizer add this widget to sizer if provided (optional) - @param proportion the proportion when added to the sizer (default=0) - @param flag the flag argument when added to the sizer (default=wx.EXPAND) - @param ps the pubsub object (optional) - @param key the pubsub key (optional) - @param value the default value (optional) - @param choices list of possible values - @param labels list of labels for each choice (default=choices) - @param label title label for this widget (optional) - @param width the form width in px (optional) + + Args: + parent: the parent widget + sizer: add this widget to sizer if provided (optional) + proportion: the proportion when added to the sizer (default=0) + flag: the flag argument when added to the sizer (default=wx.EXPAND) + ps: the pubsub object (optional) + key: the pubsub key (optional) + value: the default value (optional) + choices: list of possible values + labels: list of labels for each choice (default=choices) + label: title label for this widget (optional) + width: the form width in px (optional) """ def __init__(self, label='', width=-1, **kwargs): _chooser_base.__init__(self, **kwargs) @@ -394,18 +410,18 @@ class drop_down(_chooser_base): class button(_chooser_base): """ Create a multi-state button. - @param parent the parent widget - @param sizer add this widget to sizer if provided (optional) - @param proportion the proportion when added to the sizer (default=0) - @param flag the flag argument when added to the sizer (default=wx.EXPAND) - @param ps the pubsub object (optional) - @param key the pubsub key (optional) - @param value the default value (optional) - @param choices list of possible values - @param labels list of labels for each choice (default=choices) - @param width the width of the button in pixels (optional) - @param style style arguments (optional) - @param label title label for this widget (optional) + parent the parent widget + sizer add this widget to sizer if provided (optional) + proportion the proportion when added to the sizer (default=0) + flag the flag argument when added to the sizer (default=wx.EXPAND) + ps the pubsub object (optional) + key the pubsub key (optional) + value the default value (optional) + choices list of possible values + labels list of labels for each choice (default=choices) + width the width of the button in pixels (optional) + style style arguments (optional) + label title label for this widget (optional) """ def __init__(self, label='', style=0, width=-1, **kwargs): _chooser_base.__init__(self, **kwargs) @@ -420,17 +436,19 @@ class toggle_button(button): """ Create a dual-state button. This button will alternate between True and False when clicked. - @param parent the parent widget - @param sizer add this widget to sizer if provided (optional) - @param proportion the proportion when added to the sizer (default=0) - @param flag the flag argument when added to the sizer (default=wx.EXPAND) - @param ps the pubsub object (optional) - @param key the pubsub key (optional) - @param value the default value (optional) - @param width the width of the button in pixels (optional) - @param style style arguments (optional) - @param true_label the button's label in the true state - @param false_label the button's label in the false state + + Args: + parent: the parent widget + sizer: add this widget to sizer if provided (optional) + proportion: the proportion when added to the sizer (default=0) + flag: the flag argument when added to the sizer (default=wx.EXPAND) + ps: the pubsub object (optional) + key: the pubsub key (optional) + value: the default value (optional) + width: the width of the button in pixels (optional) + style: style arguments (optional) + true_label: the button's label in the true state + false_label: the button's label in the false state """ def __init__(self, true_label='On (click to stop)', false_label='Off (click to start)', **kwargs): button.__init__(self, choices=[True, False], labels=[true_label, false_label], **kwargs) @@ -440,16 +458,18 @@ class single_button(toggle_button): Create a single state button. This button will callback() when clicked. For use when state holding is not important. - @param parent the parent widget - @param sizer add this widget to sizer if provided (optional) - @param proportion the proportion when added to the sizer (default=0) - @param flag the flag argument when added to the sizer (default=wx.EXPAND) - @param ps the pubsub object (optional) - @param key the pubsub key (optional) - @param value the default value (optional) - @param width the width of the button in pixels (optional) - @param style style arguments (optional) - @param label the button's label + + Args: + parent: the parent widget + sizer: add this widget to sizer if provided (optional) + proportion: the proportion when added to the sizer (default=0) + flag: the flag argument when added to the sizer (default=wx.EXPAND) + ps: the pubsub object (optional) + key: the pubsub key (optional) + value: the default value (optional) + width: the width of the button in pixels (optional) + style: style arguments (optional) + label: the button's label """ def __init__(self, label='click for callback', **kwargs): toggle_button.__init__(self, true_label=label, false_label=label, value=True, **kwargs) @@ -460,18 +480,20 @@ class single_button(toggle_button): class radio_buttons(_chooser_base): """ Create a radio button form. - @param parent the parent widget - @param sizer add this widget to sizer if provided (optional) - @param proportion the proportion when added to the sizer (default=0) - @param flag the flag argument when added to the sizer (default=wx.EXPAND) - @param ps the pubsub object (optional) - @param key the pubsub key (optional) - @param value the default value (optional) - @param choices list of possible values - @param labels list of labels for each choice (default=choices) - @param major_dimension the number of rows/cols (default=auto) - @param label title label for this widget (optional) - @param style useful style args: wx.RA_HORIZONTAL, wx.RA_VERTICAL, wx.NO_BORDER (default=wx.RA_HORIZONTAL) + + Args: + parent: the parent widget + sizer: add this widget to sizer if provided (optional) + proportion: the proportion when added to the sizer (default=0) + flag: the flag argument when added to the sizer (default=wx.EXPAND) + ps: the pubsub object (optional) + key: the pubsub key (optional) + value the default value (optional) + choices: list of possible values + labels: list of labels for each choice (default=choices) + major_dimension: the number of rows/cols (default=auto) + label: title label for this widget (optional) + style: useful style args: wx.RA_HORIZONTAL, wx.RA_VERTICAL, wx.NO_BORDER (default=wx.RA_HORIZONTAL) """ def __init__(self, style=wx.RA_HORIZONTAL, label='', major_dimension=0, **kwargs): _chooser_base.__init__(self, **kwargs) diff --git a/gr-wxgui/src/python/histo_window.py b/gr-wxgui/src/python/histo_window.py index a1b520f9c1..3e38fdcb64 100644 --- a/gr-wxgui/src/python/histo_window.py +++ b/gr-wxgui/src/python/histo_window.py @@ -48,7 +48,9 @@ class control_panel(wx.Panel): def __init__(self, parent): """ Create a new control panel. - @param parent the wx parent window + + Args: + parent: the wx parent window """ self.parent = parent wx.Panel.__init__(self, parent, style=wx.SUNKEN_BORDER) @@ -134,7 +136,9 @@ class histo_window(wx.Panel, pubsub.pubsub): def handle_msg(self, msg): """ Handle the message from the fft sink message queue. - @param msg the frame as a character array + + Args: + msg: the frame as a character array """ if not self[RUNNING_KEY]: return #convert to floating point numbers diff --git a/gr-wxgui/src/python/number_window.py b/gr-wxgui/src/python/number_window.py index ab9d1ebc00..751047db94 100644 --- a/gr-wxgui/src/python/number_window.py +++ b/gr-wxgui/src/python/number_window.py @@ -54,7 +54,9 @@ class control_panel(wx.Panel): def __init__(self, parent): """ Create a new control panel. - @param parent the wx parent window + + Args: + parent: the wx parent window """ self.parent = parent wx.Panel.__init__(self, parent) @@ -176,7 +178,9 @@ class number_window(wx.Panel, pubsub.pubsub): """ Show or hide the gauges. If this is real, never show the imaginary gauge. - @param show_gauge true to show + + Args: + show_gauge: true to show """ self.gauge_real.ShowItems(show_gauge) self.gauge_imag.ShowItems(show_gauge and not self.real) @@ -187,7 +191,9 @@ class number_window(wx.Panel, pubsub.pubsub): Convert the string based message into a float or complex. If more than one number was read, only take the last number. Perform peak hold operations, set the gauges and display. - @param event event.data is the number sample as a character array + + Args: + event: event.data is the number sample as a character array """ if not self[RUNNING_KEY]: return format_string = "%%.%df"%self.decimal_places diff --git a/gr-wxgui/src/python/plotter/bar_plotter.py b/gr-wxgui/src/python/plotter/bar_plotter.py index 3f9259e9df..487db66b64 100644 --- a/gr-wxgui/src/python/plotter/bar_plotter.py +++ b/gr-wxgui/src/python/plotter/bar_plotter.py @@ -108,9 +108,13 @@ class bar_plotter(grid_plotter_base): Get the text the will populate the point label. Give X and Y values for the current point. Give values for the channel at the X coordinate. - @param x_val the current x value - @param y_val the current y value - @return a string with newlines + + Args: + x_val: the current x value + y_val: the current y value + + Returns: + a string with newlines """ if len(self._bars) == 0: return '' scalar = float(len(self._bars)-1)/(self.x_max - self.x_min) @@ -130,9 +134,11 @@ class bar_plotter(grid_plotter_base): def set_bars(self, bars, bar_width, color_spec): """ Set the bars. - @param bars a list of bars - @param bar_width the fractional width of the bar, between 0 and 1 - @param color_spec the color tuple + + Args: + bars: a list of bars + bar_width: the fractional width of the bar, between 0 and 1 + color_spec: the color tuple """ self.lock() self._bars = bars diff --git a/gr-wxgui/src/python/plotter/channel_plotter.py b/gr-wxgui/src/python/plotter/channel_plotter.py index 4bcc36fd4c..1eac9f5f3a 100644 --- a/gr-wxgui/src/python/plotter/channel_plotter.py +++ b/gr-wxgui/src/python/plotter/channel_plotter.py @@ -67,8 +67,12 @@ class channel_plotter(grid_plotter_base): def enable_legend(self, enable=None): """ Enable/disable the legend. - @param enable true to enable - @return the enable state when None + + Args: + enable: true to enable + + Returns: + the enable state when None """ if enable is None: return self._enable_legend self.lock() @@ -128,9 +132,13 @@ class channel_plotter(grid_plotter_base): Get the text the will populate the point label. Give X and Y values for the current point. Give values for the channel at the X coordinate. - @param x_val the current x value - @param y_val the current y value - @return a string with newlines + + Args: + x_val: the current x value + y_val: the current y value + + Returns: + a string with newlines """ #create text label_str = '%s: %s\n%s: %s'%( @@ -186,7 +194,9 @@ class channel_plotter(grid_plotter_base): def clear_waveform(self, channel): """ Remove a waveform from the list of waveforms. - @param channel the channel key + + Args: + channel: the channel key """ self.lock() if channel in self._channels.keys(): @@ -198,11 +208,13 @@ class channel_plotter(grid_plotter_base): def set_waveform(self, channel, samples=[], color_spec=(0, 0, 0), marker=None, trig_off=0): """ Set the waveform for a given channel. - @param channel the channel key - @param samples the waveform samples - @param color_spec the 3-tuple for line color - @param marker None for line - @param trig_off fraction of sample for trigger offset + + Args: + channel: the channel key + samples: the waveform samples + color_spec: the 3-tuple for line color + marker: None for line + trig_off: fraction of sample for trigger offset """ self.lock() if channel not in self._channels.keys(): self._legend_cache.changed(True) diff --git a/gr-wxgui/src/python/plotter/common.py b/gr-wxgui/src/python/plotter/common.py index 88215e039a..9af636245d 100644 --- a/gr-wxgui/src/python/plotter/common.py +++ b/gr-wxgui/src/python/plotter/common.py @@ -30,8 +30,12 @@ import wx def get_exp(num): """ Get the exponent of the number in base 10. - @param num the floating point number - @return the exponent as an integer + + Args: + num: the floating point number + + Returns: + the exponent as an integer """ if num == 0: return 0 return int(math.floor(math.log10(abs(num)))) @@ -41,8 +45,12 @@ def get_si_components(num): Get the SI units for the number. Extract the coeff and exponent of the number. The exponent will be a multiple of 3. - @param num the floating point number - @return the tuple coeff, exp, prefix + + Args: + num: the floating point number + + Returns: + the tuple coeff, exp, prefix """ num = float(num) exp = get_exp(num) @@ -65,8 +73,12 @@ def get_si_components(num): def sci_format(num): """ Format a floating point number into scientific notation. - @param num the number to format - @return a label string + + Args: + num: the number to format + + Returns: + a label string """ coeff, exp, prefix = get_si_components(num) if -3 <= exp < 3: return '%g'%num @@ -75,9 +87,13 @@ def sci_format(num): def eng_format(num, units=''): """ Format a floating point number into engineering notation. - @param num the number to format - @param units the units to append - @return a label string + + Args: + num: the number to format + units: the units to append + + Returns: + a label string """ coeff, exp, prefix = get_si_components(num) if -3 <= exp < 3: return '%g'%num diff --git a/gr-wxgui/src/python/plotter/grid_plotter_base.py b/gr-wxgui/src/python/plotter/grid_plotter_base.py index f1bc8f546d..a492539575 100644 --- a/gr-wxgui/src/python/plotter/grid_plotter_base.py +++ b/gr-wxgui/src/python/plotter/grid_plotter_base.py @@ -78,7 +78,9 @@ class grid_plotter_base(plotter_base): def set_point_label_coordinate(self, coor): """ Set the point label coordinate. - @param coor the coordinate x, y tuple or None + + Args: + coor: the coordinate x, y tuple or None """ self.lock() self._point_label_coordinate = coor @@ -103,8 +105,12 @@ class grid_plotter_base(plotter_base): Enable/disable the grid aspect ratio. If enabled, enforce the aspect ratio on the padding: horizontal_padding:vertical_padding == width:height - @param enable true to enable - @return the enable state when None + + Args: + enable: true to enable + + Returns: + the enable state when None """ if enable is None: return self._enable_grid_aspect_ratio self.lock() @@ -115,8 +121,12 @@ class grid_plotter_base(plotter_base): def enable_point_label(self, enable=None): """ Enable/disable the point label. - @param enable true to enable - @return the enable state when None + + Args: + enable: true to enable + + Returns: + the enable state when None """ if enable is None: return self._enable_point_label self.lock() @@ -127,7 +137,9 @@ class grid_plotter_base(plotter_base): def set_title(self, title): """ Set the title. - @param title the title string + + Args: + title the title string """ self.lock() self.title = title @@ -137,8 +149,10 @@ class grid_plotter_base(plotter_base): def set_x_label(self, x_label, x_units=''): """ Set the x label and units. - @param x_label the x label string - @param x_units the x units string + + Args: + x_label: the x label string + x_units: the x units string """ self.lock() self.x_label = x_label @@ -149,8 +163,10 @@ class grid_plotter_base(plotter_base): def set_y_label(self, y_label, y_units=''): """ Set the y label and units. - @param y_label the y label string - @param y_units the y units string + + Args: + y_label: the y label string + y_units: the y units string """ self.lock() self.y_label = y_label @@ -161,10 +177,12 @@ class grid_plotter_base(plotter_base): def set_x_grid(self, minimum, maximum, step, scale=False): """ Set the x grid parameters. - @param minimum the left-most value - @param maximum the right-most value - @param step the grid spacing - @param scale true to scale the x grid + + Args: + minimum: the left-most value + maximum: the right-most value + step: the grid spacing + scale: true to scale the x grid """ self.lock() self.x_min = float(minimum) @@ -183,10 +201,12 @@ class grid_plotter_base(plotter_base): def set_y_grid(self, minimum, maximum, step, scale=False): """ Set the y grid parameters. - @param minimum the bottom-most value - @param maximum the top-most value - @param step the grid spacing - @param scale true to scale the y grid + + Args: + minimum: the bottom-most value + maximum: the top-most value + step: the grid spacing + scale: true to scale the y grid """ self.lock() self.y_min = float(minimum) @@ -305,9 +325,13 @@ class grid_plotter_base(plotter_base): def _get_tick_label(self, tick, unit): """ Format the tick value and create a gl text. - @param tick the floating point tick value - @param unit the axis unit - @return the tick label text + + Args: + tick: the floating point tick value + unit: the axis unit + + Returns: + the tick label text """ if unit: tick_str = common.sci_format(tick) else: tick_str = common.eng_format(tick) @@ -316,11 +340,15 @@ class grid_plotter_base(plotter_base): def _get_ticks(self, min, max, step, scalar): """ Determine the positions for the ticks. - @param min the lower bound - @param max the upper bound - @param step the grid spacing - @param scalar the grid scaling - @return a list of tick positions between min and max + + Args: + min: the lower bound + max: the upper bound + step: the grid spacing + scalar: the grid scaling + + Returns: + a list of tick positions between min and max """ #cast to float min = float(min) @@ -340,8 +368,12 @@ class grid_plotter_base(plotter_base): def enable_grid_lines(self, enable=None): """ Enable/disable the grid lines. - @param enable true to enable - @return the enable state when None + + Args: + enable: true to enable + + Returns: + the enable state when None """ if enable is None: return self._enable_grid_lines self.lock() @@ -352,8 +384,10 @@ class grid_plotter_base(plotter_base): def _draw_grid_line(self, coor1, coor2): """ Draw a dashed line from coor1 to coor2. - @param corr1 a tuple of x, y - @param corr2 a tuple of x, y + + Args: + corr1: a tuple of x, y + corr2: a tuple of x, y """ if not self.enable_grid_lines(): return length = math.sqrt((coor1[0] - coor2[0])**2 + (coor1[1] - coor2[1])**2) @@ -372,11 +406,13 @@ class grid_plotter_base(plotter_base): """ Draw a rectangle on the x, y plane. X and Y are the top-left corner. - @param x the left position of the rectangle - @param y the top position of the rectangle - @param width the width of the rectangle - @param height the height of the rectangle - @param fill true to color inside of rectangle + + Args: + x: the left position of the rectangle + y: the top position of the rectangle + width: the width of the rectangle + height: the height of the rectangle + fill: true to color inside of rectangle """ GL.glBegin(fill and GL.GL_QUADS or GL.GL_LINE_LOOP) GL.glVertex2f(x, y) diff --git a/gr-wxgui/src/python/plotter/plotter_base.py b/gr-wxgui/src/python/plotter/plotter_base.py index 2fdd0f20ab..3ad1e81582 100644 --- a/gr-wxgui/src/python/plotter/plotter_base.py +++ b/gr-wxgui/src/python/plotter/plotter_base.py @@ -37,7 +37,9 @@ class gl_cache(object): def __init__(self, draw): """ Create a new cache. - @param draw a function to draw gl stuff + + Args: + draw: a function to draw gl stuff """ self.changed(True) self._draw = draw @@ -84,7 +86,9 @@ class plotter_base(wx.glcanvas.GLCanvas, common.mutex): Initialize the GLCanvas with double buffering. Initialize various plotter flags. Bind the paint and size events. - @param parent the parent widgit + + Args: + parent: the parent widgit """ attribList = (wx.glcanvas.WX_GL_DOUBLEBUFFER, wx.glcanvas.WX_GL_RGBA) wx.glcanvas.GLCanvas.__init__(self, parent, attribList=attribList); @@ -111,7 +115,9 @@ class plotter_base(wx.glcanvas.GLCanvas, common.mutex): """ Create a new gl cache. Register its draw and init function. - @return the new cache object + + Returns: + the new cache object """ cache = gl_cache(draw_fcn) self.register_init(cache.init) diff --git a/gr-wxgui/src/python/plotter/waterfall_plotter.py b/gr-wxgui/src/python/plotter/waterfall_plotter.py index 6a6bf6330e..02ec67ee4c 100644 --- a/gr-wxgui/src/python/plotter/waterfall_plotter.py +++ b/gr-wxgui/src/python/plotter/waterfall_plotter.py @@ -49,8 +49,12 @@ def _get_rbga(red_pts, green_pts, blue_pts, alpha_pts=[(0, 0), (1, 0)]): The x and y values of the coordinates range from 0 to 1. The coordinates must be specified so that x increases with the index value. Resulting values are calculated along the line formed between 2 coordinates. - @param *_pts an array of x,y coordinates for each color element - @return array of rbga values (4 bytes) each + + Args: + red_pts, green_pts, blue_pts, alpha_pts: an array of x,y coordinates for each color element + + Returns: + array of rbga values (4 bytes) each """ def _fcn(x, pw): for (x1, y1), (x2, y2) in zip(pw, pw[1:]): @@ -167,9 +171,13 @@ class waterfall_plotter(grid_plotter_base): """ Get the text the will populate the point label. Give the X value for the current point. - @param x_val the current x value - @param y_val the current y value - @return a value string with units + + Args: + x_val: the current x value + y_val: the current y value + + Returns: + a value string with units """ return '%s: %s'%(self.x_label, common.eng_format(x_val, self.x_units)) @@ -210,7 +218,9 @@ class waterfall_plotter(grid_plotter_base): def _resize_texture(self, flag=None): """ Create the texture to fit the fft_size X num_lines. - @param flag the set/unset or update flag + + Args: + flag: the set/unset or update flag """ if flag is not None: self._resize_texture_flag = flag @@ -229,7 +239,9 @@ class waterfall_plotter(grid_plotter_base): Set the color mode. New samples will be converted to the new color mode. Old samples will not be recolorized. - @param color_mode the new color mode string + + Args: + color_mode: the new color mode string """ self.lock() if color_mode in COLORS.keys(): @@ -242,7 +254,9 @@ class waterfall_plotter(grid_plotter_base): """ Set number of lines. Powers of two only. - @param num_lines the new number of lines + + Args: + num_lines: the new number of lines """ self.lock() self._num_lines = num_lines @@ -254,9 +268,11 @@ class waterfall_plotter(grid_plotter_base): """ Set the samples to the waterfall. Convert the samples to color data. - @param samples the array of floats - @param minimum the minimum value to scale - @param maximum the maximum value to scale + + Args: + samples: the array of floats + minimum: the minimum value to scale + maximum: the maximum value to scale """ self.lock() #set the min, max values diff --git a/gr-wxgui/src/python/scope_window.py b/gr-wxgui/src/python/scope_window.py index dc90a60459..306e1757f1 100644 --- a/gr-wxgui/src/python/scope_window.py +++ b/gr-wxgui/src/python/scope_window.py @@ -84,7 +84,9 @@ class control_panel(wx.Panel): def __init__(self, parent): """ Create a new control panel. - @param parent the wx parent window + + Args: + parent: the wx parent window """ WIDTH = 90 self.parent = parent @@ -526,7 +528,9 @@ class scope_window(wx.Panel, pubsub.pubsub): Handle the message from the scope sink message queue. Plot the list of arrays of samples onto the grid. Each samples array gets its own channel. - @param msg the time domain data as a character array + + Args: + msg: the time domain data as a character array """ if not self[RUNNING_KEY]: return #check time elapsed diff --git a/gr-wxgui/src/python/slider.py b/gr-wxgui/src/python/slider.py index e8cdcfcaca..7194de47c2 100644 --- a/gr-wxgui/src/python/slider.py +++ b/gr-wxgui/src/python/slider.py @@ -6,11 +6,10 @@ def slider(parent, min, max, callback): """ Return a wx.Slider object. - @param min: minimum slider value - @type min: float - @param max: maximum slider value - @type max: float - @param callback: function of one arg invoked when slider moves. + Args: + min: minimum slider value (float) + max: maximum slider value (float) + callback: function of one arg invoked when slider moves. @rtype: wx.Slider """ new_id = wx.NewId() diff --git a/gr-wxgui/src/python/waterfall_window.py b/gr-wxgui/src/python/waterfall_window.py index cd60104d7a..7d401223c2 100644 --- a/gr-wxgui/src/python/waterfall_window.py +++ b/gr-wxgui/src/python/waterfall_window.py @@ -61,7 +61,9 @@ class control_panel(wx.Panel): def __init__(self, parent): """ Create a new control panel. - @param parent the wx parent window + + Args: + parent: the wx parent window """ self.parent = parent wx.Panel.__init__(self, parent, style=wx.SUNKEN_BORDER) @@ -259,7 +261,9 @@ class waterfall_window(wx.Panel, pubsub.pubsub): If complex, reorder the fft samples so the negative bins come first. If real, keep take only the positive bins. Send the data to the plotter. - @param msg the fft array as a character array + + Args: + msg: the fft array as a character array """ if not self[RUNNING_KEY]: return #convert to floating point numbers |