Skip to content

Commit

Permalink
Merge pull request #113 from ghammad/develop
Browse files Browse the repository at this point in the history
Fix allowing interactive plots in tutorials
  • Loading branch information
ghammad authored Jan 30, 2023
2 parents cd86663 + e1fe81d commit d0f440f
Show file tree
Hide file tree
Showing 17 changed files with 1,487,378 additions and 1,044 deletions.
12 changes: 7 additions & 5 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import time
# sys.path.insert(0, os.path.abspath('.'))
import sphinx_bootstrap_theme
# import pydata_sphinx_theme

from sphinx.ext.autosummary import Autosummary
from sphinx.ext.autosummary import get_documenter
Expand Down Expand Up @@ -80,10 +81,10 @@ def run(self):

def setup(app):
app.add_directive('autoautosummary', AutoAutoSummary)
app.add_js_file(
'https://cdnjs.cloudflare.com/ajax/libs/require.js/2.1.10/'
'require.min.js'
)
# app.add_js_file(
# 'https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/'
# 'require.min.js'
# )
# -- Project information -----------------------------------------------------


Expand Down Expand Up @@ -135,7 +136,7 @@ def setup(app):
master_doc = 'index'

# The language for content autogenerated by Sphinx.
language = None
language = 'en'

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
Expand All @@ -159,6 +160,7 @@ def setup(app):
#
# html_theme = 'alabaster'
html_theme = 'bootstrap'
# html_theme = 'pydata_sphinx_theme'
html_theme_path = sphinx_bootstrap_theme.get_html_theme_path()

# (Optional) Logo. Should be small enough to fit the navbar (ideally 24x24).
Expand Down
203 changes: 173 additions & 30 deletions docs/source/pyActigraphy-Batch.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -37,26 +37,41 @@
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"execution_count": 1,
"metadata": {
"ExecuteTime": {
"end_time": "2023-01-30T15:41:46.327155Z",
"start_time": "2023-01-30T15:41:44.633568Z"
}
},
"outputs": [],
"source": [
"import pyActigraphy"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"execution_count": 2,
"metadata": {
"ExecuteTime": {
"end_time": "2023-01-30T15:41:46.330210Z",
"start_time": "2023-01-30T15:41:46.328528Z"
}
},
"outputs": [],
"source": [
"import os"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"execution_count": 3,
"metadata": {
"ExecuteTime": {
"end_time": "2023-01-30T15:41:46.333405Z",
"start_time": "2023-01-30T15:41:46.331641Z"
}
},
"outputs": [],
"source": [
"# retrieve path to example files\n",
Expand All @@ -65,8 +80,13 @@
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"execution_count": 4,
"metadata": {
"ExecuteTime": {
"end_time": "2023-01-30T15:41:46.336437Z",
"start_time": "2023-01-30T15:41:46.334806Z"
}
},
"outputs": [],
"source": [
"import plotly.graph_objs as go"
Expand All @@ -88,8 +108,13 @@
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"execution_count": 5,
"metadata": {
"ExecuteTime": {
"end_time": "2023-01-30T15:41:46.428326Z",
"start_time": "2023-01-30T15:41:46.337386Z"
}
},
"outputs": [],
"source": [
"# Read test files\n",
Expand All @@ -112,9 +137,25 @@
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"execution_count": 6,
"metadata": {
"ExecuteTime": {
"end_time": "2023-01-30T15:41:46.433922Z",
"start_time": "2023-01-30T15:41:46.429362Z"
}
},
"outputs": [
{
"data": {
"text/plain": [
"6"
]
},
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# Check how many files have been read\n",
"len(raw.readers)"
Expand All @@ -129,9 +170,30 @@
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"execution_count": 7,
"metadata": {
"ExecuteTime": {
"end_time": "2023-01-30T15:41:46.439849Z",
"start_time": "2023-01-30T15:41:46.436095Z"
}
},
"outputs": [
{
"data": {
"text/plain": [
"['example_04',\n",
" 'example_05',\n",
" 'example_02',\n",
" 'example_03',\n",
" 'example_01',\n",
" 'example_01_mask']"
]
},
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"raw.names()"
]
Expand Down Expand Up @@ -176,9 +238,30 @@
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"execution_count": 8,
"metadata": {
"ExecuteTime": {
"end_time": "2023-01-30T15:41:46.449351Z",
"start_time": "2023-01-30T15:41:46.442320Z"
}
},
"outputs": [
{
"data": {
"text/plain": [
"{'example_04': Timedelta('21 days 17:39:00'),\n",
" 'example_05': Timedelta('15 days 01:43:00'),\n",
" 'example_02': Timedelta('12 days 18:53:00'),\n",
" 'example_03': Timedelta('14 days 21:36:00'),\n",
" 'example_01': Timedelta('12 days 18:41:00'),\n",
" 'example_01_mask': Timedelta('12 days 18:41:00')}"
]
},
"execution_count": 8,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# Check the duration of the recording\n",
"raw.duration()"
Expand All @@ -200,18 +283,60 @@
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"execution_count": 9,
"metadata": {
"ExecuteTime": {
"end_time": "2023-01-30T15:41:46.483322Z",
"start_time": "2023-01-30T15:41:46.451156Z"
}
},
"outputs": [
{
"data": {
"text/plain": [
"{'example_04': 0.2551624866267735,\n",
" 'example_05': 0.6595438549841431,\n",
" 'example_02': 0.5237758757150337,\n",
" 'example_03': 0.3720781873681576,\n",
" 'example_01': 0.527656245354158,\n",
" 'example_01_mask': 0.44565929945478583}"
]
},
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"raw.IS()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"execution_count": 10,
"metadata": {
"ExecuteTime": {
"end_time": "2023-01-30T15:41:47.201192Z",
"start_time": "2023-01-30T15:41:46.484579Z"
}
},
"outputs": [
{
"data": {
"text/plain": [
"{'example_04': 0.03815016462875074,\n",
" 'example_05': 0.030282109908435897,\n",
" 'example_02': 0.026240794466679603,\n",
" 'example_03': 0.023099082226598566,\n",
" 'example_01': 0.033762534539447164,\n",
" 'example_01_mask': 0.036345931354120085}"
]
},
"execution_count": 10,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"raw.kAR(0)"
]
Expand All @@ -232,9 +357,27 @@
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"execution_count": 11,
"metadata": {
"ExecuteTime": {
"end_time": "2023-01-30T15:41:47.206264Z",
"start_time": "2023-01-30T15:41:47.202292Z"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Object type: <class 'pyActigraphy.io.awd.awd.RawAWD'>. Name: example_04. Duration of the recording: 21 days 17:39:00. Number of acquisition points: 31299\n",
"Object type: <class 'pyActigraphy.io.awd.awd.RawAWD'>. Name: example_05. Duration of the recording: 15 days 01:43:00. Number of acquisition points: 21703\n",
"Object type: <class 'pyActigraphy.io.awd.awd.RawAWD'>. Name: example_02. Duration of the recording: 12 days 18:53:00. Number of acquisition points: 18413\n",
"Object type: <class 'pyActigraphy.io.awd.awd.RawAWD'>. Name: example_03. Duration of the recording: 14 days 21:36:00. Number of acquisition points: 21456\n",
"Object type: <class 'pyActigraphy.io.awd.awd.RawAWD'>. Name: example_01. Duration of the recording: 12 days 18:41:00. Number of acquisition points: 18401\n",
"Object type: <class 'pyActigraphy.io.awd.awd.RawAWD'>. Name: example_01_mask. Duration of the recording: 12 days 18:41:00. Number of acquisition points: 18401\n"
]
}
],
"source": [
"for iread in raw.readers:\n",
" print(\"Object type: {}. Name: {}. Duration of the recording: {}. Number of acquisition points: {}\".format(type(iread),iread.name,iread.duration(),len(iread.data)))"
Expand All @@ -258,9 +401,9 @@
"metadata": {
"celltoolbar": "Raw Cell Format",
"kernelspec": {
"display_name": "Python 3",
"display_name": "pyActi37",
"language": "python",
"name": "python3"
"name": "pyacti37"
},
"language_info": {
"codemirror_mode": {
Expand Down
Loading

0 comments on commit d0f440f

Please sign in to comment.