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

Docs: render autodoc & typehints in the API documentation #359

Merged
merged 27 commits into from
Jan 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
988537c
remove uninformative comment block
anilbey Jan 16, 2024
3d1f579
update setDependencyFileLocation
anilbey Jan 16, 2024
74d82ec
update getDependencyFileLocation
anilbey Jan 16, 2024
34c7af4
update setThreshold
anilbey Jan 16, 2024
d5e952c
update setDerivativeThreshold
anilbey Jan 16, 2024
9e15523
add type hints to get_cpp_feature, numpy as np to shorten fn sign
anilbey Jan 16, 2024
333d44c
update getFeatureNames, FeatureNameExists, _get_feature
anilbey Jan 16, 2024
3421d89
update getDistance
anilbey Jan 16, 2024
2c8d613
update setInt/Double/Strsettings
anilbey Jan 16, 2024
cc2e349
update getFeatureValues
anilbey Jan 16, 2024
807b7dd
update getMeanFeatureValues
anilbey Jan 16, 2024
ae94b33
update _get_feature_values_serial
anilbey Jan 16, 2024
38d3661
readthedocs.yaml py3.9->py3.10
anilbey Jan 16, 2024
779563c
use the same requirements_docs.txt in readthedocs,tox,Makefile
anilbey Jan 16, 2024
6d0d058
Fix docstring error in extract_stim_times_from_neo_data
anilbey Jan 16, 2024
b34ee9e
fix docstring error in load_neo_file
anilbey Jan 16, 2024
65f1777
enable autodoc + typehints
anilbey Jan 16, 2024
4d2d015
make CHANGELOG rst
anilbey Jan 16, 2024
e2222f3
add changelog to docs
anilbey Jan 16, 2024
470a9d7
update docs' description text
anilbey Jan 16, 2024
4be0cae
update epubcopyright date
anilbey Jan 16, 2024
7125237
update CHANGELOG
anilbey Jan 16, 2024
0675b21
update PR template
anilbey Jan 16, 2024
2b3cee4
fix trailing whitespace
anilbey Jan 16, 2024
47d7b35
apply Aurelien's review
anilbey Jan 17, 2024
599161b
Merge branch 'master' into docs
anilbey Jan 17, 2024
eac477b
handle None values in phaseslope_max
anilbey Jan 17, 2024
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
8 changes: 3 additions & 5 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@

# Pull Request Template

## Description

Please include a summary of the change.
Expand All @@ -9,6 +7,6 @@ To increment major or minor changes add #major or #minor to the PR description.


## Checklist:
- [ ] Unit tests are added to cover the changes.
- [ ] The changes are mentioned in the documentation.
- [ ] CHANGELOG.md is updated (skip if the change is not important for the changelog).
- [ ] Unit tests are added to cover the changes (skip if not applicable).
- [ ] The changes are mentioned in the documentation (skip if not applicable).
- [ ] CHANGELOG file is updated (skip if not applicable).
2 changes: 1 addition & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ version: 2
build:
os: ubuntu-22.04
tools:
python: "3.9"
python: "3.10"

python:
# Install our python package before building the docs
Expand Down
48 changes: 29 additions & 19 deletions CHANGELOG.md → CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,36 +1,46 @@

# Changelog
Changelog
=========
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
The format is based on `Keep a Changelog <https://keepachangelog.com/en/1.0.0/>`_,
and this project adheres to `Semantic Versioning <https://semver.org/spec/v2.0.0.html>`_.

## [5.5.4] - 2024-01
5.5.5 - 2024-01
----------------
- Type annotate api.py's functions.
- Deprecate camel case function names in api.py.
- Start using same requirements_docs.txt in readthedocs and tox.
- Enable autodoc and typehints in the API documentation.
- Fix docstring errors in the io module.
- Add changelog to the documentation.

[5.5.4] - 2024-01
-----------------
- New feature: phaseslope_max

## [5.5.3] - 2024-01

5.5.3 - 2024-01
----------------
- Add type stub for cppcore module to make Python recognise the C++ functions' arguments and return values.

## [5.5.0] - 2024-01

### C++ changes
- AP_end_indices, AP_rise_time, AP_fall_time, AP_rise_rate, AP_fall_rate do not take into account peaks before stim_start anymore
- New test and test data for spontaneous firing case.
The data is provided by github user SzaBoglarka using cell https://modeldb.science/114047


## [5.4.0] - 2024-01

### C++ changes
5.5.0 - 2024-01
----------------
C++ changes
^^^^^^^^^^^
- AP_end_indices, AP_rise_time, AP_fall_time, AP_rise_rate, AP_fall_rate do not take into account peaks before stim_start anymore.
- New test and test data for spontaneous firing case. The data is provided by github user SzaBoglarka using cell `https://modeldb.science/114047 <https://modeldb.science/114047>`_.

5.4.0 - 2024-01
----------------
C++ changes
^^^^^^^^^^^
- New C++ function `getFeatures` replaced `getVec`.
- `getFeatures` automatically handles failures & distinguishes empty results from failures.
- Centralized error handling in `getFeatures` shortens the code by removing repetitions.
- C++ features' access is restricted. Read-only references are marked `const`.
- Removed wildcard features from C++ API. Use of Python is encouraged for that purpose.

### Python changes
Python changes
^^^^^^^^^^^^^^
- `bpap_attenuation` feature is added to the Python API.
- `Spikecount`, `Spikecount_stimint`, `burst_number`, `strict_burst_number` and `trace_check` features migrated to Python from C++.
- `check_ais_initiation` is added to the Python API.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ doc_efeatures:
ls -al ../../build_efeatures && \
pdflatex -output-directory=../../build_efeatures efeature-documentation.tex
doc: install doc_efeatures
pip install sphinx sphinx-autobuild sphinx_rtd_theme
pip install -r requirements_docs.txt
cd docs; $(MAKE) clean; $(MAKE) html SPHINXOPTS=-W
doc_upload: doc
cd docs/build/html && \
Expand Down
1 change: 1 addition & 0 deletions docs/source/changelog.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.. include:: ../../CHANGELOG.rst
14 changes: 11 additions & 3 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,15 @@
# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.viewcode',
'sphinx.ext.autosummary', 'sphinx.ext.napoleon']
'sphinx.ext.autosummary', 'sphinx.ext.napoleon', "sphinx_autodoc_typehints"]
autosummary_generate = True # Turn on sphinx.ext.autosummary
autodoc_default_options = {
"members": True,
}

# Autodoc-typehints settings
always_document_param_types = True
typehints_use_rtype = True

napoleon_numpy_docstring = True

Expand All @@ -47,7 +55,7 @@

# General information about the project.
project = u'eFEL'
copyright = u'2015-2022, BBP, EPFL'
copyright = u'2015-2024, BBP, EPFL'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
Expand Down Expand Up @@ -259,7 +267,7 @@
epub_title = u'eFEL'
epub_author = u'BBP, EPFL'
epub_publisher = u'BBP, EPFL'
epub_copyright = u'2015-2022, BBP, EPFL'
epub_copyright = u'2015-2024, BBP, EPFL'

# The language of the text. It defaults to the language option
# or en if the language is not set.
Expand Down
5 changes: 2 additions & 3 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ calculated. The library will then extract the requested eFeatures and return the
values to the user.

The core of the library is written in C++, and a Python wrapper is included.
At the moment we provide a way to automatically compile and install the library
as a Python module. Soon instructions will be added on how to link C++ code
directly with the eFEL.
You can automatically compile and install the library as a Python module.

The source code of the eFEL is located on github:
`BlueBrain/eFEL <https://github.com/BlueBrain/eFEL>`_
Expand All @@ -28,6 +26,7 @@ The source code of the eFEL is located on github:
examples
eFeatures
api
changelog
developers

Indices and tables
Expand Down
Loading