-
Notifications
You must be signed in to change notification settings - Fork 92
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
Naming convention (binsize -> bin_size, etc.) #316
Naming convention (binsize -> bin_size, etc.) #316
Conversation
Hello @dizcza! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:
Comment last updated at 2020-08-07 11:56:20 UTC |
022c593
to
9bd7c29
Compare
Regarding The parameter in Moreover, in Finally, in the class |
Regarding I don't think they can be analyzed together. The idea of In ASSET, the |
@kohlerca Regarding _x and _y or _1 and _2 in welch_cohere and ASSET. Also in welch_cohere, the order of parameters makes a big differene when interpreting the phase_lag return value, since the order defines the reference and the referenced, so to say. In this way, I think the situation is very similar to ASSET. Now, I think the main reason we dislike 1 and 2 is because it looks terrible in the variable name, and I think we dislike x and y because it is commonly associated to a position. How about a compromise and using |
@mdenker How about a compromise and using I guess this makes total sense and it is better indeed than either of the previous options. |
Added |
* faster mean_firing_rate for a typical use case (NeuralEnsemble#331) * explicit doc of how the firing rate is computed * Timescale function option to return nan if there are few spikes (<=2) (NeuralEnsemble#328) * include option to return np.nan if spiketrains are too short and change raised error to more meaningful ones * Build documentation in Travis (NeuralEnsemble#335) * fixed _check_consistency in BinnedSpikeTrain and parallel.ipynb notebook * added docs build in travis; fixed plt.eventplot(spiketrains) * don't use conda-forge channel for python 2.7 * install extra requirements in docs build * conda install pandoc * travis hangs * travis doc mpi error * travis check if error is occurred * Revert "travis check if error is occurred" This reverts commit 3e59894. * reverted travis * Removed deprecation warnings from 0.7.0 (NeuralEnsemble#306) * removed deprecation warning from unitary event analysis * removed homogeneous_poisson_process_with_refr_period * don't import pandas_bridge * don't use nan * don't pad with zeros * bin_shrink_factor parameter * precompute edges for _binning_half_overlap * deal with spiketrains of length 1 * return trace optionally * ASSET optimized probability_matrix_analytical and looping in _jsf_uniform_orderstat_3d (NeuralEnsemble#333) * removed annoying short-lasting tranges * vectorized probability_matrix_analytical * ASSET iterate indices optimized * replaced np.diff(prepend, append) by manually prepending and appending Co-authored-by: Cristiano Köhler <[email protected]> * Naming convention (binsize -> bin_size, etc.) (NeuralEnsemble#316) * Release v0.8.0 (NeuralEnsemble#340) * all quantities * python2 issues * python2 issues again * Update acknowledgments.rst Added funding acknowledgements from HBP SGA3. * added __all__ in elephant modules (NeuralEnsemble#342) * Added a warning in fanofactor function when the input spiketrains vary in their durations (NeuralEnsemble#341) * fixed wrong default min_bin units * naming * download & unzip API * Feature/inhomogeneous gamma (NeuralEnsemble#339) * Added information on citing Elephant to documentation, fixed bib entries (NeuralEnsemble#345) * Added CITATION.txt file to manifest, so it's included in packages. * Fixed doi entry to not include the doi resolver. * Three surrogate methods: Trial-shifting, Bin Shuffling, ISI dithering (NeuralEnsemble#343) Co-authored-by: stellalessandra <[email protected]> Co-authored-by: p-bouss <[email protected]> Co-authored-by: Cristiano Köhler <[email protected]> * SPADE: New way to count patterns for multiple testing (NeuralEnsemble#347) Co-authored-by: stellalessandra <[email protected]> Co-authored-by: p-bouss <[email protected]> * spike synchrony doc; take the first 5 networks to run the test * renamed test module * group spike train correlation, dissimilarity, and synchrony * tutorials: changed wget to curl for platform compatibility (NeuralEnsemble#350) * Time-domain pairwise Granger causality (NeuralEnsemble#332) Co-authored-by: ackurth <[email protected]> Co-authored-by: ackurth <[email protected]> Co-authored-by: dizcza <[email protected]> Co-authored-by: Michael Denker <[email protected]> Co-authored-by: Aitor MG <[email protected]> Co-authored-by: Cristiano Köhler <[email protected]> Co-authored-by: Michael Denker <[email protected]> Co-authored-by: pbouss <[email protected]> Co-authored-by: stellalessandra <[email protected]> Co-authored-by: p-bouss <[email protected]> Co-authored-by: Cristiano Köhler <[email protected]> Co-authored-by: Regimantas Jurkus <[email protected]> Co-authored-by: ackurth <[email protected]> Co-authored-by: ackurth <[email protected]>
Update Sep 08, 2020
The voting session is closed: any additional votes will be ignored. If you find the current naming convention inconvenient, open an issue or discuss it with us on Neuralensemble mailing list or gitter chat.
IMPORTANT. The old arguments are deprecated but not removed. Even though it looks like they are removed from the code, the old signature will still work - it just throws a warning, which can become a hard error in 2 or 3 releases since then, if we want.
Below is a compiled list, made by elephant doc team with ❤️
Deprecated arguments mapping
Elephant-wise
binsize --> bin_size
num_bins --> n_bins
in all modules except GPFAtransform_info
dict that has the key'num_bins'
; commit 0408896binned_st[s] --> binned_spiketrain
becausebinned_spiketrain
s, asspiketrains
, would imply a list of BinnedSpikeTrain objectsfs -> sampling_frequency
.fs
is used in 4 elephant functions: butter, wavelet_transform, welch_psd, and welch_cohere._freq -> _frequency
?freq
is used 4 times: butter, welch_psd, welch_coherence, and GPFA_i
and_j
. Below is a list of affected functions.Function-specific
data -> histogram
ximax -> max_iterations
trains --> spiketrains
q -> cost_factor
; is there a particular reason, a paper, whereq
is used?v --> time_intervals
data --> binned_spiketrain
maxlag --> max_lag
min_occ -> min_occurences
same_config_cut -> same_configuration_pruning
ch_pairs --> channel_pairs
nlags --> n_lags
env -> hilbert_envelope
lst_input -> input_spiketrains
in BinnedSpikeTrain; closes renamed 'lst_input' -> 'spiketrains' in BinnedSpikeTrain class' #311N --> padding
(N
is passed inscipy.signal.hilbert
, which has this argument)nco -> n_cycles
num_seg -> n_segments
len_seg -> len_segment
freq_res -> freq_resolution
welch_cohere() -> welch_coherence()
. As a remark, scipy, to my surprise, usesscipy.signal.coherence
and notscipy.signal.cohere
.extr_interval -> interval
- the function name already has the key "extraction"format -> as_array
rate_c -> coincidence_rate
return_coinc -> return_coincidences
n -> n_spiketrains
refr_period -> refractory_period
surr_method -> method
sskernel --> optimal_kernel_bandwidth
w -> bandwidth
tin -> times
n --> n_surrogates
coords -> coordinates
t -> time
extract_neo_attrs -> extract_neo_attributes
obj -> neo_object
ele_xx -> x_positions
orpositions_x
xlims -> x_limits
orlimits_x
? Currently, it'sx_limits
, but then why do we usemax_something
and notsomething_max
?res -> resolution
;dt -> time_step or step
dt -> time_step or step
trains -> spiketrains
q -> cost_factor
trains -> spiketrains
tau -> time_constant
tau_max -> max_tau
A -> amplitude_distribution
cross_corr_coef -> cross_correlation_coefficient
corrcoef() -> correlation_coefficient()
Not refactored
Because they require special care (ASSET already follows the naming convention):
Also, I didn't pay attention to _protected functions not because they can avoid the naming convention but because I didn't want to spend time refactoring them. Keep in mind that any decent renaming may lead to breaking the logic and thus should be justified.
Won't change
homogeneous_gamma_process()
functiona
is the shape andb
is the rate of a distribution will not be renamed to avoid a misinterpretation of the rate of the outcome spiketrain, which is equal tob/a
and notb
.surrogates()
functiondt
won't be changed because it means different things depending on the surrogate method choice.multiple_filter_test()
andempirical_parameters()
functionst_final
won't be changed tot_stop
because it serves a different purpose.nfft
became a standard over the years, even though it does not comply with our convention, which renders this variable asn_fft
.