Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

function naming convention #60

Open
agramfort opened this issue May 5, 2011 · 0 comments
Open

function naming convention #60

agramfort opened this issue May 5, 2011 · 0 comments

Comments

@agramfort
Copy link
Contributor

what are the naming convention for functions?

  • is seems weird that get_spectra is the only name that starts with get_*. Why not spectra?
  • functions that returns similar quantities (eg. PSD estimates) should have common name prefix (or maybe suffix).
  • freq_response should make explicit that it works on IR models.
  • I don't like get_spectra_bi as it reminds me of bispectrum estimates which is not.
  • functions that are auxiliary functions (ie should not be used by average user) should start with _ to be explicitly marked as private (eg. it seems in coherence.py that all foo_compute functions are auxiliary functions to foo functions hence should be name rather _foo). The point is that the user should quickly see which function to use.
  • why sometimes mtm_ and sometimes multi_taper_ to refer to multi-taper method?

below the list of functions in spectral.

algorithms/spectral.py:
20 : def get_spectra(time_series, method=None):
144 : def get_spectra_bi(x, y, method=None):
186 : def periodogram(s, Fs=2 * np.pi, Sk=None, N=None, sides='default',
262 : def periodogram_csd(s, Fs=2 * np.pi, Sk=None, NFFT=None, sides='default',
369 : def dpss_windows(N, NW, Kmax):
449 : def mtm_cross_spectrum(tx, ty, weights, sides='twosided'):
557 : def multi_taper_psd(s, Fs=2 * np.pi, BW=None, adaptive=False,
710 : def multi_taper_csd(s, Fs=2 * np.pi, BW=None, low_bias=True,
834 : def freq_response(b, a=1., n_freqs=1024, sides='onesided'):

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant