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

Update 0.0.2 #20

Merged
merged 52 commits into from
Apr 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
2b343b4
bump up version
skim0119 Apr 12, 2022
b65e27d
add nb style parser
skim0119 Apr 12, 2022
63c3968
change spike_processing file format
skim0119 Apr 12, 2022
e60e457
add toggle button
skim0119 Apr 12, 2022
536976b
Merge remote-tracking branch 'public/main' into update-0.0.2
skim0119 Apr 12, 2022
6a87d44
Merge branch 'update-0.0.2' into doc_patch
skim0119 Apr 12, 2022
3284a38
Update README.md
skim0119 Apr 12, 2022
9ef269e
Merge branch 'doc_patch' into 10_filter_impl
skim0119 Apr 13, 2022
5337cff
add mypy ci integration
skim0119 Apr 13, 2022
bf51f27
add mypy in makefile
skim0119 Apr 13, 2022
4aa15ba
fix:main yml codecoverage
armantekinalp Apr 14, 2022
4761c5c
Merge pull request #12 from armantekinalp/fix_coverage
skim0119 Apr 14, 2022
f001b81
update: filter structure
skim0119 Apr 15, 2022
c168c55
update doc readme
skim0119 Apr 15, 2022
e61c52f
add signal processing tutorial
skim0119 Apr 15, 2022
c8f7883
add typing alias
skim0119 Apr 16, 2022
f11919b
update filters
skim0119 Apr 16, 2022
23eaa10
update filter documentation
skim0119 Apr 16, 2022
5d2a59a
update doc-string
skim0119 Apr 16, 2022
3504238
update test requirement packages
skim0119 Apr 16, 2022
0f7f6c6
add alias
skim0119 Apr 16, 2022
8131ea7
add test for butterworth filter wrapper
skim0119 Apr 16, 2022
00f1fea
add parameter checker in post-init stage
skim0119 Apr 16, 2022
b07969f
remove tests file from checking mypy
skim0119 Apr 16, 2022
43ae6e2
update requirements
skim0119 Apr 16, 2022
0058277
update requirements
skim0119 Apr 16, 2022
0095e01
update: black version
skim0119 Apr 16, 2022
d6811a3
update: black version
skim0119 Apr 16, 2022
0437c64
Merge branch 'update-0.0.2' into 10_filter_impl
skim0119 Apr 16, 2022
dd1b70f
Merge pull request #14 from skim0119/10_filter_impl
skim0119 Apr 16, 2022
5b866ea
add rtd config
skim0119 Apr 16, 2022
33eb208
relocate the config file
skim0119 Apr 16, 2022
2b27bfb
fix docstring
skim0119 Apr 16, 2022
09015e1
match python-sphinx version
skim0119 Apr 16, 2022
ef75a14
move module docstring into doc folder
skim0119 Apr 16, 2022
de4e2e3
add rtd config
skim0119 Apr 16, 2022
2494d24
add autosummary module from autodoc ext
skim0119 Apr 16, 2022
a71135d
enhancement:first commit data class and data set class
armantekinalp Apr 17, 2022
1ce15c0
add spike timestamps type alias
skim0119 Apr 17, 2022
96b0c6e
update detection protocol and basic cutoff method
skim0119 Apr 17, 2022
4e2a55e
add detection method toctree
skim0119 Apr 17, 2022
6a390e3
update docstring on spike detection
skim0119 Apr 17, 2022
c2ace25
rearange spike detection documentation
skim0119 Apr 17, 2022
b665854
update: spike detection protocol test
skim0119 Apr 18, 2022
068c9e2
fix: mypy
skim0119 Apr 18, 2022
d927824
update: add stat summarizer
skim0119 Apr 18, 2022
8c832d6
update statistics api and documentation
skim0119 Apr 18, 2022
c060a1d
Merge pull request #18 from skim0119/13_spike_detection
skim0119 Apr 18, 2022
7312ede
Merge branch 'update-0.0.2' into 15_basic_statistics
skim0119 Apr 18, 2022
4e11f41
fix: corrected doc index naming
skim0119 Apr 18, 2022
635e532
Merge pull request #19 from skim0119/15_basic_statistics
skim0119 Apr 18, 2022
7f09e13
Merge pull request #17 from armantekinalp/data_set_interface
skim0119 Apr 19, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2

# Ref: https://docs.github.com/en/free-pro-team@latest/actions/guides/building-and-testing-python
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
Expand All @@ -36,9 +36,9 @@ jobs:
# You can test your matrix by printing the current Python version
- name: Display Python version
run: python -c "import sys; print(sys.version)"

# Cache the pip requirmenets for other tests. If requirements cached use them to speed up the build.
# Ref: https://github.com/actions/cache/blob/main/examples.md#python---pip
# Ref: https://github.com/actions/cache/blob/main/examples.md#python---pip
- name: Cache pip Linux
uses: actions/cache@v2
if: startsWith(runner.os, 'Linux')
Expand All @@ -55,7 +55,7 @@ jobs:
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-

- name: Cache pip Windows
uses: actions/cache@v2
if: startsWith(runner.os, 'Windows')
Expand All @@ -72,34 +72,34 @@ jobs:
pip install -r requirements.txt
echo update test requirements
pip install -r tests/requirements.txt

# Runs a single command using the runners shell
- name: Welcome message
run: echo Hello, world! Welcome MiV-OS Build, lets start testing!

# Formatting test with black and flake8
- name: Black and Flake8 formatting tests
if: startsWith(runner.os, 'macOS')
run: |
if [[ "${{ matrix.python-version }}" == "3.8" ]]; then
if [[ "${{ matrix.python-version }}" == "3.8" ]]; then
black --version
black --check miv tests
flake8 --version
flake8 miv tests
flake8 miv tests
fi

# General PyTest for all matrix strategy
- name: PyTest
- name: PyTest and MyPy
run: |
pytest
make ci

# Set environment variables for coverage test. Coverage test is done using python 3.8
# Test MiV-OS using pytest
- name: Test MiV-OS using pytest
if: startsWith(runner.os, 'macOS')
run: |
if [[ "${{ matrix.python-version }}" == "3.8" ]]; then
if [[ "${{ matrix.python-version }}" == "3.8" ]]; then
echo "CODECOV_TOKEN=4e35faf2-dc6b-442c-99f3-90d088ccd9f6" >> $GITHUB_ENV
python3 -m pytest --cov=MiV-OS --cov-report=xml
python3 -m pytest --cov=miv --cov-report=xml
codecov
fi
2 changes: 0 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ repos:
- id: trailing-whitespace
- id: check-json
- id: end-of-file-fixer
- id: name-tests-test
args: ['--django']
- id: requirements-txt-fixer
- repo: https://github.com/psf/black
rev: 21.12b0
Expand Down
29 changes: 29 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# .readthedocs.yaml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Set the version of Python and other tools you might need
build:
os: ubuntu-20.04
tools:
python: "3.8"
# You can also specify other tool versions:
# nodejs: "16"
# rust: "1.55"
# golang: "1.17"

# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/conf.py

# If using Sphinx, optionally build your docs in additional formats such as PDF
# formats:
# - pdf

# Optionally declare the Python requirements required to build your docs
python:
install:
- requirements: docs/requirements.txt
9 changes: 8 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
test:
@python -m pytest

all:test
mypy:
@mypy --ignore-missing-imports miv

coverage:
@pytest --cov=miv tests/

all:test mypy
ci: test mypy
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ $ pip install MiV-OS
## Documentation
[![Documentation Status][badge-docs-status]][link-docs-status]

Documentation of the package is available [here][link-docs-website]
Documentation of the package is available [here][link-docs-status]

## Contribution

