hyperstudy 0.2.0__tar.gz → 0.2.1__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.
- {hyperstudy-0.2.0 → hyperstudy-0.2.1}/.github/workflows/sync-release-notes.yml +8 -12
- {hyperstudy-0.2.0 → hyperstudy-0.2.1}/PKG-INFO +1 -1
- {hyperstudy-0.2.0 → hyperstudy-0.2.1}/pyproject.toml +1 -1
- {hyperstudy-0.2.0 → hyperstudy-0.2.1}/src/hyperstudy/client.py +30 -13
- {hyperstudy-0.2.0 → hyperstudy-0.2.1}/tests/test_client.py +42 -0
- {hyperstudy-0.2.0 → hyperstudy-0.2.1}/.github/workflows/publish.yml +0 -0
- {hyperstudy-0.2.0 → hyperstudy-0.2.1}/.github/workflows/test.yml +0 -0
- {hyperstudy-0.2.0 → hyperstudy-0.2.1}/.gitignore +0 -0
- {hyperstudy-0.2.0 → hyperstudy-0.2.1}/CHANGELOG.md +0 -0
- {hyperstudy-0.2.0 → hyperstudy-0.2.1}/LICENSE +0 -0
- {hyperstudy-0.2.0 → hyperstudy-0.2.1}/README.md +0 -0
- {hyperstudy-0.2.0 → hyperstudy-0.2.1}/src/hyperstudy/__init__.py +0 -0
- {hyperstudy-0.2.0 → hyperstudy-0.2.1}/src/hyperstudy/_dataframe.py +0 -0
- {hyperstudy-0.2.0 → hyperstudy-0.2.1}/src/hyperstudy/_display.py +0 -0
- {hyperstudy-0.2.0 → hyperstudy-0.2.1}/src/hyperstudy/_http.py +0 -0
- {hyperstudy-0.2.0 → hyperstudy-0.2.1}/src/hyperstudy/_pagination.py +0 -0
- {hyperstudy-0.2.0 → hyperstudy-0.2.1}/src/hyperstudy/_types.py +0 -0
- {hyperstudy-0.2.0 → hyperstudy-0.2.1}/src/hyperstudy/exceptions.py +0 -0
- {hyperstudy-0.2.0 → hyperstudy-0.2.1}/src/hyperstudy/experiments.py +0 -0
- {hyperstudy-0.2.0 → hyperstudy-0.2.1}/tests/__init__.py +0 -0
- {hyperstudy-0.2.0 → hyperstudy-0.2.1}/tests/conftest.py +0 -0
- {hyperstudy-0.2.0 → hyperstudy-0.2.1}/tests/fixtures/deployment_sessions_response.json +0 -0
- {hyperstudy-0.2.0 → hyperstudy-0.2.1}/tests/fixtures/deployment_single_response.json +0 -0
- {hyperstudy-0.2.0 → hyperstudy-0.2.1}/tests/fixtures/deployments_list_response.json +0 -0
- {hyperstudy-0.2.0 → hyperstudy-0.2.1}/tests/fixtures/error_401.json +0 -0
- {hyperstudy-0.2.0 → hyperstudy-0.2.1}/tests/fixtures/error_403.json +0 -0
- {hyperstudy-0.2.0 → hyperstudy-0.2.1}/tests/fixtures/events_response.json +0 -0
- {hyperstudy-0.2.0 → hyperstudy-0.2.1}/tests/fixtures/experiment_single_response.json +0 -0
- {hyperstudy-0.2.0 → hyperstudy-0.2.1}/tests/fixtures/experiments_list_response.json +0 -0
- {hyperstudy-0.2.0 → hyperstudy-0.2.1}/tests/fixtures/paginated_page1.json +0 -0
- {hyperstudy-0.2.0 → hyperstudy-0.2.1}/tests/fixtures/paginated_page2.json +0 -0
- {hyperstudy-0.2.0 → hyperstudy-0.2.1}/tests/fixtures/pre_experiment_response.json +0 -0
- {hyperstudy-0.2.0 → hyperstudy-0.2.1}/tests/fixtures/warnings_response.json +0 -0
- {hyperstudy-0.2.0 → hyperstudy-0.2.1}/tests/test_dataframe.py +0 -0
- {hyperstudy-0.2.0 → hyperstudy-0.2.1}/tests/test_experiments.py +0 -0
- {hyperstudy-0.2.0 → hyperstudy-0.2.1}/tests/test_pagination.py +0 -0
|
@@ -53,15 +53,11 @@ jobs:
|
|
|
53
53
|
# Remove leading whitespace from heredoc
|
|
54
54
|
sed -i 's/^ //' "$FILE"
|
|
55
55
|
|
|
56
|
-
- name:
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
body: |
|
|
65
|
-
Auto-generated release notes for Python SDK ${{ steps.release.outputs.tag }}.
|
|
66
|
-
|
|
67
|
-
Source: ${{ github.event.release.html_url }}
|
|
56
|
+
- name: Commit and push
|
|
57
|
+
run: |
|
|
58
|
+
cd docs-repo
|
|
59
|
+
git config user.name "github-actions[bot]"
|
|
60
|
+
git config user.email "github-actions[bot]@users.noreply.github.com"
|
|
61
|
+
git add docs/release-notes/
|
|
62
|
+
git commit -m "Add Python SDK ${{ steps.release.outputs.tag }} release notes" || exit 0
|
|
63
|
+
git push
|
|
@@ -55,6 +55,7 @@ class HyperStudy(ExperimentMixin):
|
|
|
55
55
|
scope_id: str,
|
|
56
56
|
*,
|
|
57
57
|
scope: str = "experiment",
|
|
58
|
+
deployment_id: str | None = None,
|
|
58
59
|
room_id: str | None = None,
|
|
59
60
|
start_time: str | None = None,
|
|
60
61
|
end_time: str | None = None,
|
|
@@ -71,6 +72,7 @@ class HyperStudy(ExperimentMixin):
|
|
|
71
72
|
Args:
|
|
72
73
|
scope_id: ID of the experiment, room, or participant.
|
|
73
74
|
scope: ``"experiment"``, ``"room"``, or ``"participant"``.
|
|
75
|
+
deployment_id: Filter by deployment (experiment scope only).
|
|
74
76
|
room_id: Required when ``scope="participant"``.
|
|
75
77
|
start_time: ISO 8601 start filter.
|
|
76
78
|
end_time: ISO 8601 end filter.
|
|
@@ -84,7 +86,7 @@ class HyperStudy(ExperimentMixin):
|
|
|
84
86
|
"""
|
|
85
87
|
return self._fetch_data(
|
|
86
88
|
"events", scope_id,
|
|
87
|
-
scope=scope, room_id=room_id,
|
|
89
|
+
scope=scope, deployment_id=deployment_id, room_id=room_id,
|
|
88
90
|
start_time=start_time, end_time=end_time,
|
|
89
91
|
category=category, sort=sort, order=order,
|
|
90
92
|
limit=limit, offset=offset,
|
|
@@ -96,6 +98,7 @@ class HyperStudy(ExperimentMixin):
|
|
|
96
98
|
scope_id: str,
|
|
97
99
|
*,
|
|
98
100
|
scope: str = "experiment",
|
|
101
|
+
deployment_id: str | None = None,
|
|
99
102
|
room_id: str | None = None,
|
|
100
103
|
limit: int | None = None,
|
|
101
104
|
offset: int = 0,
|
|
@@ -105,7 +108,7 @@ class HyperStudy(ExperimentMixin):
|
|
|
105
108
|
"""Fetch video/audio recording metadata."""
|
|
106
109
|
return self._fetch_data(
|
|
107
110
|
"recordings", scope_id,
|
|
108
|
-
scope=scope, room_id=room_id,
|
|
111
|
+
scope=scope, deployment_id=deployment_id, room_id=room_id,
|
|
109
112
|
limit=limit, offset=offset,
|
|
110
113
|
output=output, progress=progress,
|
|
111
114
|
)
|
|
@@ -115,6 +118,7 @@ class HyperStudy(ExperimentMixin):
|
|
|
115
118
|
scope_id: str,
|
|
116
119
|
*,
|
|
117
120
|
scope: str = "experiment",
|
|
121
|
+
deployment_id: str | None = None,
|
|
118
122
|
room_id: str | None = None,
|
|
119
123
|
start_time: str | None = None,
|
|
120
124
|
end_time: str | None = None,
|
|
@@ -128,7 +132,7 @@ class HyperStudy(ExperimentMixin):
|
|
|
128
132
|
"""Fetch text chat messages."""
|
|
129
133
|
return self._fetch_data(
|
|
130
134
|
"chat", scope_id,
|
|
131
|
-
scope=scope, room_id=room_id,
|
|
135
|
+
scope=scope, deployment_id=deployment_id, room_id=room_id,
|
|
132
136
|
start_time=start_time, end_time=end_time,
|
|
133
137
|
sort=sort, order=order,
|
|
134
138
|
limit=limit, offset=offset,
|
|
@@ -140,6 +144,7 @@ class HyperStudy(ExperimentMixin):
|
|
|
140
144
|
scope_id: str,
|
|
141
145
|
*,
|
|
142
146
|
scope: str = "experiment",
|
|
147
|
+
deployment_id: str | None = None,
|
|
143
148
|
room_id: str | None = None,
|
|
144
149
|
start_time: str | None = None,
|
|
145
150
|
end_time: str | None = None,
|
|
@@ -153,7 +158,7 @@ class HyperStudy(ExperimentMixin):
|
|
|
153
158
|
"""Fetch LiveKit video chat connection data."""
|
|
154
159
|
return self._fetch_data(
|
|
155
160
|
"videochat", scope_id,
|
|
156
|
-
scope=scope, room_id=room_id,
|
|
161
|
+
scope=scope, deployment_id=deployment_id, room_id=room_id,
|
|
157
162
|
start_time=start_time, end_time=end_time,
|
|
158
163
|
sort=sort, order=order,
|
|
159
164
|
limit=limit, offset=offset,
|
|
@@ -165,6 +170,7 @@ class HyperStudy(ExperimentMixin):
|
|
|
165
170
|
scope_id: str,
|
|
166
171
|
*,
|
|
167
172
|
scope: str = "experiment",
|
|
173
|
+
deployment_id: str | None = None,
|
|
168
174
|
room_id: str | None = None,
|
|
169
175
|
start_time: str | None = None,
|
|
170
176
|
end_time: str | None = None,
|
|
@@ -182,7 +188,7 @@ class HyperStudy(ExperimentMixin):
|
|
|
182
188
|
extra["aggregationWindow"] = aggregation_window
|
|
183
189
|
return self._fetch_data(
|
|
184
190
|
"sync", scope_id,
|
|
185
|
-
scope=scope, room_id=room_id,
|
|
191
|
+
scope=scope, deployment_id=deployment_id, room_id=room_id,
|
|
186
192
|
start_time=start_time, end_time=end_time,
|
|
187
193
|
sort=sort, order=order,
|
|
188
194
|
limit=limit, offset=offset,
|
|
@@ -196,6 +202,7 @@ class HyperStudy(ExperimentMixin):
|
|
|
196
202
|
*,
|
|
197
203
|
kind: str = "continuous",
|
|
198
204
|
scope: str = "experiment",
|
|
205
|
+
deployment_id: str | None = None,
|
|
199
206
|
room_id: str | None = None,
|
|
200
207
|
start_time: str | None = None,
|
|
201
208
|
end_time: str | None = None,
|
|
@@ -214,7 +221,7 @@ class HyperStudy(ExperimentMixin):
|
|
|
214
221
|
"""
|
|
215
222
|
return self._fetch_data(
|
|
216
223
|
f"ratings/{kind}", scope_id,
|
|
217
|
-
scope=scope, room_id=room_id,
|
|
224
|
+
scope=scope, deployment_id=deployment_id, room_id=room_id,
|
|
218
225
|
start_time=start_time, end_time=end_time,
|
|
219
226
|
sort=sort, order=order,
|
|
220
227
|
limit=limit, offset=offset,
|
|
@@ -226,6 +233,7 @@ class HyperStudy(ExperimentMixin):
|
|
|
226
233
|
scope_id: str,
|
|
227
234
|
*,
|
|
228
235
|
scope: str = "experiment",
|
|
236
|
+
deployment_id: str | None = None,
|
|
229
237
|
room_id: str | None = None,
|
|
230
238
|
limit: int | None = None,
|
|
231
239
|
offset: int = 0,
|
|
@@ -235,7 +243,7 @@ class HyperStudy(ExperimentMixin):
|
|
|
235
243
|
"""Fetch component response data."""
|
|
236
244
|
return self._fetch_data(
|
|
237
245
|
"components", scope_id,
|
|
238
|
-
scope=scope, room_id=room_id,
|
|
246
|
+
scope=scope, deployment_id=deployment_id, room_id=room_id,
|
|
239
247
|
limit=limit, offset=offset,
|
|
240
248
|
output=output, progress=progress,
|
|
241
249
|
)
|
|
@@ -245,6 +253,7 @@ class HyperStudy(ExperimentMixin):
|
|
|
245
253
|
scope_id: str,
|
|
246
254
|
*,
|
|
247
255
|
scope: str = "experiment",
|
|
256
|
+
deployment_id: str | None = None,
|
|
248
257
|
room_id: str | None = None,
|
|
249
258
|
limit: int | None = None,
|
|
250
259
|
offset: int = 0,
|
|
@@ -254,7 +263,7 @@ class HyperStudy(ExperimentMixin):
|
|
|
254
263
|
"""Fetch participant data."""
|
|
255
264
|
return self._fetch_data(
|
|
256
265
|
"participants", scope_id,
|
|
257
|
-
scope=scope, room_id=room_id,
|
|
266
|
+
scope=scope, deployment_id=deployment_id, room_id=room_id,
|
|
258
267
|
limit=limit, offset=offset,
|
|
259
268
|
output=output, progress=progress,
|
|
260
269
|
)
|
|
@@ -264,6 +273,7 @@ class HyperStudy(ExperimentMixin):
|
|
|
264
273
|
scope_id: str,
|
|
265
274
|
*,
|
|
266
275
|
scope: str = "experiment",
|
|
276
|
+
deployment_id: str | None = None,
|
|
267
277
|
limit: int | None = None,
|
|
268
278
|
offset: int = 0,
|
|
269
279
|
output: str = "pandas",
|
|
@@ -272,7 +282,7 @@ class HyperStudy(ExperimentMixin):
|
|
|
272
282
|
"""Fetch room/session data."""
|
|
273
283
|
return self._fetch_data(
|
|
274
284
|
"rooms", scope_id,
|
|
275
|
-
scope=scope,
|
|
285
|
+
scope=scope, deployment_id=deployment_id,
|
|
276
286
|
limit=limit, offset=offset,
|
|
277
287
|
output=output, progress=progress,
|
|
278
288
|
)
|
|
@@ -286,6 +296,7 @@ class HyperStudy(ExperimentMixin):
|
|
|
286
296
|
scope_id: str,
|
|
287
297
|
*,
|
|
288
298
|
scope: str = "experiment",
|
|
299
|
+
deployment_id: str | None = None,
|
|
289
300
|
room_id: str | None = None,
|
|
290
301
|
start_time: str | None = None,
|
|
291
302
|
end_time: str | None = None,
|
|
@@ -303,7 +314,7 @@ class HyperStudy(ExperimentMixin):
|
|
|
303
314
|
"""
|
|
304
315
|
return self._fetch_data(
|
|
305
316
|
"events", scope_id,
|
|
306
|
-
scope=scope, room_id=room_id,
|
|
317
|
+
scope=scope, deployment_id=deployment_id, room_id=room_id,
|
|
307
318
|
start_time=start_time, end_time=end_time,
|
|
308
319
|
category="questionnaire", sort=sort, order=order,
|
|
309
320
|
limit=limit, offset=offset,
|
|
@@ -315,6 +326,7 @@ class HyperStudy(ExperimentMixin):
|
|
|
315
326
|
scope_id: str,
|
|
316
327
|
*,
|
|
317
328
|
scope: str = "experiment",
|
|
329
|
+
deployment_id: str | None = None,
|
|
318
330
|
room_id: str | None = None,
|
|
319
331
|
start_time: str | None = None,
|
|
320
332
|
end_time: str | None = None,
|
|
@@ -332,7 +344,7 @@ class HyperStudy(ExperimentMixin):
|
|
|
332
344
|
"""
|
|
333
345
|
return self._fetch_and_filter(
|
|
334
346
|
"instructions.", scope_id,
|
|
335
|
-
scope=scope, room_id=room_id,
|
|
347
|
+
scope=scope, deployment_id=deployment_id, room_id=room_id,
|
|
336
348
|
start_time=start_time, end_time=end_time,
|
|
337
349
|
sort=sort, order=order,
|
|
338
350
|
limit=limit, offset=offset,
|
|
@@ -344,6 +356,7 @@ class HyperStudy(ExperimentMixin):
|
|
|
344
356
|
scope_id: str,
|
|
345
357
|
*,
|
|
346
358
|
scope: str = "experiment",
|
|
359
|
+
deployment_id: str | None = None,
|
|
347
360
|
room_id: str | None = None,
|
|
348
361
|
start_time: str | None = None,
|
|
349
362
|
end_time: str | None = None,
|
|
@@ -361,7 +374,7 @@ class HyperStudy(ExperimentMixin):
|
|
|
361
374
|
"""
|
|
362
375
|
return self._fetch_and_filter(
|
|
363
376
|
"consent.", scope_id,
|
|
364
|
-
scope=scope, room_id=room_id,
|
|
377
|
+
scope=scope, deployment_id=deployment_id, room_id=room_id,
|
|
365
378
|
start_time=start_time, end_time=end_time,
|
|
366
379
|
sort=sort, order=order,
|
|
367
380
|
limit=limit, offset=offset,
|
|
@@ -463,6 +476,7 @@ class HyperStudy(ExperimentMixin):
|
|
|
463
476
|
scope_id: str,
|
|
464
477
|
*,
|
|
465
478
|
scope: str = "experiment",
|
|
479
|
+
deployment_id: str | None = None,
|
|
466
480
|
room_id: str | None = None,
|
|
467
481
|
start_time: str | None = None,
|
|
468
482
|
end_time: str | None = None,
|
|
@@ -482,7 +496,7 @@ class HyperStudy(ExperimentMixin):
|
|
|
482
496
|
# Always fetch as dicts so we can filter before conversion
|
|
483
497
|
raw = self._fetch_data(
|
|
484
498
|
"events", scope_id,
|
|
485
|
-
scope=scope, room_id=room_id,
|
|
499
|
+
scope=scope, deployment_id=deployment_id, room_id=room_id,
|
|
486
500
|
start_time=start_time, end_time=end_time,
|
|
487
501
|
category="pre_experiment", sort=sort, order=order,
|
|
488
502
|
limit=limit, offset=offset,
|
|
@@ -500,6 +514,7 @@ class HyperStudy(ExperimentMixin):
|
|
|
500
514
|
scope_id: str,
|
|
501
515
|
*,
|
|
502
516
|
scope: str = "experiment",
|
|
517
|
+
deployment_id: str | None = None,
|
|
503
518
|
room_id: str | None = None,
|
|
504
519
|
start_time: str | None = None,
|
|
505
520
|
end_time: str | None = None,
|
|
@@ -517,6 +532,8 @@ class HyperStudy(ExperimentMixin):
|
|
|
517
532
|
path = f"data/{data_type}/{scope_val.value}/{scope_id}"
|
|
518
533
|
|
|
519
534
|
params: dict[str, Any] = {"offset": offset}
|
|
535
|
+
if deployment_id:
|
|
536
|
+
params["deploymentId"] = deployment_id
|
|
520
537
|
if room_id:
|
|
521
538
|
params["roomId"] = room_id
|
|
522
539
|
if start_time:
|
|
@@ -138,6 +138,48 @@ def test_get_events_with_filters(api_key, events_response):
|
|
|
138
138
|
assert "limit=100" in url
|
|
139
139
|
|
|
140
140
|
|
|
141
|
+
@responses.activate
|
|
142
|
+
def test_get_events_with_deployment_id(api_key, events_response):
|
|
143
|
+
"""get_events passes deploymentId query param when deployment_id is set."""
|
|
144
|
+
responses.get(
|
|
145
|
+
f"{BASE_URL}/data/events/experiment/exp_abc123",
|
|
146
|
+
json=events_response,
|
|
147
|
+
status=200,
|
|
148
|
+
)
|
|
149
|
+
client = HyperStudy(api_key=api_key, base_url=BASE_URL)
|
|
150
|
+
client.get_events("exp_abc123", deployment_id="dep_xyz", limit=100)
|
|
151
|
+
url = responses.calls[0].request.url
|
|
152
|
+
assert "deploymentId=dep_xyz" in url
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
@responses.activate
|
|
156
|
+
def test_get_participants_with_deployment_id(api_key, events_response):
|
|
157
|
+
"""get_participants passes deploymentId query param."""
|
|
158
|
+
responses.get(
|
|
159
|
+
f"{BASE_URL}/data/participants/experiment/exp_abc123",
|
|
160
|
+
json=events_response,
|
|
161
|
+
status=200,
|
|
162
|
+
)
|
|
163
|
+
client = HyperStudy(api_key=api_key, base_url=BASE_URL)
|
|
164
|
+
client.get_participants("exp_abc123", deployment_id="dep_xyz", limit=100)
|
|
165
|
+
url = responses.calls[0].request.url
|
|
166
|
+
assert "deploymentId=dep_xyz" in url
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
@responses.activate
|
|
170
|
+
def test_deployment_id_omitted_when_none(api_key, events_response):
|
|
171
|
+
"""deployment_id=None should not add deploymentId to query params."""
|
|
172
|
+
responses.get(
|
|
173
|
+
f"{BASE_URL}/data/events/experiment/exp_abc123",
|
|
174
|
+
json=events_response,
|
|
175
|
+
status=200,
|
|
176
|
+
)
|
|
177
|
+
client = HyperStudy(api_key=api_key, base_url=BASE_URL)
|
|
178
|
+
client.get_events("exp_abc123", limit=100)
|
|
179
|
+
url = responses.calls[0].request.url
|
|
180
|
+
assert "deploymentId" not in url
|
|
181
|
+
|
|
182
|
+
|
|
141
183
|
# ------------------------------------------------------------------
|
|
142
184
|
# Data retrieval — other types
|
|
143
185
|
# ------------------------------------------------------------------
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|