Skip to content

Commit

Permalink
fix-notebookrun: update notebook TimeSeriesEDF content for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
915-Misan-Teodora committed Jul 31, 2024
1 parent ecffbbf commit d6df191
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 73 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/notebooks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,4 @@ jobs:
python -m pip install nbformat nbconvert
- name: Run notebooks
run: |
cd notebooks
python ../dev/notebook_runner.py .
run: python ./dev/notebook_runner.py notebooks
84 changes: 14 additions & 70 deletions notebooks/TimeSeriesEDF.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": null,
"id": "56d5c4b6-7804-46d6-931f-fcc5593977d1",
"metadata": {},
"outputs": [],
Expand All @@ -36,26 +36,13 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": null,
"id": "28420169-2274-4e0e-a73d-c1ab54e6da9c",
"metadata": {
"scrolled": true,
"tags": []
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"17-04-2024 05:02:37 - DEBUG - tvbwidgets - Package is not fully installed\n",
"17-04-2024 05:02:37 - DEBUG - tvbwidgets - Version read from the internal package.json file\n",
"17-04-2024 05:02:37 - INFO - tvbwidgets - Version: 2.0.0\n",
"Using matplotlib as 2D backend.\n",
" INFO Cannot import syncrypto library.\n",
"17-04-2024 05:02:49 - INFO - tvbwidgets.core.pse.parameters - ImportError: Dask dependency is not included, so this functionality won't be available\n"
]
}
],
"outputs": [],
"source": [
"import numpy as np\n",
"from tvbwidgets.api import plot_timeseries\n",
Expand All @@ -72,45 +59,27 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": null,
"id": "94687d23-0222-4e9f-887e-e97169737304",
"metadata": {
"tags": []
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Extracting EDF parameters from C:\\Work\\TVB\\tvb-widgets\\tvbwidgets\\tests\\data\\test_file.edf...\n",
"EDF file detected\n",
"Setting channel info structure...\n",
"Creating raw.info structure...\n"
]
}
],
"outputs": [],
"source": [
"edf_file_path = '../tvbwidgets/tests/data/test_file.edf' # replace path with your actual EDF file path\n",
"edf_file_path = 'tvbwidgets/tests/data/test_file.edf' # replace path with your actual EDF file path\n",
" # set this path file for notebooks tests\n",
"# you can use: '../tvbwidgets/tests/data/test_file.edf'\n",
"data, freq, index = read_edf_file(edf_file_path)"
]
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": null,
"id": "12da93b3-f96f-44cf-8555-52eee8aaecfd",
"metadata": {
"tags": []
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"(92000, 32)\n",
"400.0\n"
]
}
],
"outputs": [],
"source": [
"print(data.shape)\n",
"print(freq)"
Expand All @@ -126,7 +95,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": null,
"id": "cac83fe3-b4fe-486a-8955-70203dda1004",
"metadata": {},
"outputs": [],
Expand All @@ -136,35 +105,10 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": null,
"id": "20c3eae2-49dd-4d01-af9a-06a0dba15888",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"17-04-2024 05:02:49 - INFO - tvbwidgets.ui.ts.plotly_ts_widget - TimeSeries Widget with Plotly initialized\n",
"Creating RawArray with float64 data, n_channels=32, n_times=92000\n",
" Range : 0 ... 91999 = 0.000 ... 229.998 secs\n",
"Ready.\n"
]
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "28d8ffb85be94f28b59e85b521e4aeeb",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"TimeSeriesWidgetPlotly(children=(HBox(children=(Output(),)), VBox(children=(Dropdown(description='Colormap:', …"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"outputs": [],
"source": [
"tsw = plot_timeseries(data=data, sample_freq=freq, ch_idx=index, backend=backend)"
]
Expand Down Expand Up @@ -194,7 +138,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.18"
"version": "3.9.19"
}
},
"nbformat": 4,
Expand Down

0 comments on commit d6df191

Please sign in to comment.