Expand Down
6 changes: 6 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ In addition, we utilize the following extensions to enhance the documentation :c
- `numpydoc`: We favor [numpy documentation style](https://numpydoc.readthedocs.io/en/latest/format.html) for API documentation.
- `myst_parser`: We like to write documentation and guidelines in `markdown` format.

## Key things to remember

- Please DON'T IGNORE any `errors` or `warnings` during the compilation stage.
- If you are uploading any `ipynb` or notebook-style, make sure you excluded the input-output cells.
- Currently, we don't use the `runnable` notebook directly on the documentation. If you think otherwise, please leave an issue so that we can discuss.

## Build documentation

The `sphinx` is already initialized in `docs` directory. In order to build the documentation, you will need additional packages listed in `docs/requirements.txt`.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
miv.signal.spike.SpikeDetectionProtocol
=======================================

.. currentmodule:: miv.signal.spike

.. autoclass:: SpikeDetectionProtocol


.. automethod:: __init__


.. rubric:: Methods

.. autosummary::

~SpikeDetectionProtocol.__init__
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
miv.signal.spike.ThresholdCutoff
================================

.. currentmodule:: miv.signal.spike

.. autoclass:: ThresholdCutoff
:members: align_to_minimum, compute_spike_threshold, detect_threshold_crossings, get_next_minimum

.. rubric:: Methods

.. autosummary::

~ThresholdCutoff.align_to_minimum
~ThresholdCutoff.compute_spike_threshold
~ThresholdCutoff.detect_threshold_crossings
~ThresholdCutoff.get_next_minimum
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
miv.signal.filter.ButterBandpass
================================

.. autoclass:: miv.signal.filter.ButterBandpass
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
miv.signal.filter.FilterCollection
==================================

.. currentmodule:: miv.signal.filter

.. autoclass:: FilterCollection
:members: append, insert
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
miv.signal.filter.FilterProtocol
================================

.. autoclass:: miv.signal.filter.FilterProtocol
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
miv.statistics.summarizer.StatisticsSummary
===========================================

.. currentmodule:: miv.statistics.summarizer

.. autoclass:: StatisticsSummary

.. rubric:: Methods

.. autosummary::

~StatisticsSummary.__init__
~StatisticsSummary.spikestamps_summary
41 changes: 31 additions & 10 deletions docs/api/signal.rst
Original file line number Diff line number Diff line change
@@ -1,13 +1,34 @@
************************
Signal Processing Module
************************
*************************
Signal Processing Modules
*************************

.. automodule:: miv.signal.filter.continuous_signal_filter
:members:

***********************
Spike Detection Modules
***********************
Filter
######

.. automodule:: miv.signal.spike.detection
:members:
.. currentmodule:: miv.signal.filter

.. automodule:: miv.signal.filter

.. autosummary::
:nosignatures:
:toctree: _toctree/FilterAPI

FilterProtocol
ButterBandpass
FilterCollection

Spike Detection
###############

.. automodule:: miv.signal.spike

.. autosummary::
:nosignatures:
:toctree: _toctree/DetectionAPI

SpikeDetectionProtocol
ThresholdCutoff

Spike Sorting
#############
38 changes: 38 additions & 0 deletions docs/api/statistics.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,41 @@
******************
Statistics Modules
******************

Statistics Tools
================

Spikestamps
-----------

.. currentmodule:: miv.statistics

.. automodule:: miv.statistics.summarizer

.. autosummary::
:nosignatures:
:toctree: _toctree/StatisticsAPI

StatisticsSummary

Useful External Packages
########################

scipy statistics
================

`scipy <https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.describe.html>`_

.. autosummary::

scipy.stats.describe

elephant.statistics
===================

`elephant documentation: <https://elephant.readthedocs.io/en/latest/reference/statistics.html>`_

.. autosummary::

elephant.statistics.mean_firing_rate
elephant.statistics.instantaneous_rate
33 changes: 24 additions & 9 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,22 +37,26 @@
# ones.
extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.autosummary",
"sphinx.ext.autosectionlabel",
"sphinx_autodoc_typehints",
#'sphinx.ext.napoleon',
"sphinx.ext.viewcode",
"sphinx_togglebutton",
"sphinx_copybutton",
"sphinx_rtd_theme",
"sphinx.ext.mathjax",
"numpydoc",
"myst_parser",
# "myst_parser", # Moving onto jupyter-notebook style
"myst_nb",
]

myst_enable_extensions = [
"amsmath",
"colon_fence",
"deflist",
"dollarmath",
"fieldlist",
# "fieldlist",
"html_admonition",
"html_image",
]
Expand All @@ -67,16 +71,24 @@
"README.md", # File reserved to explain how documentationing works.
]

autodoc_default_flags = [
"members",
"private-members",
"special-members",
"show-inheritance",
]
autodoc_default_options = {
# "members": False,
"member-order": "bysource",
"special-members": "",
"exclude-members": "__weakref__",
"show-inheritance": True,
}
autosectionlabel_prefix_document = True
autosummary_generate = True
autosummary_generate_overwrite = False

source_parsers = {}
source_suffix = [".rst", ".md"]
source_suffix = {
".rst": "restructuredtext",
".md": "myst-nb",
".myst": "myst-nb",
".ipynb": "myst-nb",
}

master_doc = "index"
# -- Options for HTML output -------------------------------------------------
Expand All @@ -101,3 +113,6 @@

# -- Options for numpydoc ---------------------------------------------------
numpydoc_show_class_members = False

# -- Options for myst-nb ---------------------------------------------------
jupyter_execute_notebooks = "off"
6 changes: 6 additions & 0 deletions docs/examples/spike_detection.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Spike Detection Example
#######################

.. literalinclude:: ../../examples/post_processing/spike_detection.py
:linenos:
:language: python
Loading