CBACABLab 0.0.7__tar.gz → 0.1.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {cbacablab-0.0.7 → cbacablab-0.1.2}/.github/workflows/tests.yml +2 -2
- {cbacablab-0.0.7 → cbacablab-0.1.2}/Analysis.ipynb +95 -93
- {cbacablab-0.0.7 → cbacablab-0.1.2}/AnalysisTesting.ipynb +8 -8
- cbacablab-0.1.2/PKG-INFO +156 -0
- cbacablab-0.1.2/README.md +127 -0
- {cbacablab-0.0.7 → cbacablab-0.1.2}/pyproject.toml +17 -15
- {cbacablab-0.0.7 → cbacablab-0.1.2}/src/CBACABLab/LikertPrep.py +3 -3
- {cbacablab-0.0.7 → cbacablab-0.1.2}/src/CBACABLab/LoadRawData.py +51 -48
- {cbacablab-0.0.7 → cbacablab-0.1.2}/src/CBACABLab/LoadSQLData.py +20 -10
- {cbacablab-0.0.7 → cbacablab-0.1.2}/src/CBACABLab/__init__.py +1 -1
- cbacablab-0.1.2/src/CBACABLab/_paths.py +27 -0
- cbacablab-0.1.2/src/CBACABLab/mcp_server.py +299 -0
- {cbacablab-0.0.7 → cbacablab-0.1.2}/tests/test_public_api.py +108 -4
- cbacablab-0.0.7/PKG-INFO +0 -52
- cbacablab-0.0.7/README.md +0 -22
- {cbacablab-0.0.7 → cbacablab-0.1.2}/.gitattributes +0 -0
- {cbacablab-0.0.7 → cbacablab-0.1.2}/.github/workflows/codeql.yml +0 -0
- {cbacablab-0.0.7 → cbacablab-0.1.2}/.gitignore +0 -0
- {cbacablab-0.0.7 → cbacablab-0.1.2}/.pylintrc +0 -0
- {cbacablab-0.0.7 → cbacablab-0.1.2}/LICENSE +0 -0
- {cbacablab-0.0.7 → cbacablab-0.1.2}/SECURITY.md +0 -0
- {cbacablab-0.0.7 → cbacablab-0.1.2}/Survey.csv +0 -0
- {cbacablab-0.0.7 → cbacablab-0.1.2}/Survey.xlsx +0 -0
- {cbacablab-0.0.7 → cbacablab-0.1.2}/qualtrics_script/standard_question.js +0 -0
- {cbacablab-0.0.7 → cbacablab-0.1.2}/sensorData/001_00010.csv +0 -0
- {cbacablab-0.0.7 → cbacablab-0.1.2}/sensorData/002_00009.csv +0 -0
- {cbacablab-0.0.7 → cbacablab-0.1.2}/sensorData/003_00008.csv +0 -0
- {cbacablab-0.0.7 → cbacablab-0.1.2}/sensorData/004_00007.csv +0 -0
- {cbacablab-0.0.7 → cbacablab-0.1.2}/sensorData/005_00006.csv +0 -0
- {cbacablab-0.0.7 → cbacablab-0.1.2}/sensorData/006_00005.csv +0 -0
- {cbacablab-0.0.7 → cbacablab-0.1.2}/sensorData/007_00004.csv +0 -0
- {cbacablab-0.0.7 → cbacablab-0.1.2}/sensorData/008_00003.csv +0 -0
- {cbacablab-0.0.7 → cbacablab-0.1.2}/sensorData/009_00002.csv +0 -0
- {cbacablab-0.0.7 → cbacablab-0.1.2}/sensorData/010_00001.csv +0 -0
- {cbacablab-0.0.7 → cbacablab-0.1.2}/src/CBACABLab/Plots.py +0 -0
- {cbacablab-0.0.7 → cbacablab-0.1.2}/src/CBACABLab/Util.py +0 -0
- {cbacablab-0.0.7 → cbacablab-0.1.2}/src/CBACABLab/settings.json +0 -0
- {cbacablab-0.0.7 → cbacablab-0.1.2}/tests/dummy-data +0 -0
- {cbacablab-0.0.7 → cbacablab-0.1.2}/tests/scripts +0 -0
|
@@ -13,9 +13,9 @@ jobs:
|
|
|
13
13
|
- uses: actions/checkout@v4
|
|
14
14
|
- uses: actions/setup-python@v5
|
|
15
15
|
with:
|
|
16
|
-
python-version: "3.
|
|
16
|
+
python-version: "3.12"
|
|
17
17
|
cache: pip
|
|
18
18
|
- name: Install package and test runner
|
|
19
|
-
run: python -m pip install . pytest
|
|
19
|
+
run: python -m pip install --editable . pytest pytest-asyncio
|
|
20
20
|
- name: Run tests
|
|
21
21
|
run: python -m pytest
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
},
|
|
34
34
|
{
|
|
35
35
|
"cell_type": "code",
|
|
36
|
-
"execution_count":
|
|
36
|
+
"execution_count": 1,
|
|
37
37
|
"id": "2a4d7871",
|
|
38
38
|
"metadata": {},
|
|
39
39
|
"outputs": [],
|
|
@@ -49,31 +49,33 @@
|
|
|
49
49
|
"source": [
|
|
50
50
|
"## Settings\n",
|
|
51
51
|
"\n",
|
|
52
|
-
"Change these to match your study. The question names (like `Q1`) are the question names from your Qualtrics survey."
|
|
52
|
+
"Change these to match your study. The question names (like `Q1`) are the question names from your Qualtrics survey. `STUDY_DIR` defaults to the kernel's current working directory, which may not be the notebook's folder. If the printed folder is not your study folder, set it to the full path of that folder."
|
|
53
53
|
]
|
|
54
54
|
},
|
|
55
55
|
{
|
|
56
56
|
"cell_type": "code",
|
|
57
|
-
"execution_count":
|
|
57
|
+
"execution_count": null,
|
|
58
58
|
"id": "95f44874",
|
|
59
59
|
"metadata": {},
|
|
60
60
|
"outputs": [],
|
|
61
61
|
"source": [
|
|
62
|
+
"from pathlib import Path\n",
|
|
62
63
|
"import CBACABLab\n",
|
|
63
64
|
"\n",
|
|
64
|
-
"#
|
|
65
|
-
"
|
|
65
|
+
"# Change STUDY_DIR if the kernel's working directory is not your study folder.\n",
|
|
66
|
+
"STUDY_DIR = Path(\".\").expanduser().resolve()\n",
|
|
67
|
+
"print(f\"Looking for study files in: {STUDY_DIR}\")\n",
|
|
66
68
|
"\n",
|
|
67
|
-
"DATABASE = \"data.db\" # file created to store your data\n",
|
|
68
|
-
"SURVEY_FILE = \"Survey.xlsx\" #
|
|
69
|
-
"SURVEY_CSV_FILE = \"Survey.csv\" #
|
|
70
|
-
"SENSOR_FOLDER = \"
|
|
69
|
+
"DATABASE = STUDY_DIR / \"data.db\" # file created to store your data\n",
|
|
70
|
+
"SURVEY_FILE = STUDY_DIR / \"Survey.xlsx\" # Excel version of the Qualtrics survey\n",
|
|
71
|
+
"SURVEY_CSV_FILE = STUDY_DIR / \"Survey.csv\" # CSV export with 'Use internal IDs in header' checked\n",
|
|
72
|
+
"SENSOR_FOLDER = STUDY_DIR / \"sensorData\" # folder containing iMotions sensor data\n",
|
|
71
73
|
"\n",
|
|
72
74
|
"# Autodetects and matches survey question ids (QIDs) to the question names. \n",
|
|
73
75
|
"question_mapping = CBACABLab.AutoDetermineQuestionIdtoQuestionNameMapping(surveyName=SURVEY_FILE, surveyCSVName=SURVEY_CSV_FILE)\n",
|
|
74
76
|
"\n",
|
|
75
77
|
"# Questions at the respondent level (e.g. demographics, fact based, etc.) that should not be connected\n",
|
|
76
|
-
"# to
|
|
78
|
+
"# to instrument/sensor data.\n",
|
|
77
79
|
"RESPONDENT_QUESTIONS = [\"Q4_4\", \"Q5_4\", \"Q6\", \"Q7\"]\n",
|
|
78
80
|
"\n",
|
|
79
81
|
"# Example of Likert questions (e.g. Strongly disagree ... Strongly agree) and the number each answer maps to. \n",
|
|
@@ -152,9 +154,9 @@
|
|
|
152
154
|
"name": "stderr",
|
|
153
155
|
"output_type": "stream",
|
|
154
156
|
"text": [
|
|
155
|
-
"Processing sensor files: 100%|██████████| 10/10 [00:
|
|
156
|
-
"Processing sensor files: 100%|██████████| 10/10 [00:02<00:00, 3.
|
|
157
|
-
"Processing sensor files: 100%|██████████| 10/10 [00:03<00:00, 3.
|
|
157
|
+
"Processing sensor files: 100%|██████████| 10/10 [00:02<00:00, 3.42it/s]\n",
|
|
158
|
+
"Processing sensor files: 100%|██████████| 10/10 [00:02<00:00, 3.80it/s]\n",
|
|
159
|
+
"Processing sensor files: 100%|██████████| 10/10 [00:03<00:00, 3.15it/s]\n"
|
|
158
160
|
]
|
|
159
161
|
},
|
|
160
162
|
{
|
|
@@ -1016,8 +1018,8 @@
|
|
|
1016
1018
|
"Dep. Variable: pupil_left_normalized R-squared: 0.146\n",
|
|
1017
1019
|
"Model: OLS Adj. R-squared: 0.083\n",
|
|
1018
1020
|
"Method: Least Squares F-statistic: 1.227\n",
|
|
1019
|
-
"Date:
|
|
1020
|
-
"Time:
|
|
1021
|
+
"Date: Tue, 01 Dec 2026 Prob (F-statistic): 0.338\n",
|
|
1022
|
+
"Time: 09:25:44 Log-Likelihood: -40.203\n",
|
|
1021
1023
|
"No. Observations: 30 AIC: 86.41\n",
|
|
1022
1024
|
"Df Residuals: 27 BIC: 90.61\n",
|
|
1023
1025
|
"Df Model: 2 \n",
|
|
@@ -1244,7 +1246,7 @@
|
|
|
1244
1246
|
"name": "stderr",
|
|
1245
1247
|
"output_type": "stream",
|
|
1246
1248
|
"text": [
|
|
1247
|
-
"100%|██████████| 100/100 [00:03<00:00,
|
|
1249
|
+
"100%|██████████| 100/100 [00:03<00:00, 28.75it/s]\n"
|
|
1248
1250
|
]
|
|
1249
1251
|
},
|
|
1250
1252
|
{
|
|
@@ -1282,9 +1284,9 @@
|
|
|
1282
1284
|
" <td>-0.038361</td>\n",
|
|
1283
1285
|
" <td>-0.009587</td>\n",
|
|
1284
1286
|
" <td>-0.009589</td>\n",
|
|
1285
|
-
" <td>-0.
|
|
1286
|
-
" <td>0.
|
|
1287
|
-
" <td>0.
|
|
1287
|
+
" <td>-0.876911</td>\n",
|
|
1288
|
+
" <td>0.760554</td>\n",
|
|
1289
|
+
" <td>0.86</td>\n",
|
|
1288
1290
|
" </tr>\n",
|
|
1289
1291
|
" </tbody>\n",
|
|
1290
1292
|
"</table>\n",
|
|
@@ -1292,10 +1294,10 @@
|
|
|
1292
1294
|
],
|
|
1293
1295
|
"text/plain": [
|
|
1294
1296
|
" beta marginal marginal_discrete lower_bound \\\n",
|
|
1295
|
-
"pupil_left_normalized -0.038361 -0.009587 -0.009589 -0.
|
|
1297
|
+
"pupil_left_normalized -0.038361 -0.009587 -0.009589 -0.876911 \n",
|
|
1296
1298
|
"\n",
|
|
1297
1299
|
" upper_bound p_value \n",
|
|
1298
|
-
"pupil_left_normalized
|
|
1300
|
+
"pupil_left_normalized 0.760554 0.86 "
|
|
1299
1301
|
]
|
|
1300
1302
|
},
|
|
1301
1303
|
"metadata": {},
|
|
@@ -1423,13 +1425,13 @@
|
|
|
1423
1425
|
"text/html": [
|
|
1424
1426
|
"<style type=\"text/css\">\n",
|
|
1425
1427
|
"</style>\n",
|
|
1426
|
-
"<table id=\"
|
|
1428
|
+
"<table id=\"T_d82c3\">\n",
|
|
1427
1429
|
" <caption>Response distribution</caption>\n",
|
|
1428
1430
|
" <thead>\n",
|
|
1429
1431
|
" <tr>\n",
|
|
1430
1432
|
" <th class=\"blank level0\" > </th>\n",
|
|
1431
|
-
" <th id=\"
|
|
1432
|
-
" <th id=\"
|
|
1433
|
+
" <th id=\"T_d82c3_level0_col0\" class=\"col_heading level0 col0\" >Count</th>\n",
|
|
1434
|
+
" <th id=\"T_d82c3_level0_col1\" class=\"col_heading level0 col1\" >Percent</th>\n",
|
|
1433
1435
|
" </tr>\n",
|
|
1434
1436
|
" <tr>\n",
|
|
1435
1437
|
" <th class=\"index_name level0\" >Category</th>\n",
|
|
@@ -1439,35 +1441,35 @@
|
|
|
1439
1441
|
" </thead>\n",
|
|
1440
1442
|
" <tbody>\n",
|
|
1441
1443
|
" <tr>\n",
|
|
1442
|
-
" <th id=\"
|
|
1443
|
-
" <td id=\"
|
|
1444
|
-
" <td id=\"
|
|
1444
|
+
" <th id=\"T_d82c3_level0_row0\" class=\"row_heading level0 row0\" >Strongly agree</th>\n",
|
|
1445
|
+
" <td id=\"T_d82c3_row0_col0\" class=\"data row0 col0\" >10</td>\n",
|
|
1446
|
+
" <td id=\"T_d82c3_row0_col1\" class=\"data row0 col1\" >33.3%</td>\n",
|
|
1445
1447
|
" </tr>\n",
|
|
1446
1448
|
" <tr>\n",
|
|
1447
|
-
" <th id=\"
|
|
1448
|
-
" <td id=\"
|
|
1449
|
-
" <td id=\"
|
|
1449
|
+
" <th id=\"T_d82c3_level0_row1\" class=\"row_heading level0 row1\" >Neither agree nor disagree</th>\n",
|
|
1450
|
+
" <td id=\"T_d82c3_row1_col0\" class=\"data row1 col0\" >7</td>\n",
|
|
1451
|
+
" <td id=\"T_d82c3_row1_col1\" class=\"data row1 col1\" >23.3%</td>\n",
|
|
1450
1452
|
" </tr>\n",
|
|
1451
1453
|
" <tr>\n",
|
|
1452
|
-
" <th id=\"
|
|
1453
|
-
" <td id=\"
|
|
1454
|
-
" <td id=\"
|
|
1454
|
+
" <th id=\"T_d82c3_level0_row2\" class=\"row_heading level0 row2\" >Strongly disagree</th>\n",
|
|
1455
|
+
" <td id=\"T_d82c3_row2_col0\" class=\"data row2 col0\" >5</td>\n",
|
|
1456
|
+
" <td id=\"T_d82c3_row2_col1\" class=\"data row2 col1\" >16.7%</td>\n",
|
|
1455
1457
|
" </tr>\n",
|
|
1456
1458
|
" <tr>\n",
|
|
1457
|
-
" <th id=\"
|
|
1458
|
-
" <td id=\"
|
|
1459
|
-
" <td id=\"
|
|
1459
|
+
" <th id=\"T_d82c3_level0_row3\" class=\"row_heading level0 row3\" >Somewhat disagree</th>\n",
|
|
1460
|
+
" <td id=\"T_d82c3_row3_col0\" class=\"data row3 col0\" >5</td>\n",
|
|
1461
|
+
" <td id=\"T_d82c3_row3_col1\" class=\"data row3 col1\" >16.7%</td>\n",
|
|
1460
1462
|
" </tr>\n",
|
|
1461
1463
|
" <tr>\n",
|
|
1462
|
-
" <th id=\"
|
|
1463
|
-
" <td id=\"
|
|
1464
|
-
" <td id=\"
|
|
1464
|
+
" <th id=\"T_d82c3_level0_row4\" class=\"row_heading level0 row4\" >Somewhat agree</th>\n",
|
|
1465
|
+
" <td id=\"T_d82c3_row4_col0\" class=\"data row4 col0\" >3</td>\n",
|
|
1466
|
+
" <td id=\"T_d82c3_row4_col1\" class=\"data row4 col1\" >10.0%</td>\n",
|
|
1465
1467
|
" </tr>\n",
|
|
1466
1468
|
" </tbody>\n",
|
|
1467
1469
|
"</table>\n"
|
|
1468
1470
|
],
|
|
1469
1471
|
"text/plain": [
|
|
1470
|
-
"<pandas.io.formats.style.Styler at
|
|
1472
|
+
"<pandas.io.formats.style.Styler at 0x704a3638c0>"
|
|
1471
1473
|
]
|
|
1472
1474
|
},
|
|
1473
1475
|
"metadata": {},
|
|
@@ -1478,52 +1480,52 @@
|
|
|
1478
1480
|
"text/html": [
|
|
1479
1481
|
"<style type=\"text/css\">\n",
|
|
1480
1482
|
"</style>\n",
|
|
1481
|
-
"<table id=\"
|
|
1483
|
+
"<table id=\"T_af083\">\n",
|
|
1482
1484
|
" <caption>Pupil_Left distribution</caption>\n",
|
|
1483
1485
|
" <thead>\n",
|
|
1484
1486
|
" <tr>\n",
|
|
1485
1487
|
" <th class=\"blank level0\" > </th>\n",
|
|
1486
|
-
" <th id=\"
|
|
1488
|
+
" <th id=\"T_af083_level0_col0\" class=\"col_heading level0 col0\" >pupil_left</th>\n",
|
|
1487
1489
|
" </tr>\n",
|
|
1488
1490
|
" </thead>\n",
|
|
1489
1491
|
" <tbody>\n",
|
|
1490
1492
|
" <tr>\n",
|
|
1491
|
-
" <th id=\"
|
|
1492
|
-
" <td id=\"
|
|
1493
|
+
" <th id=\"T_af083_level0_row0\" class=\"row_heading level0 row0\" >count</th>\n",
|
|
1494
|
+
" <td id=\"T_af083_row0_col0\" class=\"data row0 col0\" >30.00</td>\n",
|
|
1493
1495
|
" </tr>\n",
|
|
1494
1496
|
" <tr>\n",
|
|
1495
|
-
" <th id=\"
|
|
1496
|
-
" <td id=\"
|
|
1497
|
+
" <th id=\"T_af083_level0_row1\" class=\"row_heading level0 row1\" >mean</th>\n",
|
|
1498
|
+
" <td id=\"T_af083_row1_col0\" class=\"data row1 col0\" >2.68</td>\n",
|
|
1497
1499
|
" </tr>\n",
|
|
1498
1500
|
" <tr>\n",
|
|
1499
|
-
" <th id=\"
|
|
1500
|
-
" <td id=\"
|
|
1501
|
+
" <th id=\"T_af083_level0_row2\" class=\"row_heading level0 row2\" >std</th>\n",
|
|
1502
|
+
" <td id=\"T_af083_row2_col0\" class=\"data row2 col0\" >0.07</td>\n",
|
|
1501
1503
|
" </tr>\n",
|
|
1502
1504
|
" <tr>\n",
|
|
1503
|
-
" <th id=\"
|
|
1504
|
-
" <td id=\"
|
|
1505
|
+
" <th id=\"T_af083_level0_row3\" class=\"row_heading level0 row3\" >min</th>\n",
|
|
1506
|
+
" <td id=\"T_af083_row3_col0\" class=\"data row3 col0\" >2.53</td>\n",
|
|
1505
1507
|
" </tr>\n",
|
|
1506
1508
|
" <tr>\n",
|
|
1507
|
-
" <th id=\"
|
|
1508
|
-
" <td id=\"
|
|
1509
|
+
" <th id=\"T_af083_level0_row4\" class=\"row_heading level0 row4\" >25%</th>\n",
|
|
1510
|
+
" <td id=\"T_af083_row4_col0\" class=\"data row4 col0\" >2.62</td>\n",
|
|
1509
1511
|
" </tr>\n",
|
|
1510
1512
|
" <tr>\n",
|
|
1511
|
-
" <th id=\"
|
|
1512
|
-
" <td id=\"
|
|
1513
|
+
" <th id=\"T_af083_level0_row5\" class=\"row_heading level0 row5\" >50%</th>\n",
|
|
1514
|
+
" <td id=\"T_af083_row5_col0\" class=\"data row5 col0\" >2.68</td>\n",
|
|
1513
1515
|
" </tr>\n",
|
|
1514
1516
|
" <tr>\n",
|
|
1515
|
-
" <th id=\"
|
|
1516
|
-
" <td id=\"
|
|
1517
|
+
" <th id=\"T_af083_level0_row6\" class=\"row_heading level0 row6\" >75%</th>\n",
|
|
1518
|
+
" <td id=\"T_af083_row6_col0\" class=\"data row6 col0\" >2.74</td>\n",
|
|
1517
1519
|
" </tr>\n",
|
|
1518
1520
|
" <tr>\n",
|
|
1519
|
-
" <th id=\"
|
|
1520
|
-
" <td id=\"
|
|
1521
|
+
" <th id=\"T_af083_level0_row7\" class=\"row_heading level0 row7\" >max</th>\n",
|
|
1522
|
+
" <td id=\"T_af083_row7_col0\" class=\"data row7 col0\" >2.82</td>\n",
|
|
1521
1523
|
" </tr>\n",
|
|
1522
1524
|
" </tbody>\n",
|
|
1523
1525
|
"</table>\n"
|
|
1524
1526
|
],
|
|
1525
1527
|
"text/plain": [
|
|
1526
|
-
"<pandas.io.formats.style.Styler at
|
|
1528
|
+
"<pandas.io.formats.style.Styler at 0x7049877750>"
|
|
1527
1529
|
]
|
|
1528
1530
|
},
|
|
1529
1531
|
"metadata": {},
|
|
@@ -1534,52 +1536,52 @@
|
|
|
1534
1536
|
"text/html": [
|
|
1535
1537
|
"<style type=\"text/css\">\n",
|
|
1536
1538
|
"</style>\n",
|
|
1537
|
-
"<table id=\"
|
|
1539
|
+
"<table id=\"T_3e040\">\n",
|
|
1538
1540
|
" <caption>Pupil_Right distribution</caption>\n",
|
|
1539
1541
|
" <thead>\n",
|
|
1540
1542
|
" <tr>\n",
|
|
1541
1543
|
" <th class=\"blank level0\" > </th>\n",
|
|
1542
|
-
" <th id=\"
|
|
1544
|
+
" <th id=\"T_3e040_level0_col0\" class=\"col_heading level0 col0\" >pupil_right</th>\n",
|
|
1543
1545
|
" </tr>\n",
|
|
1544
1546
|
" </thead>\n",
|
|
1545
1547
|
" <tbody>\n",
|
|
1546
1548
|
" <tr>\n",
|
|
1547
|
-
" <th id=\"
|
|
1548
|
-
" <td id=\"
|
|
1549
|
+
" <th id=\"T_3e040_level0_row0\" class=\"row_heading level0 row0\" >count</th>\n",
|
|
1550
|
+
" <td id=\"T_3e040_row0_col0\" class=\"data row0 col0\" >29.00</td>\n",
|
|
1549
1551
|
" </tr>\n",
|
|
1550
1552
|
" <tr>\n",
|
|
1551
|
-
" <th id=\"
|
|
1552
|
-
" <td id=\"
|
|
1553
|
+
" <th id=\"T_3e040_level0_row1\" class=\"row_heading level0 row1\" >mean</th>\n",
|
|
1554
|
+
" <td id=\"T_3e040_row1_col0\" class=\"data row1 col0\" >2.70</td>\n",
|
|
1553
1555
|
" </tr>\n",
|
|
1554
1556
|
" <tr>\n",
|
|
1555
|
-
" <th id=\"
|
|
1556
|
-
" <td id=\"
|
|
1557
|
+
" <th id=\"T_3e040_level0_row2\" class=\"row_heading level0 row2\" >std</th>\n",
|
|
1558
|
+
" <td id=\"T_3e040_row2_col0\" class=\"data row2 col0\" >0.10</td>\n",
|
|
1557
1559
|
" </tr>\n",
|
|
1558
1560
|
" <tr>\n",
|
|
1559
|
-
" <th id=\"
|
|
1560
|
-
" <td id=\"
|
|
1561
|
+
" <th id=\"T_3e040_level0_row3\" class=\"row_heading level0 row3\" >min</th>\n",
|
|
1562
|
+
" <td id=\"T_3e040_row3_col0\" class=\"data row3 col0\" >2.52</td>\n",
|
|
1561
1563
|
" </tr>\n",
|
|
1562
1564
|
" <tr>\n",
|
|
1563
|
-
" <th id=\"
|
|
1564
|
-
" <td id=\"
|
|
1565
|
+
" <th id=\"T_3e040_level0_row4\" class=\"row_heading level0 row4\" >25%</th>\n",
|
|
1566
|
+
" <td id=\"T_3e040_row4_col0\" class=\"data row4 col0\" >2.61</td>\n",
|
|
1565
1567
|
" </tr>\n",
|
|
1566
1568
|
" <tr>\n",
|
|
1567
|
-
" <th id=\"
|
|
1568
|
-
" <td id=\"
|
|
1569
|
+
" <th id=\"T_3e040_level0_row5\" class=\"row_heading level0 row5\" >50%</th>\n",
|
|
1570
|
+
" <td id=\"T_3e040_row5_col0\" class=\"data row5 col0\" >2.71</td>\n",
|
|
1569
1571
|
" </tr>\n",
|
|
1570
1572
|
" <tr>\n",
|
|
1571
|
-
" <th id=\"
|
|
1572
|
-
" <td id=\"
|
|
1573
|
+
" <th id=\"T_3e040_level0_row6\" class=\"row_heading level0 row6\" >75%</th>\n",
|
|
1574
|
+
" <td id=\"T_3e040_row6_col0\" class=\"data row6 col0\" >2.79</td>\n",
|
|
1573
1575
|
" </tr>\n",
|
|
1574
1576
|
" <tr>\n",
|
|
1575
|
-
" <th id=\"
|
|
1576
|
-
" <td id=\"
|
|
1577
|
+
" <th id=\"T_3e040_level0_row7\" class=\"row_heading level0 row7\" >max</th>\n",
|
|
1578
|
+
" <td id=\"T_3e040_row7_col0\" class=\"data row7 col0\" >2.85</td>\n",
|
|
1577
1579
|
" </tr>\n",
|
|
1578
1580
|
" </tbody>\n",
|
|
1579
1581
|
"</table>\n"
|
|
1580
1582
|
],
|
|
1581
1583
|
"text/plain": [
|
|
1582
|
-
"<pandas.io.formats.style.Styler at
|
|
1584
|
+
"<pandas.io.formats.style.Styler at 0x7049877750>"
|
|
1583
1585
|
]
|
|
1584
1586
|
},
|
|
1585
1587
|
"metadata": {},
|
|
@@ -1969,8 +1971,8 @@
|
|
|
1969
1971
|
" <td>2.628579</td>\n",
|
|
1970
1972
|
" <td>343.472949</td>\n",
|
|
1971
1973
|
" <td>7190.0</td>\n",
|
|
1972
|
-
" <td>
|
|
1973
|
-
" <td>
|
|
1974
|
+
" <td>Attention</td>\n",
|
|
1975
|
+
" <td>98.137547</td>\n",
|
|
1974
1976
|
" </tr>\n",
|
|
1975
1977
|
" <tr>\n",
|
|
1976
1978
|
" <th>1</th>\n",
|
|
@@ -1981,8 +1983,8 @@
|
|
|
1981
1983
|
" <td>2.628579</td>\n",
|
|
1982
1984
|
" <td>343.472949</td>\n",
|
|
1983
1985
|
" <td>7190.0</td>\n",
|
|
1984
|
-
" <td>
|
|
1985
|
-
" <td>
|
|
1986
|
+
" <td>Joy</td>\n",
|
|
1987
|
+
" <td>0.034117</td>\n",
|
|
1986
1988
|
" </tr>\n",
|
|
1987
1989
|
" <tr>\n",
|
|
1988
1990
|
" <th>2</th>\n",
|
|
@@ -1993,8 +1995,8 @@
|
|
|
1993
1995
|
" <td>2.714873</td>\n",
|
|
1994
1996
|
" <td>357.075008</td>\n",
|
|
1995
1997
|
" <td>7190.0</td>\n",
|
|
1996
|
-
" <td>
|
|
1997
|
-
" <td>
|
|
1998
|
+
" <td>Attention</td>\n",
|
|
1999
|
+
" <td>97.839279</td>\n",
|
|
1998
2000
|
" </tr>\n",
|
|
1999
2001
|
" <tr>\n",
|
|
2000
2002
|
" <th>3</th>\n",
|
|
@@ -2005,8 +2007,8 @@
|
|
|
2005
2007
|
" <td>2.714873</td>\n",
|
|
2006
2008
|
" <td>357.075008</td>\n",
|
|
2007
2009
|
" <td>7190.0</td>\n",
|
|
2008
|
-
" <td>
|
|
2009
|
-
" <td>
|
|
2010
|
+
" <td>Joy</td>\n",
|
|
2011
|
+
" <td>0.037362</td>\n",
|
|
2010
2012
|
" </tr>\n",
|
|
2011
2013
|
" <tr>\n",
|
|
2012
2014
|
" <th>4</th>\n",
|
|
@@ -2017,8 +2019,8 @@
|
|
|
2017
2019
|
" <td>0.129814</td>\n",
|
|
2018
2020
|
" <td>200.098876</td>\n",
|
|
2019
2021
|
" <td>7190.0</td>\n",
|
|
2020
|
-
" <td>
|
|
2021
|
-
" <td>0.
|
|
2022
|
+
" <td>Attention</td>\n",
|
|
2023
|
+
" <td>0.319746</td>\n",
|
|
2022
2024
|
" </tr>\n",
|
|
2023
2025
|
" </tbody>\n",
|
|
2024
2026
|
"</table>\n",
|
|
@@ -2033,11 +2035,11 @@
|
|
|
2033
2035
|
"4 1 Q1 Strongly disagree std 0.129814 200.098876 \n",
|
|
2034
2036
|
"\n",
|
|
2035
2037
|
" timeontask property value \n",
|
|
2036
|
-
"0 7190.0
|
|
2037
|
-
"1 7190.0
|
|
2038
|
-
"2 7190.0
|
|
2039
|
-
"3 7190.0
|
|
2040
|
-
"4 7190.0
|
|
2038
|
+
"0 7190.0 Attention 98.137547 \n",
|
|
2039
|
+
"1 7190.0 Joy 0.034117 \n",
|
|
2040
|
+
"2 7190.0 Attention 97.839279 \n",
|
|
2041
|
+
"3 7190.0 Joy 0.037362 \n",
|
|
2042
|
+
"4 7190.0 Attention 0.319746 "
|
|
2041
2043
|
]
|
|
2042
2044
|
},
|
|
2043
2045
|
"execution_count": 18,
|
|
@@ -92,8 +92,8 @@
|
|
|
92
92
|
"name": "stderr",
|
|
93
93
|
"output_type": "stream",
|
|
94
94
|
"text": [
|
|
95
|
-
"Processing sensor files: 100%|██████████| 10/10 [00:02<00:00,
|
|
96
|
-
"Processing sensor files: 100%|██████████| 10/10 [00:02<00:00,
|
|
95
|
+
"Processing sensor files: 100%|██████████| 10/10 [00:02<00:00, 3.66it/s]\n",
|
|
96
|
+
"Processing sensor files: 100%|██████████| 10/10 [00:02<00:00, 3.40it/s]\n"
|
|
97
97
|
]
|
|
98
98
|
}
|
|
99
99
|
],
|
|
@@ -1220,7 +1220,7 @@
|
|
|
1220
1220
|
"name": "stderr",
|
|
1221
1221
|
"output_type": "stream",
|
|
1222
1222
|
"text": [
|
|
1223
|
-
"100%|██████████| 100/100 [00:
|
|
1223
|
+
"100%|██████████| 100/100 [00:03<00:00, 29.19it/s]\n"
|
|
1224
1224
|
]
|
|
1225
1225
|
},
|
|
1226
1226
|
{
|
|
@@ -1258,8 +1258,8 @@
|
|
|
1258
1258
|
" <td>-23.740318</td>\n",
|
|
1259
1259
|
" <td>-5.178378</td>\n",
|
|
1260
1260
|
" <td>-0.5</td>\n",
|
|
1261
|
-
" <td>-
|
|
1262
|
-
" <td>-
|
|
1261
|
+
" <td>-51.201403</td>\n",
|
|
1262
|
+
" <td>-10.410856</td>\n",
|
|
1263
1263
|
" <td>0.0</td>\n",
|
|
1264
1264
|
" </tr>\n",
|
|
1265
1265
|
" </tbody>\n",
|
|
@@ -1268,7 +1268,7 @@
|
|
|
1268
1268
|
],
|
|
1269
1269
|
"text/plain": [
|
|
1270
1270
|
" beta marginal marginal_discrete lower_bound upper_bound \\\n",
|
|
1271
|
-
"pupil_left -23.740318 -5.178378 -0.5 -
|
|
1271
|
+
"pupil_left -23.740318 -5.178378 -0.5 -51.201403 -10.410856 \n",
|
|
1272
1272
|
"\n",
|
|
1273
1273
|
" p_value \n",
|
|
1274
1274
|
"pupil_left 0.0 "
|
|
@@ -1323,8 +1323,8 @@
|
|
|
1323
1323
|
"Dep. Variable: pupil_left R-squared: 0.362\n",
|
|
1324
1324
|
"Model: OLS Adj. R-squared: 0.315\n",
|
|
1325
1325
|
"Method: Least Squares F-statistic: 6.111\n",
|
|
1326
|
-
"Date:
|
|
1327
|
-
"Time: 07:
|
|
1326
|
+
"Date: Sun, 06 Dec 2026 Prob (F-statistic): 0.0211\n",
|
|
1327
|
+
"Time: 07:52:09 Log-Likelihood: 73.076\n",
|
|
1328
1328
|
"No. Observations: 30 AIC: -140.2\n",
|
|
1329
1329
|
"Df Residuals: 27 BIC: -135.9\n",
|
|
1330
1330
|
"Df Model: 2 \n",
|
cbacablab-0.1.2/PKG-INFO
ADDED
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: CBACABLab
|
|
3
|
+
Version: 0.1.2
|
|
4
|
+
Summary: Tools for loading, joining, and plotting survey and iMotions sensor data.
|
|
5
|
+
Project-URL: Homepage, https://github.com/UNO-CAB-Lab/python-parsing
|
|
6
|
+
Project-URL: Bug Tracker, https://github.com/UNO-CAB-Lab/python-parsing/issues
|
|
7
|
+
Author-email: Ben Smith <bosmith@unomaha.edu>
|
|
8
|
+
Maintainer-email: Ben Smith <bosmith@unomaha.edu>
|
|
9
|
+
License-Expression: MIT
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Keywords: Eye Tracking,Facial Expression,Qualtrics,Survey,iMotions
|
|
12
|
+
Classifier: Intended Audience :: Science/Research
|
|
13
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
18
|
+
Requires-Python: >=3.12
|
|
19
|
+
Requires-Dist: fastmcp>=4.0.0
|
|
20
|
+
Requires-Dist: ipython>=8.12.0
|
|
21
|
+
Requires-Dist: matplotlib>=3.8.0
|
|
22
|
+
Requires-Dist: numpy>=2.0.0
|
|
23
|
+
Requires-Dist: openpyxl>=3.1.0
|
|
24
|
+
Requires-Dist: pandas>=2.1.0
|
|
25
|
+
Requires-Dist: seaborn>=0.13.0
|
|
26
|
+
Requires-Dist: statsmodels>=0.14.0
|
|
27
|
+
Requires-Dist: tqdm>=4.66.0
|
|
28
|
+
Description-Content-Type: text/markdown
|
|
29
|
+
|
|
30
|
+
# CBA CAB Lab
|
|
31
|
+
|
|
32
|
+
This module is part of the UNO's CBA CAB Lab project to expand the labs usage to everyone interested in using it. It provides a set of tools that automatically map question data from Qualtrics to the data that is generated through instruments (iMotions). In this process, it generates a SQLite database that can be used directly. However, it also contains numerous helpful functions for selecting and filtering the data you want for analysis. This project is managed by Ben Smith, so please reach out to him if you have any questions.
|
|
33
|
+
|
|
34
|
+
## How do I install this module?
|
|
35
|
+
|
|
36
|
+
To install this module, you can use pip:
|
|
37
|
+
```
|
|
38
|
+
pip install CBACABLab
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
To install this module with conda, you can use the following command:
|
|
42
|
+
|
|
43
|
+
```
|
|
44
|
+
conda install -c tazzben -c conda-forge CBACABLab
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
If you don't yet have Python installed, we recommend installing Anaconda, which is a open-source distribution of Python that includes useful packages for data analysis. You can download Anaconda from [here](https://www.anaconda.com/products/distribution). We also recommend you install Microsoft [Visual Studio Code](https://code.visualstudio.com/) to work with notebook files.
|
|
48
|
+
|
|
49
|
+
The primary way you should use this module is following the analysis.ipynb notebook, which is included in this repository and with the data from the lab. This notebook will walk you through the process of loading your data, filtering it, and exporting it for analysis.
|
|
50
|
+
|
|
51
|
+
In the notebook settings, set `STUDY_DIR` to the folder containing `Survey.xlsx`, `Survey.csv`, and `sensorData`. Its default, `.`, is the kernel's current working directory, which may differ from the notebook's folder. The loaders also accept absolute or relative paths and `Path` objects, and expand `~` to the home directory. Relative paths are based on the current working directory. Sensor folder paths do not need a trailing slash. Raw-data loaders can create the database; query functions open ordinary database file paths read-only and require the file to exist. Query functions also accept SQLite connections and special SQLite names or URIs.
|
|
52
|
+
|
|
53
|
+
## Using CBACABLab with AI Assistants (MCP) (Experimental and not recommended for production use)
|
|
54
|
+
|
|
55
|
+
`CBACABLab` includes a built-in **Model Context Protocol (MCP)** server so you can parse Qualtrics and iMotions files, inspect available variables, and export panel datasets using natural language in **Visual Studio Code** or **Claude Desktop**—without writing Python scripts or notebooks. This is not the recommended way to use `CBACABLab` but might make sense in automation pipelines. Moreover, the use of the package is not as customizable as writing your own scripts or notebooks, so we recommend using the notebook for most use cases.
|
|
56
|
+
|
|
57
|
+
All processing runs **locally on your computer**; your survey and biometric sensor files are never uploaded to an external server.
|
|
58
|
+
|
|
59
|
+
### 1. Install CBACABLab
|
|
60
|
+
|
|
61
|
+
MCP support is included automatically when you install or update `CBACABLab`:
|
|
62
|
+
|
|
63
|
+
* **Using pip:**
|
|
64
|
+
```bash
|
|
65
|
+
pip install CBACABLab
|
|
66
|
+
```
|
|
67
|
+
* **Using Conda / Anaconda:**
|
|
68
|
+
```bash
|
|
69
|
+
conda install -c tazzben -c conda-forge CBACABLab
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Next, activate the Python or Conda environment where you installed `CBACABLab` and find the full path to its `python` executable (you will paste this into your AI tool's configuration so it launches the right environment):
|
|
73
|
+
|
|
74
|
+
* **macOS / Linux:**
|
|
75
|
+
```bash
|
|
76
|
+
which python
|
|
77
|
+
```
|
|
78
|
+
* **Windows (Anaconda Prompt):**
|
|
79
|
+
```cmd
|
|
80
|
+
where python
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
### 2. Configure Visual Studio Code
|
|
86
|
+
|
|
87
|
+
1. Open your study folder in VS Code.
|
|
88
|
+
2. Create a file named `.vscode/mcp.json` in that folder (or run **MCP: Open User Configuration** from the Command Palette `Ctrl+Shift+P` / `Cmd+Shift+P` to enable it globally).
|
|
89
|
+
3. Add the following configuration, replacing `/path/to/python` with the path from Step 1:
|
|
90
|
+
|
|
91
|
+
```json
|
|
92
|
+
{
|
|
93
|
+
"servers": {
|
|
94
|
+
"cbacablab": {
|
|
95
|
+
"command": "/path/to/python",
|
|
96
|
+
"args": ["-m", "CBACABLab.mcp_server"]
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
*(Note: On Windows, use double backslashes in JSON paths, e.g., `"C:\\Users\\YourName\\anaconda3\\envs\\cablab\\python.exe"`.)*
|
|
103
|
+
|
|
104
|
+
Once saved, open **Copilot Chat**, switch to **Agent** mode, and verify `cbacablab` appears under the tools icon.
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
### 3. Configure Claude Desktop
|
|
109
|
+
|
|
110
|
+
1. Open Claude Desktop and go to **Settings > Developer > Edit Config** to open `claude_desktop_config.json`:
|
|
111
|
+
* **macOS:** `~/Library/Application Support/Claude/claude_desktop_config.json`
|
|
112
|
+
* **Windows:** `%APPDATA%\Claude\claude_desktop_config.json`
|
|
113
|
+
2. Add the `cbacablab` server entry (replacing `/path/to/python` with the path from Step 1):
|
|
114
|
+
|
|
115
|
+
```json
|
|
116
|
+
{
|
|
117
|
+
"mcpServers": {
|
|
118
|
+
"cbacablab": {
|
|
119
|
+
"command": "/path/to/python",
|
|
120
|
+
"args": ["-m", "CBACABLab.mcp_server"]
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
3. Restart Claude Desktop.
|
|
127
|
+
|
|
128
|
+
---
|
|
129
|
+
|
|
130
|
+
### 4. Example Prompts & Available Tools
|
|
131
|
+
|
|
132
|
+
Assuming your study folder contains `Survey.xlsx`, `Survey.csv` (exported from Qualtrics with *Use internal IDs in header* checked), and your `sensorData/` directory, you can ask your AI assistant:
|
|
133
|
+
|
|
134
|
+
* **Build the database and export a panel CSV from scratch:**
|
|
135
|
+
> *"Using CBACABLab on `/path/to/study_folder`, build the SQLite database from `Survey.xlsx`, `Survey.csv`, and `sensorData/`, and export `panel.csv` with question-level columns `Q1, Q2, Q3`, respondent-level columns `Q4_4, Q5_4, Q6, Q7`, and instrument properties `Attention, Joy`."*
|
|
136
|
+
* **Inspect variables in an existing database:**
|
|
137
|
+
> *"List all available survey questions and sensor instrument columns in `data.db` inside `/path/to/study_folder`."*
|
|
138
|
+
* **Export a new panel CSV without re-parsing raw sensor files:**
|
|
139
|
+
> *"From the existing `data.db` in `/path/to/study_folder`, create `panel_emotions.csv` using `Q1, Q2` as question-level columns, `Q6, Q7` as respondent-level columns, and `Joy, Saccade Amplitude, Engagement` as instrument properties."*
|
|
140
|
+
|
|
141
|
+
#### Exposed MCP Tools
|
|
142
|
+
|
|
143
|
+
| Tool | Purpose |
|
|
144
|
+
| :--- | :--- |
|
|
145
|
+
| `build_database_and_create_panel` | End-to-end pipeline: maps question IDs, loads survey and sensor files (rebuilding `data.db`), and exports `panel.csv`. |
|
|
146
|
+
| `create_panel_data` | Generates a panel CSV from an existing `data.db` without re-parsing raw sensor files. |
|
|
147
|
+
| `list_questions` | Lists all survey questions stored in `data.db`. |
|
|
148
|
+
| `list_instrument_columns` | Lists all iMotions sensor properties stored in `data.db`. |
|
|
149
|
+
| `auto_determine_question_mapping` | Matches Qualtrics QIDs to question names from `Survey.xlsx` and `Survey.csv`. |
|
|
150
|
+
| `load_survey_data` | Loads or replaces the `FullSurvey` table in `data.db`. |
|
|
151
|
+
| `load_sensor_data` | Loads iMotions sensor files into `data.db` (supports tags, bounding boxes, and aggregation methods). |
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
## Thanks to GitBook
|
|
155
|
+
|
|
156
|
+
As an open source project, GitBook has provided our documentation site for free. We appreciate their support. This documentation site will be published soon.
|