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

Sphinx #264

Merged
merged 109 commits into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
109 commits
Select commit Hold shift + click to select a range
01a2cd5
make files for sphinx
sjvenditto Sep 23, 2024
6350c20
empty space needed after div to interpret markdown within block
sjvenditto Sep 23, 2024
dc0b273
start editing landing page
BalzaniEdoardo Nov 8, 2024
6607cfa
started changing docs
BalzaniEdoardo Nov 11, 2024
df9bb7c
added title
BalzaniEdoardo Nov 12, 2024
8b5a940
improved ref
BalzaniEdoardo Nov 12, 2024
a5d964a
mreged dev
BalzaniEdoardo Nov 12, 2024
ea1e135
double ticks basis
BalzaniEdoardo Nov 12, 2024
ba90747
double ticks glm
BalzaniEdoardo Nov 12, 2024
fb16a48
fixed examples
BalzaniEdoardo Nov 12, 2024
a90a432
fixed examples
BalzaniEdoardo Nov 12, 2024
1347351
fixed examples
BalzaniEdoardo Nov 12, 2024
bf9c093
improved docstrings
BalzaniEdoardo Nov 12, 2024
7404c30
improved docstrings
BalzaniEdoardo Nov 12, 2024
8cb592c
edited more docstrings
BalzaniEdoardo Nov 13, 2024
b839d4f
edited docstrings for observation models
BalzaniEdoardo Nov 13, 2024
681acf4
added todos API
BalzaniEdoardo Nov 13, 2024
4cbbb1b
set docstrings for simulation
BalzaniEdoardo Nov 14, 2024
50ffcbd
finished docstrings parsing
BalzaniEdoardo Nov 14, 2024
c936e9b
added MD files converted with jupytext
BalzaniEdoardo Nov 14, 2024
bcc2276
fixed image tutorial 0
BalzaniEdoardo Nov 14, 2024
384151e
fixed math
BalzaniEdoardo Nov 15, 2024
7e9401b
fixed background
BalzaniEdoardo Nov 15, 2024
f3049fa
edis to background
BalzaniEdoardo Nov 15, 2024
2c60892
reformat files
BalzaniEdoardo Nov 15, 2024
edfa710
fixed howto
BalzaniEdoardo Nov 15, 2024
f993b71
finished howto, started tutorials
BalzaniEdoardo Nov 15, 2024
0a03288
renamed api
BalzaniEdoardo Nov 15, 2024
7a62e99
renamed
BalzaniEdoardo Nov 15, 2024
3ba0d4e
fixed dark mode
BalzaniEdoardo Nov 15, 2024
c43c6f9
fixed quickstart
BalzaniEdoardo Nov 15, 2024
f17e009
finished glm note
BalzaniEdoardo Nov 15, 2024
b28db1d
edited obs models
BalzaniEdoardo Nov 15, 2024
b6d0da4
finished dev notes
BalzaniEdoardo Nov 15, 2024
497e374
fixing some links
BalzaniEdoardo Nov 16, 2024
96d04a5
fixed all links
BalzaniEdoardo Nov 16, 2024
883daf4
added logo flatiron white
BalzaniEdoardo Nov 16, 2024
c027d80
switch logo in mode dark
BalzaniEdoardo Nov 16, 2024
35428d4
add target
BalzaniEdoardo Nov 16, 2024
01278e7
modified rtd
BalzaniEdoardo Nov 16, 2024
06c9ded
removed unsesd extension
BalzaniEdoardo Nov 16, 2024
8db2826
adding lev 1 heading
BalzaniEdoardo Nov 16, 2024
09253bb
linted
BalzaniEdoardo Nov 16, 2024
689b6e5
replaced link that was stuck
BalzaniEdoardo Nov 16, 2024
23fd89b
fixed tests
BalzaniEdoardo Nov 16, 2024
4dbbeec
fixed doctests
BalzaniEdoardo Nov 16, 2024
41eba7f
removed commented conf
BalzaniEdoardo Nov 16, 2024
ae2b49d
set non-interactive backend
BalzaniEdoardo Nov 16, 2024
3323ca6
fix rtd paths
BalzaniEdoardo Nov 16, 2024
d1404e6
smaller FI logo
BalzaniEdoardo Nov 18, 2024
6fb7706
removed "" on admonition title
BalzaniEdoardo Nov 18, 2024
47d3260
Update docs/tutorials/plot_02_head_direction.md
BalzaniEdoardo Nov 19, 2024
06c286e
fixed "next" for dev notes
BalzaniEdoardo Nov 19, 2024
87e2a9c
removed jupytext +++
BalzaniEdoardo Nov 20, 2024
3316abb
added image checks
BalzaniEdoardo Nov 20, 2024
6f01d9e
try fixing item lists in rst in docstrings
BalzaniEdoardo Nov 20, 2024
3cb1947
remove footnotes css
BalzaniEdoardo Nov 20, 2024
e21f185
potentially fix progress bar
BalzaniEdoardo Nov 20, 2024
bad2adb
priority to getting help
BalzaniEdoardo Nov 20, 2024
f70a42b
leftover admonition fix
BalzaniEdoardo Nov 20, 2024
1708241
remove logging
BalzaniEdoardo Nov 20, 2024
bbb4dc3
added ipythonwidgets
BalzaniEdoardo Nov 20, 2024
11cf0ae
fixed links
BalzaniEdoardo Nov 20, 2024
4a71d02
Merge branch 'sphinx' of github.com:flatironinstitute/nemos into sphinx
BalzaniEdoardo Nov 20, 2024
287b903
added thumbnail for background
BalzaniEdoardo Nov 21, 2024
904c7d0
add images tutorials
BalzaniEdoardo Nov 21, 2024
c67be3d
add thumbnails tutorials
BalzaniEdoardo Nov 21, 2024
3625d91
hide mpl inline
BalzaniEdoardo Nov 21, 2024
d9ad0c7
added all thumbnails
BalzaniEdoardo Nov 21, 2024
b0e91ea
added warning ignore filter
BalzaniEdoardo Nov 21, 2024
d91eafe
added svgs for how to
BalzaniEdoardo Nov 21, 2024
9bfa0de
modified svg
BalzaniEdoardo Nov 21, 2024
be11da1
clear date
BalzaniEdoardo Nov 21, 2024
eef2b30
clear date
BalzaniEdoardo Nov 21, 2024
9b642a2
clear date
BalzaniEdoardo Nov 21, 2024
6129f1a
cleared date
BalzaniEdoardo Nov 21, 2024
2fa7d72
removed svgs
BalzaniEdoardo Nov 21, 2024
c89bae9
reinserted save
BalzaniEdoardo Nov 21, 2024
2d5f996
mod gitignore
BalzaniEdoardo Nov 21, 2024
a7b3de9
linted
BalzaniEdoardo Nov 21, 2024
e0218cb
debug rtd
BalzaniEdoardo Nov 21, 2024
99a049e
add a prebuild debug
BalzaniEdoardo Nov 21, 2024
80d95ef
fix rtd
BalzaniEdoardo Nov 21, 2024
1a4a8a5
thumbnail added
BalzaniEdoardo Nov 21, 2024
12f675c
change to save in assets
BalzaniEdoardo Nov 21, 2024
cc9e813
Revert "thumbnail added"
BalzaniEdoardo Nov 21, 2024
bf83f94
Revert "change to save in assets"
BalzaniEdoardo Nov 21, 2024
627db1d
reverted to save to static
BalzaniEdoardo Nov 21, 2024
92bc20b
increase timeout
BalzaniEdoardo Nov 22, 2024
6e4a08c
changed image
BalzaniEdoardo Nov 22, 2024
774a79f
added ipython kernel
BalzaniEdoardo Nov 22, 2024
beca7be
fixed progress bar
BalzaniEdoardo Nov 22, 2024
9448c23
fix refs
BalzaniEdoardo Nov 22, 2024
52cc109
removed bold from note
BalzaniEdoardo Nov 22, 2024
43ec609
fixed alt
BalzaniEdoardo Nov 22, 2024
f9dad13
fixed admonitions
BalzaniEdoardo Nov 22, 2024
daf7989
import tqdm.auto directly
BalzaniEdoardo Nov 22, 2024
d326019
some linting of the docstrings
BalzaniEdoardo Nov 22, 2024
67b8692
linted
BalzaniEdoardo Nov 22, 2024
1aaddcf
linted
BalzaniEdoardo Nov 22, 2024
8d11bd5
added from future import annotations
BalzaniEdoardo Nov 22, 2024
664d500
added sphinx build to gitignore
BalzaniEdoardo Nov 22, 2024
c198462
copyright updated
BalzaniEdoardo Nov 22, 2024
3949c45
fixed name
BalzaniEdoardo Nov 22, 2024
a33361a
fixed error multiline
BalzaniEdoardo Nov 25, 2024
5694714
fixed rendering eqns
BalzaniEdoardo Nov 25, 2024
3b884d1
last fixes
BalzaniEdoardo Nov 25, 2024
7dcb458
fixed emojis
BalzaniEdoardo Nov 25, 2024
bfb8f16
exclude site brain map
BalzaniEdoardo Nov 27, 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
15 changes: 13 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ venv.bak/
# Rope project settings
.ropeproject

# mkdocs documentation
/site
# sphinx build documentation
/docs/_build

# mypy
.mypy_cache/
Expand All @@ -143,3 +143,14 @@ docs/generated/

# nwb cahce
nwb-cache/

# scripting folder
_scripts/

# env variable for nwbs
docs/data/

# rst generated files
docs/stubs


15 changes: 8 additions & 7 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,14 @@ build:
pre_build:
- gem install html-proofer -v ">= 5.0.9" # Ensure version >= 5.0.9
post_build:
# Check everything but the reference (because mkdocstrings do not set href=)
- htmlproofer $READTHEDOCS_OUTPUT/html --checks Links,Scripts --ignore-urls "https://fonts.gstatic.com,https://www.jneurosci.org/content/25/47/11003" --assume-extension --check-external-hash --ignore-status-codes 403 --ignore-files "/.+\/html\/reference\/.+/"
# Check the reference allowing missing href
- htmlproofer $READTHEDOCS_OUTPUT/html/reference --assume-extension --check-external-hash --ignore-urls "https://fonts.gstatic.com" --allow-missing-href --ignore-status-codes 403

mkdocs:
configuration: mkdocs.yml
# Check everything except 403s and a jneurosci, which returns 404 but the link works when clicking.
- htmlproofer $READTHEDOCS_OUTPUT/html --checks Links,Scripts,Images --ignore-urls "https://fonts.gstatic.com,https://celltypes.brain-map.org/experiment/electrophysiology/478498617,https://www.jneurosci.org/content/25/47/11003" --assume-extension --check-external-hash --ignore-status-codes 403 --ignore-files "/.+\/_static\/.+/","/.+\/stubs\/.+/","/.+\/tutorials/plot_02_head_direction.+/"
# The auto-generated animation doesn't have a alt or src/srcset; I am able to ignore missing alt, but I cannot work around a missing src/srcset
# therefore for this file I am not checking the figures.
- htmlproofer $READTHEDOCS_OUTPUT/html/tutorials/plot_02_head_direction.html --checks Links,Scripts --ignore-urls "https://www.jneurosci.org/content/25/47/11003"
# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/conf.py

# Optionally declare the Python requirements required to build your docs
python:
Expand Down
Binary file removed docs/CCN-logo-wText.png
Binary file not shown.
21 changes: 21 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
BUILDDIR = _build

# Put it first so that "make" without argument is like "make help".
# Set an environ variable available during sphinx build
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
34 changes: 34 additions & 0 deletions docs/_templates/autosummary/class.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{{ fullname | escape | underline }}

.. currentmodule:: {{ module }}

.. autoclass:: {{ objname }}
:members:
:inherited-members:

{% block attributes %}
{% if attributes %}
.. rubric:: Attributes

.. autosummary::
:toctree: ./
{% for item in attributes %}
~{{ objname }}.{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}

{% block methods %}
.. automethod:: __init__

{% if methods %}
.. rubric:: Methods

.. autosummary::
:toctree: ./
{% for item in methods %}
~{{ objname }}.{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}

16 changes: 16 additions & 0 deletions docs/_templates/layout.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{% extends "!layout.html" %}

{%- block footer %}
<footer class="footer" style="border-top: 1px solid #ccc; padding-top: 10px">
<div class="container">
<div id="credits" style="width: 50%; float: left">
<p>
{% trans copyright=copyright|e %}&#169; Copyright {{ copyright }}, <a href="https://www.simonsfoundation.org/people/edoardo-balzani/">nemos authors</a>.{% endtrans %}<br/>
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> and the <a href="https://pydata-sphinx-theme.readthedocs.io/en/stable/">PyData Theme</a>.<br/>
</p>
</div>
<div id="version" style="color: #999; float: right; margin: 15px">v{{ version }}</div>
</div>
</div>
</footer>
{%- endblock %}
137 changes: 137 additions & 0 deletions docs/api_reference.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
.. _api_ref:

API Reference
=============

.. _nemos_glm:
The ``nemos.glm`` module
------------------------
Classes for creating Generalized Linear Models (GLMs) for both single neurons and neural populations.

.. currentmodule:: nemos.glm

.. autosummary::
:toctree: generated/glm
:recursive:
:nosignatures:

GLM
PopulationGLM

.. _nemos_basis:
The ``nemos.basis`` module
--------------------------
Provides basis function classes to construct and transform features for model inputs.

.. currentmodule:: nemos.basis

.. autosummary::
:toctree: generated/basis
:recursive:
:nosignatures:

Basis
SplineBasis
BSplineBasis
CyclicBSplineBasis
MSplineBasis
OrthExponentialBasis
RaisedCosineBasisLinear
RaisedCosineBasisLog
AdditiveBasis
MultiplicativeBasis
TransformerBasis

.. _observation_models:
The ``nemos.observation_models`` module
--------------------------------------
Statistical models to describe the distribution of neural responses or other predicted variables, given inputs.

.. currentmodule:: nemos.observation_models

.. autosummary::
:toctree: generated/observation_models
:recursive:
:nosignatures:

Observations
PoissonObservations
GammaObservations

.. _regularizers:
The ``nemos.regularizer`` module
--------------------------------
Implements various regularization techniques to constrain model parameters, which helps prevent overfitting.

.. currentmodule:: nemos.regularizer

.. autosummary::
:toctree: generated/regularizer
:recursive:
:nosignatures:

Regularizer
UnRegularized
Ridge
Lasso
GroupLasso

The ``nemos.simulation`` module
-------------------------------
Utility functions for simulating spiking activity in recurrently connected neural populations.

.. currentmodule:: nemos.simulation

.. autosummary::
:toctree: generated/simulation
:recursive:
:nosignatures:

simulate_recurrent
difference_of_gammas
regress_filter


The ``nemos.convolve`` module
-----------------------------
Utility functions for running convolution over the sample axis.

.. currentmodule:: nemos.convolve

.. autosummary::
:toctree: generated/regularizer
:recursive:
:nosignatures:

create_convolutional_predictor
tensor_convolve


The ``nemos.identifiability_constraints`` module
------------------------------------------------
Functions to apply identifiability constraints to rank-deficient feature matrices, ensuring the uniqueness of model
solutions.

.. currentmodule:: nemos.identifiability_constraints

.. autosummary::
:toctree: generated/identifiability_constraints
:recursive:
:nosignatures:

apply_identifiability_constraints
apply_identifiability_constraints_by_basis_component

The ``nemos.pytrees.FeaturePytree`` class
-----------------------------------------
Class for storing the input arrays in a dictionary. Keys are usually variable names.
These objects can be provided as input to nemos GLM methods.

.. currentmodule:: nemos.pytrees

.. autosummary::
:toctree: generated/identifiability_constraints
:recursive:
:nosignatures:

FeaturePytree
1 change: 1 addition & 0 deletions docs/assets/NeMoS_Logo_CMYK_White.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 0 additions & 3 deletions docs/assets/extra.css

This file was deleted.

File renamed without changes
Loading