Skip to content

Commit

Permalink
refactored MANIFEST to affect changes of new docs (NeuralEnsemble#302)
Browse files Browse the repository at this point in the history
* refactored MANIFEST to affect changes of new docs
* xrange->range
* get rid of numpy docscrape warnings because of the incorrect docstring fields
* removed unused doc/tutorials/images folder
* upd maintainers guide
  • Loading branch information
dizcza authored Mar 25, 2020
1 parent 2333599 commit f3360bb
Show file tree
Hide file tree
Showing 25 changed files with 104 additions and 97 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ lib
lib64
# sphinx build directory
doc/_build
doc/reference/statistics/
doc/reference/unitary_event_analysis/
doc/reference/toctree/*
!doc/reference/toctree/kernels/
*.h5
# setup.py dist directory
dist
Expand Down
10 changes: 6 additions & 4 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@ include LICENSE.txt
include elephant/VERSION
include elephant/current_source_density_src/README.md
include elephant/current_source_density_src/test_data.mat
include elephant/neural_trajectory_src/README.md
include elephant/spade_src/LICENCE
include elephant/gpfa_src/INFO.md
include elephant/spade_src/LICENSE
recursive-include elephant/spade_src *.so *.pyd
include elephant/test/spike_extraction_test_data.txt
recursive-include doc *
prune doc/_build
recursive-exclude . *~
prune doc/tutorials/.ipynb_checkpoints
prune doc/reference/toctree
include doc/reference/toctree/kernels/*
recursive-exclude * *.h5
recursive-exclude * *~
3 changes: 3 additions & 0 deletions doc/authors.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ The following people have contributed code and/or ideas to the current version
of Elephant. The institutional affiliations are those at the time of the
contribution, and may not be the current affiliation of a contributor.

Do you want to contribute to Elephant? Please refer to the
:ref:`developers_guide`.

* Alper Yegenoglu [1]
* Andrew Davison [2]
* Björn Müller [1]
Expand Down
2 changes: 1 addition & 1 deletion doc/documentation_guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Building the documentation
The documentation in :file:`doc/` folder is written in `reStructuredText
<http://docutils.sourceforge.net/rst.html>`_, using the
`Sphinx <http://sphinx-doc.org/>`_ documentation system. To build the
documentation::
documentation:

1. Install requirements-docs.txt and requirements-tutorials.txt in the same way
as it's explained in :ref:`developers_guide` step 3::
Expand Down
Binary file removed doc/images/tutorials/tutorial_1_figure_1.png
Binary file not shown.
Binary file removed doc/images/tutorials/tutorial_1_figure_2.png
Binary file not shown.
2 changes: 1 addition & 1 deletion doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Table of Contents
authors
release_notes
get_in_touch
acknowledgements
acknowledgments



Expand Down
34 changes: 20 additions & 14 deletions doc/maintaners_guide.rst → doc/maintainers_guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ The module docstring of ``elephant/x.py`` is also standardized in its structure:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. autosummary::
:toctree: x/
:toctree: toctree/x/
function1
function2
Expand All @@ -92,7 +92,7 @@ The module docstring of ``elephant/x.py`` is also standardized in its structure:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. autosummary::
:toctree: x/
:toctree: toctree/x/
function3
function4
Expand All @@ -119,29 +119,35 @@ Making a release
1. Increment the Elephant package version in :file:`elephant/VERSION`.

2. Add a section in :file:`doc/release_notes.rst`, describing in short the
changes made from the previous release.
changes made from the previous release.

3. Check that the copyright statement (in :file:`LICENSE.txt`,
:file:`README.md`, and :file:`doc/conf.py`) is correct.
:file:`README.md`, and :file:`doc/conf.py`) is correct.

4. If there is a new module do not forget to add the modulename to the
:file:`doc/modules.rst` and make a file with a short description in
:file:`doc/reference/<modulename>.rst`.
4. If there is a new module do not forget to add the module name to the
:file:`doc/modules.rst` and make a file with a short description in
:file:`doc/reference/<modulename>.rst`.

To build a source package (see `Packaging Python Projects
<https://packaging.python.org/tutorials/packaging-projects/#generating-distribution-archives>`_)::
5. Remove :file:`elephant/spade_src/fim.so`. Otherwise, it'll be included in
the built package (it should be downloaded at pip install).

6. Build a source package and upload it to PyPi.

Build a source package (see `Packaging Python Projects
<https://packaging.python.org/tutorials/packaging-projects/#generating-distribution-archives>`_)::

$ pip install --user --upgrade twine
$ python setup.py sdist

To upload the package to `PyPI <http://pypi.python.org>`_
(if you have the necessary permissions)::
To upload the package to `PyPI <http://pypi.python.org>`_
(if you have the necessary permissions)::

$ python -m twine upload dist/elephant-x.x.x.tar.gz
$ python -m twine upload dist/elephant-X.Y.Z.tar.gz

Finally, tag the release in the Git repository and push it::
7. Finally, make a release on GitHub UI page and copy-paste the release notes.
Then tag the release in the Git repository and push it::

$ git tag <version>
$ git push --tags upstream

Here, version should be of the form ``vX.Y.Z``.
Here, version should be of the form ``vX.Y.Z``.
34 changes: 19 additions & 15 deletions elephant/asset.py
Original file line number Diff line number Diff line change
Expand Up @@ -787,9 +787,9 @@ def cluster_matrix_entries(mat, eps=10, min=2, stretch=5):
def probability_matrix_montecarlo(
spiketrains, binsize, dt, t_start_x=None, t_start_y=None,
surr_method='dither_spike_train', j=None, n_surr=100, verbose=False):
'''
"""
Given a list of parallel spike trains, estimate the cumulative probability
of each entry in their intersection matrix (see: intersection_matrix())
of each entry in their intersection matrix (see: intersection_matrix())
by a Monte Carlo approach using surrogate data.
Contrarily to the analytical version (see: probability_matrix_analytical())
the Monte Carlo one does not incorporate the assumptions of Poissonianity
Expand All @@ -799,8 +799,8 @@ def probability_matrix_montecarlo(
at disposal, see below) and calculates their intersection matrix M.
For each entry (i, j), the intersection cdf P[i, j] is then given by:
.. centered:: P[i, j] = #(spike_train_surrogates such that M[i, j] < I[i, j]) /
#(spike_train_surrogates)
.. centered:: P[i, j] = #(spike_train_surrogates such that M[i, j] <
I[i, j]) / #(spike_train_surrogates)
If P[i, j] is large (close to 1), I[i, j] is statistically significant:
the probability to observe an overlap equal to or larger then I[i, j]
Expand Down Expand Up @@ -853,7 +853,7 @@ def probability_matrix_montecarlo(
See also
--------
probability_matrix_analytical : for analytical derivation of the matrix
'''
"""

# Compute the intersection matrix of the original data
imat, x_edges, y_edges = intersection_matrix(
Expand Down Expand Up @@ -1260,7 +1260,7 @@ def _pmat_neighbors(mat, filter_shape, nr_largest=None, diag=0):

def joint_probability_matrix(
pmat, filter_shape, nr_largest=None, alpha=0, pvmin=1e-5):
'''
"""
Map a probability matrix pmat to a joint probability matrix jmat, where
jmat[i, j] is the joint p-value of the largest neighbors of pmat[i, j].
Expand Down Expand Up @@ -1302,18 +1302,22 @@ def joint_probability_matrix(
----------
[1] Torre et al (in prep) ...
Example
-------
# Assuming to have a list sts of parallel spike trains over 1s recording,
# the following code computes the intersection/probability/joint-prob
# matrices imat/pmat/jmat using a bin width of 5 ms
Examples
--------
Assuming to have a list sts of parallel spike trains over 1s recording,
the following code computes the intersection/probability/joint-prob
matrices imat/pmat/jmat using a bin width of 5 ms:
>>> import quantities as pq
>>> from elephant import asset
>>> T = 1 * pq.s
>>> binsize = 5 * pq.ms
>>> imat, xedges, yedges = intersection_matrix(sts, binsize=binsize, dt=T)
>>> pmat = probability_matrix_analytical(sts, binsize, dt=T)
>>> jmat = joint_probability_matrix(pmat, filter_shape=(fl, fw))
>>> imat, xedges, yedges = asset.intersection_matrix(sts,
... binsize=binsize, dt=T)
>>> pmat = asset.probability_matrix_analytical(sts, binsize, dt=T)
>>> jmat = asset.joint_probability_matrix(pmat, filter_shape=(fl, fw))
'''
"""
# Find for each P_ij in the probability matrix its neighbors and maximize
# them by the maximum value 1-pvmin
pmat_neighb = _pmat_neighbors(
Expand Down
4 changes: 2 additions & 2 deletions elephant/cell_assembly_detection.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
applied as demonstrated in this short toy example of 5 parallel spike trains
that exhibit fully synchronous events of order 5.
Example
-------
Examples
--------
>>> import matplotlib.pyplot as plt
>>> import elephant.conversion as conv
>>> import elephant.spike_train_generation
Expand Down
10 changes: 5 additions & 5 deletions elephant/kernels.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
~~~~~~~~~~~~~~~~~~~
.. autosummary::
:toctree: kernels/
:toctree: toctree/kernels/
Kernel
SymmetricKernel
Expand All @@ -18,7 +18,7 @@
~~~~~~~~~~~~~~~~~
.. autosummary::
:toctree: kernels/
:toctree: toctree/kernels/
RectangularKernel
TriangularKernel
Expand All @@ -30,7 +30,7 @@
~~~~~~~~~~~~~~~~~~
.. autosummary::
:toctree: kernels/
:toctree: toctree/kernels/
ExponentialKernel
AlphaKernel
Expand Down Expand Up @@ -186,8 +186,8 @@ def boundary_enclosing_area_fraction(self, fraction):
whole probability mass of the kernel is concentrated over negative
support for inverted kernels.
Parameter
---------
Parameters
----------
fraction : float
Fraction of the whole area which has to be enclosed.
Expand Down
4 changes: 2 additions & 2 deletions elephant/pandas_bridge.py
Original file line number Diff line number Diff line change
Expand Up @@ -582,8 +582,8 @@ def slice_spiketrain(pdobj, t_start=None, t_stop=None):
pdobj : scalar, pandas Series, DataFrame, or Panel
The returned data type is the same as the type of `pdobj`
Note
----
Notes
-----
The order of the index and/or column levels of the returned object may
differ from the order of the original.
Expand Down
Loading

0 comments on commit f3360bb

Please sign in to comment.