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

added example to docstring, removed reference to annotations #468

Conversation

Moritz-Alexander-Kern
Copy link
Member

This PR addresses Issue #464.

Changes:

  • added example to docstring
  • removed reference to annotations

@Moritz-Alexander-Kern Moritz-Alexander-Kern linked an issue Apr 1, 2022 that may be closed by this pull request
@Moritz-Alexander-Kern Moritz-Alexander-Kern added the bugfix Fix for an indentified bug. label Apr 1, 2022
Copy link
Collaborator

@kohlerca kohlerca left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes look good.

>>> import quantities as pq
>>> from elephant import conversion
>>>
>>> times = (np.arange(10) + np.random.uniform(size=10)) * pq.ms
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without a fixed seed this will fail when being run as a doctest since the result will change every time.
What's our policy for these examples? Should they work as doctests?
I guess that would help to keep the examples up to date, when running this I noticed that a few other examples in this file currently fail as well.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey,
thanks for catching this, I fully agree, running doctests is helpful. So far it seems there is no policy regarding this, in the following the result of a doctest run for elephant:

pytest elephant --doctest-modules --ignore=elephant/test
========================================= test session starts ==================================================
platform linux -- Python 3.8.10, pytest-7.1.1, pluggy-1.0.0

collected 70 items                                                                                                                                                                                                                        

elephant/cell_assembly_detection.py F                                                                     [  1%]
elephant/change_point_detection.py FF                                                                     [  4%]
elephant/conversion.py FF..F                                                                              [ 11%]
elephant/cubic.py F                                                                                       [ 12%]
elephant/datasets.py F                                                                                    [ 14%]
elephant/kernels.py .                                                                                     [ 15%]
elephant/phase_analysis.py F                                                                              [ 17%]
elephant/signal_processing.py FF.F.FF                                                                     [ 27%]
elephant/spade.py FF                                                                                      [ 30%]
elephant/spectral.py FF                                                                                   [ 32%]
elephant/spike_train_correlation.py FFFF.                                                                 [ 40%]
elephant/spike_train_dissimilarity.py ..                                                                  [ 42%]
elephant/spike_train_generation.py .......                                                                [ 52%]
elephant/spike_train_surrogates.py FFF..                                                                  [ 60%]
elephant/spike_train_synchrony.py F                                                                       [ 61%]
elephant/sta.py FF                                                                                        [ 64%]
elephant/statistics.py F..F....F                                                                          [ 77%]
elephant/unitary_event_analysis.py F.FFFFFF                                                               [ 88%]
elephant/utils.py ..                                                                                      [ 91%]
elephant/waveform_features.py ..                                                                          [ 94%]
elephant/asset/asset.py F                                                                                 [ 95%]
elephant/causality/granger.py F                                                                           [ 97%]
elephant/gpfa/gpfa.py F                                                                                   [ 98%]
elephant/spade_src/fast_fca.py F                                                                          [100%]

Lets discuss this, if doctests become mandatory, the above failed tests have to be fixed.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed, see 232dcb0

@Moritz-Alexander-Kern Moritz-Alexander-Kern added the documentation Indicates a need for improvements or additions to documentation label Apr 13, 2022
@Moritz-Alexander-Kern Moritz-Alexander-Kern added this to the v0.11.1 milestone Apr 14, 2022
@Moritz-Alexander-Kern Moritz-Alexander-Kern merged commit bbab368 into NeuralEnsemble:master Apr 14, 2022
@Moritz-Alexander-Kern Moritz-Alexander-Kern deleted the fix/discretise_spiketimes_docstring_behavior branch April 26, 2022 09:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix Fix for an indentified bug. documentation Indicates a need for improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

discretise_spiketimes behavior and documentation
3 participants