-
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
added example to docstring, removed reference to annotations #468
added example to docstring, removed reference to annotations #468
Conversation
There was a problem hiding this 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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed, see 232dcb0
This PR addresses Issue #464.
Changes: