From 62a39f23978db53260f8544946fccf018e41751a Mon Sep 17 00:00:00 2001 From: Lukas Adamowicz Date: Fri, 1 Mar 2024 14:51:47 -0500 Subject: [PATCH 1/3] add skdh preprocessing extensions to mock --- docs/conf.py | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/conf.py b/docs/conf.py index c721f0b5..c7b6fdaa 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -243,6 +243,7 @@ "skdh.features.lib.extensions", "skdh.io._extensions", "skdh.utility._extensions", + "skdh.preprocessing._extensions", ] # ----------------------------------------------------------------------------- From 63848a14766ac3d330bdfd84a549bed8ec0976e4 Mon Sep 17 00:00:00 2001 From: Lukas Adamowicz Date: Fri, 1 Mar 2024 15:30:52 -0500 Subject: [PATCH 2/3] documentation updates, take2 on #139 --- docs/conf.py | 9 +- docs/index.rst | 132 +++++++++----------------- docs/ref/activity.rst | 2 +- docs/ref/context.rst | 2 +- docs/ref/features.rst | 2 +- docs/ref/gait.rst | 2 +- docs/ref/gait_old.rst | 2 +- docs/ref/io.rst | 2 +- docs/ref/preprocessing.rst | 2 +- docs/ref/sit2stand.rst | 2 +- docs/ref/skdh.rst | 2 +- docs/ref/sleep.rst | 2 +- docs/ref/utility.rst | 2 +- docs/requirements.txt | 2 +- docs/src/dev/adding_documentation.rst | 76 +++++++-------- docs/src/installation.rst | 30 +++--- src/skdh/gait_old/__init__.py | 14 +-- 17 files changed, 123 insertions(+), 162 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index c7b6fdaa..5ddc5f2a 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -48,7 +48,7 @@ "sphinx.ext.autosummary", "numpydoc", "sphinx.ext.coverage", - "sphinx_panels", + "sphinx_design", ] # this is needed for some reason... @@ -73,7 +73,7 @@ # # This is also used if you do content translation via gettext catalogs. # Usually you set "language" from the command line for these cases. -language = None +language = "en" # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. @@ -246,9 +246,4 @@ "skdh.preprocessing._extensions", ] -# ----------------------------------------------------------------------------- -# Sphinx Panels -# ----------------------------------------------------------------------------- -panels_add_bootstrapp_css = False - # -- Extension configuration ------------------------------------------------- diff --git a/docs/index.rst b/docs/index.rst index 9f8c57a5..7a369d7c 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -12,91 +12,53 @@ Scikit Digital Health `SciKit-Digital-Health` is a Python package with methods for reading, pre-processing, manipulating, and analyzing Inertial Meausurement Unit data. `scikit-digital-health` contains the following sub-modules: -.. panels:: - :img-top-cls: pl-3 pr-3 - :card: shadow - - :img-top: _static/skdh_io.svg - - :badge:`skdh.io,badge-primary` - - +++ - .. link-button:: skdh io - :type: ref - :text: Ingestion of common binary data files and generic data stores. - :classes: btn-outline-primary stretched-link btn-block - - --- - :img-top: _static/skdh_preproc.svg - :badge:`skdh.preprocessing,badge-primary` - +++ - .. link-button:: skdh preprocessing - :type: ref - :text: Pre-processing algorithms for inertial data. - :classes: btn-outline-primary stretched-link btn-block - - --- - :img-top: _static/skdh_context.svg - :badge:`skdh.context,badge-primary` - +++ - .. link-button:: skdh context - :type: ref - :text: Context detection methods for inertial sensor data. - :classes: btn-outline-primary stretched-link btn-block - - --- - :img-top: _static/skdh_gait.svg - :badge:`skdh.gait,badge-primary` - +++ - .. link-button:: skdh gait - :type: ref - :text: Gait detection and analysis from lumbar inertial data. - :classes: btn-outline-primary stretched-link btn-block - - --- - :img-top: _static/skdh_s2s.svg - :badge:`skdh.sit2stand,badge-primary` - +++ - .. link-button:: skdh sit2stand - :type: ref - :text: Sit-to-stand detection and analysis from lumbar inertial data. - :classes: btn-outline-primary stretched-link btn-block - - --- - :img-top: _static/skdh_activity.svg - :badge:`skdh.activity,badge-primary` - +++ - .. link-button:: skdh activity - :type: ref - :text: Actigraphy & activity analysis from inertial data. - :classes: btn-outline-primary stretched-link btn-block - - --- - :img-top: _static/skdh_sleep.svg - :badge:`skdh.sleep,badge-primary` - +++ - .. link-button:: skdh sleep - :type: ref - :text: Sleep detection and analysis from wrist inertial data. - :classes: btn-outline-primary stretched-link btn-block - - --- - :img-top: _static/skdh_features.svg - :badge:`skdh.features,badge-primary` - +++ - .. link-button:: skdh features - :type: ref - :text: Common time-series signal features. - :classes: btn-outline-primary stretched-link btn-block - - --- - :img-top: _static/skdh_utility.svg - :badge:`skdh.utility,badge-primary` - +++ - .. link-button:: skdh utility - :type: ref - :text: Utility functions for time-series analysis. - :classes: btn-outline-primary stretched-link btn-block +.. grid:: 1 2 2 2 + :gutter: 2 + + .. grid-item-card:: :bdg-primary:`skdh.io` + :img-top: _static/skdh_io.svg + :link: skdh-io + :link-type: ref + + .. grid-item-card:: :bdg-primary:`skdh.preprocessing` + :img-top: _static/skdh_preproc.svg + :link: skdh-preprocessing + :link-type: ref + + .. grid-item-card:: :bdg-primary:`skdh.context` + :img-top: _static/skdh_context.svg + :link: skdh-context + :link-type: ref + + .. grid-item-card:: :bdg-primary:`skdh.gait` + :img-top: _static/skdh_gait.svg + :link: skdh-gait + :link-type: ref + + .. grid-item-card:: :bdg-primary:`skdh.sit2stand` + :img-top: _static/skdh_s2s.svg + :link: skdh-sit2stand + :link-type: ref + + .. grid-item-card:: :bdg-primary:`skdh.activity` + :img-top: _static/skdh_activity.svg + :link: skdh-activity + :link-type: ref + + .. grid-item-card:: :bdg-primary:`skdh.sleep` + :img-top: _static/skdh_sleep.svg + :link: skdh-sleep + :link-type: ref + + .. grid-item-card:: :bdg-primary:`skdh.features` + :img-top: _static/skdh_features.svg + :link: skdh-features + :link-type: ref + + .. grid-item-card:: :bdg-primary:`skdh.utility` + :img-top: _static/skdh_utility.svg + :link: skdh-utility + :link-type: ref .. diff --git a/docs/ref/activity.rst b/docs/ref/activity.rst index c533838b..7d4d90fe 100644 --- a/docs/ref/activity.rst +++ b/docs/ref/activity.rst @@ -1,4 +1,4 @@ -.. _skdh activity: +.. _skdh-activity: .. automodule:: skdh.activity :ignore-module-all: diff --git a/docs/ref/context.rst b/docs/ref/context.rst index 7fe8f383..aa6317ef 100644 --- a/docs/ref/context.rst +++ b/docs/ref/context.rst @@ -1,4 +1,4 @@ -.. _skdh context: +.. _skdh-context: .. automodule:: skdh.context :ignore-module-all: diff --git a/docs/ref/features.rst b/docs/ref/features.rst index ad1be0b4..c7723c74 100644 --- a/docs/ref/features.rst +++ b/docs/ref/features.rst @@ -1,4 +1,4 @@ -.. _skdh features: +.. _skdh-features: .. automodule:: skdh.features :ignore-module-all: diff --git a/docs/ref/gait.rst b/docs/ref/gait.rst index 2a319930..6a83e71f 100644 --- a/docs/ref/gait.rst +++ b/docs/ref/gait.rst @@ -1,4 +1,4 @@ -.. _skdh gait: +.. _skdh-gait: .. automodule:: skdh.gait :ignore-module-all: diff --git a/docs/ref/gait_old.rst b/docs/ref/gait_old.rst index a4373009..974aff3e 100644 --- a/docs/ref/gait_old.rst +++ b/docs/ref/gait_old.rst @@ -1,4 +1,4 @@ -.. _skdh gait_old: +.. _skdh-gait_old: .. automodule:: skdh.gait_old :ignore-module-all: diff --git a/docs/ref/io.rst b/docs/ref/io.rst index 3e1b2c4a..394e7a51 100644 --- a/docs/ref/io.rst +++ b/docs/ref/io.rst @@ -1,4 +1,4 @@ -.. _skdh io: +.. _skdh-io: .. automodule:: skdh.io :ignore-module-all: diff --git a/docs/ref/preprocessing.rst b/docs/ref/preprocessing.rst index d778d3fc..773875fa 100644 --- a/docs/ref/preprocessing.rst +++ b/docs/ref/preprocessing.rst @@ -1,4 +1,4 @@ -.. _skdh preprocessing: +.. _skdh-preprocessing: .. automodule:: skdh.preprocessing :ignore-module-all: \ No newline at end of file diff --git a/docs/ref/sit2stand.rst b/docs/ref/sit2stand.rst index 47bfddae..c53344df 100644 --- a/docs/ref/sit2stand.rst +++ b/docs/ref/sit2stand.rst @@ -1,4 +1,4 @@ -.. _skdh sit2stand: +.. _skdh-sit2stand: .. automodule:: skdh.sit2stand :ignore-module-all: diff --git a/docs/ref/skdh.rst b/docs/ref/skdh.rst index 4d7ceec1..65b444d2 100644 --- a/docs/ref/skdh.rst +++ b/docs/ref/skdh.rst @@ -1,4 +1,4 @@ -.. _skdh base: +.. _skdh-base: .. automodule:: skdh :ignore-module-all: diff --git a/docs/ref/sleep.rst b/docs/ref/sleep.rst index ddbbcb93..d5aa9784 100644 --- a/docs/ref/sleep.rst +++ b/docs/ref/sleep.rst @@ -1,4 +1,4 @@ -.. _skdh sleep: +.. _skdh-sleep: .. automodule:: skdh.sleep :ignore-module-all: diff --git a/docs/ref/utility.rst b/docs/ref/utility.rst index b6d280a5..818db650 100644 --- a/docs/ref/utility.rst +++ b/docs/ref/utility.rst @@ -1,4 +1,4 @@ -.. _skdh utility: +.. _skdh-utility: .. automodule:: skdh.utility :ignore-module-all: diff --git a/docs/requirements.txt b/docs/requirements.txt index 529f840a..a0619823 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -5,4 +5,4 @@ matplotlib numpydoc sphinx>=2.2.0 pydata-sphinx-theme -sphinx-panels \ No newline at end of file +sphinx-design \ No newline at end of file diff --git a/docs/src/dev/adding_documentation.rst b/docs/src/dev/adding_documentation.rst index da346f7f..7ee0b281 100644 --- a/docs/src/dev/adding_documentation.rst +++ b/docs/src/dev/adding_documentation.rst @@ -19,7 +19,7 @@ Other than this, the docstrings will be automatically scanned and generated, wit Documentation of the your new module occurs almost fully in the ``__init__.py`` file for the module. This will contain any information on the module, how it works, as -well as any relevant background information (e.g. :ref:`Gait `). For +well as any relevant background information (e.g. :ref:`Gait `). For another good reference from NumPy, see the `numpy.fft `_ page. @@ -27,61 +27,63 @@ Next is the file directing Sphinx to automatically find and document the custom module, ``docs/ref/custom_module.rst``. Finally, to make the new module show up in the API reference, add it to the ``docs/ref/index.rst`` toctree! -.. tabbed:: src/skdh/custom_module/\_\_init\_\_.py - :selected: +.. tab-set:: - .. code-block:: python + .. tab-item:: src/skdh/custom_module/\_\_init\_\_.py + :selected: - """ - IMU (:mod:`skdh.custom_module`) - =============================================== + .. code-block:: python - .. currentmodule:: skdh.custom_module + """ + IMU (:mod:`skdh.custom_module`) + =============================================== - Inertial sensor - ------------------------------- + .. currentmodule:: skdh.custom_module - .. _Remove the `` below + Inertial sensor + ------------------------------- - .. ``autosummary``:: - :toctree: generated/ + .. _Remove the `` below - CustomClass .. _this is the name of your class + .. ``autosummary``:: + :toctree: generated/ - Headline 2 - ---------- - content - """ - from skdh.custom_module.custom_module import CustomModule + CustomClass .. _this is the name of your class -.. tabbed:: docs/ref/custom_module.rst + Headline 2 + ---------- + content + """ + from skdh.custom_module.custom_module import CustomModule - .. code:: rst + .. tab-item:: docs/ref/custom_module.rst - .. - _Give it a custom explicit reference label + .. code:: rst - .. _skdh custom-module: + .. + _Give it a custom explicit reference label - .. automodule:: skdh.custom_module - :ignore-module-all: + .. _skdh custom-module: -.. tabbed:: docs/ref/index.rst + .. automodule:: skdh.custom_module + :ignore-module-all: - .. code:: rst + .. tab-item:: docs/ref/index.rst - .. _skdh api reference: + .. code:: rst - API Reference - ============= + .. _skdh api reference: - .. toctree:: - :maxdepth: 2 + API Reference + ============= - gait - sit2stand - read - custom_module + .. toctree:: + :maxdepth: 2 + + gait + sit2stand + read + custom_module And thats it! Before pushing and creating a pull request, make sure that the documentation builds properly: diff --git a/docs/src/installation.rst b/docs/src/installation.rst index 7da38005..ff3babac 100644 --- a/docs/src/installation.rst +++ b/docs/src/installation.rst @@ -3,28 +3,30 @@ Installation Both PyPI and Conda-Forge should have pre-built wheels for major distributions. -.. tabbed:: conda +.. tab-set:: - :: + .. tab-item:: conda - conda install -c conda-forge scikit-digital-health + :: -.. tabbed:: pip - :selected: + conda install -c conda-forge scikit-digital-health - :: + .. tab-item:: pip + :selected: - pip install scikit-digital-health + :: -.. tabbed:: pip from GitHub + pip install scikit-digital-health - :: + .. tab-item:: pip from GitHub - pip install git+ssh://git@github.com/PfizerRD/scikit-digital-health.git - # install from a specific tag - pip install git+ssh://git@github.com/PfizerRD/scikit-digital-health@0.9.10 - # install from a specific branch - pip install git+ssh://git@github.com/PfizerRD/scikit-digital-health@development + :: + + pip install git+ssh://git@github.com/PfizerRD/scikit-digital-health.git + # install from a specific tag + pip install git+ssh://git@github.com/PfizerRD/scikit-digital-health@0.9.10 + # install from a specific branch + pip install git+ssh://git@github.com/PfizerRD/scikit-digital-health@development Run-time requirements ^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/skdh/gait_old/__init__.py b/src/skdh/gait_old/__init__.py index 34ba5e6b..20888fe0 100644 --- a/src/skdh/gait_old/__init__.py +++ b/src/skdh/gait_old/__init__.py @@ -56,13 +56,13 @@ :: -| IC FC IC FC IC FC -| i-1 i-1 i+1 i+1 i+3 i+3 -| L |--------------| |--------------| |--------------| -| R |--------------| |--------------| -| i i i+2 i+2 -| IC FC IC FC -| time ---> + | IC FC IC FC IC FC + | i-1 i-1 i+1 i+1 i+3 i+3 + | L |--------------| |--------------| |--------------| + | R |--------------| |--------------| + | i i i+2 i+2 + | IC FC IC FC + | time ---> General terminology: From 9c8b7b6d7caa3192e1b35ef1a3077bc69c54779b Mon Sep 17 00:00:00 2001 From: Lukas Adamowicz Date: Fri, 1 Mar 2024 15:34:07 -0500 Subject: [PATCH 3/3] post version for documentation --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 874aa520..79298bc8 100644 --- a/meson.build +++ b/meson.build @@ -1,7 +1,7 @@ project( 'scikit-digital-health', 'c', - version: '0.14.1', + version: '0.14.1.post1', license: 'MIT', meson_version: '>=1.1', )