experiment_server 0.3.2__tar.gz → 0.3.3__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.
- {experiment_server-0.3.2 → experiment_server-0.3.3}/PKG-INFO +3 -2
- {experiment_server-0.3.2 → experiment_server-0.3.3}/experiment_server/_server.py +1 -1
- {experiment_server-0.3.2 → experiment_server-0.3.3}/experiment_server/cli.py +21 -2
- {experiment_server-0.3.2 → experiment_server-0.3.3}/experiment_server/static/index.html +3 -3
- {experiment_server-0.3.2 → experiment_server-0.3.3}/pyproject.toml +1 -1
- {experiment_server-0.3.2 → experiment_server-0.3.3}/LICENSE.md +0 -0
- {experiment_server-0.3.2 → experiment_server-0.3.3}/README.md +0 -0
- {experiment_server-0.3.2 → experiment_server-0.3.3}/experiment_server/__init__.py +0 -0
- {experiment_server-0.3.2 → experiment_server-0.3.3}/experiment_server/_api.py +0 -0
- {experiment_server-0.3.2 → experiment_server-0.3.3}/experiment_server/_client.py +0 -0
- {experiment_server-0.3.2 → experiment_server-0.3.3}/experiment_server/_participant_ordering.py +0 -0
- {experiment_server-0.3.2 → experiment_server-0.3.3}/experiment_server/_process_config.py +0 -0
- {experiment_server-0.3.2 → experiment_server-0.3.3}/experiment_server/static/css/bootstrap-5.2.3.min.css +0 -0
- {experiment_server-0.3.2 → experiment_server-0.3.3}/experiment_server/static/initconfig.html +0 -0
- {experiment_server-0.3.2 → experiment_server-0.3.3}/experiment_server/static/js/alpinejs3.min.js +0 -0
- {experiment_server-0.3.2 → experiment_server-0.3.3}/experiment_server/static/js/bootstrap-4.5.0.min.js +0 -0
- {experiment_server-0.3.2 → experiment_server-0.3.3}/experiment_server/static/js/fontawesome-1e694dd391.js +0 -0
- {experiment_server-0.3.2 → experiment_server-0.3.3}/experiment_server/static/js/htmx-1.9.10.js +0 -0
- {experiment_server-0.3.2 → experiment_server-0.3.3}/experiment_server/static/js/jquery-3.5.1.min.js +0 -0
- {experiment_server-0.3.2 → experiment_server-0.3.3}/experiment_server/static/js/popper-1.16.0.min.js +0 -0
- {experiment_server-0.3.2 → experiment_server-0.3.3}/experiment_server/static/js/sweetalert2-11.js +0 -0
- {experiment_server-0.3.2 → experiment_server-0.3.3}/experiment_server/utils.py +0 -0
- {experiment_server-0.3.2 → experiment_server-0.3.3}/sample_config.toml +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
|
-
Name:
|
|
3
|
-
Version: 0.3.
|
|
2
|
+
Name: experiment_server
|
|
3
|
+
Version: 0.3.3
|
|
4
4
|
Summary: Server for experiments to get configuarations from
|
|
5
5
|
Home-page: https://shariff-faleel.com/experiment_server/
|
|
6
6
|
License: MIT
|
|
@@ -18,6 +18,7 @@ Classifier: Programming Language :: Python :: 3.8
|
|
|
18
18
|
Classifier: Programming Language :: Python :: 3.9
|
|
19
19
|
Classifier: Programming Language :: Python :: 3.10
|
|
20
20
|
Classifier: Programming Language :: Python :: 3.11
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
21
22
|
Requires-Dist: Jinja2 (>=3.1.2)
|
|
22
23
|
Requires-Dist: asyncio (>=3.4.3)
|
|
23
24
|
Requires-Dist: click (>=6.0)
|
|
@@ -320,7 +320,7 @@ class ExperimentHandler(RequestHandler):
|
|
|
320
320
|
|
|
321
321
|
try:
|
|
322
322
|
block_name = self.experiment.move_to_next(participant_id)
|
|
323
|
-
logger.info(f"Loading block: {self.experiment.get_participant_state(participant_id).
|
|
323
|
+
logger.info(f"Loading block: {self.experiment.get_participant_state(participant_id).block_name}\n")
|
|
324
324
|
self.write({"name": block_name})
|
|
325
325
|
except KeyError:
|
|
326
326
|
self.write(f"Participant with ID {participant_id} not known. Consider initializing new participant.")
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"""CLI."""
|
|
2
2
|
|
|
3
3
|
import click
|
|
4
|
+
from click.core import ParameterSource
|
|
4
5
|
from loguru import logger
|
|
5
6
|
from pathlib import Path
|
|
6
7
|
from click_aliases import ClickAliasedGroup
|
|
@@ -16,11 +17,29 @@ def cli():
|
|
|
16
17
|
pass
|
|
17
18
|
|
|
18
19
|
|
|
20
|
+
def _ask_default_participant_index_callback(ctx:click.Context, _, flag_value:bool):
|
|
21
|
+
"""Callback used to process the ask-default-participant-index in the run."""
|
|
22
|
+
if not flag_value:
|
|
23
|
+
return
|
|
24
|
+
|
|
25
|
+
if ctx.get_parameter_source("default_participant_index") != ParameterSource.DEFAULT:
|
|
26
|
+
logger.warning("The value passed for `default_participant_index` (-i) is being overwritten with `ask_default_participant_index` (-a).")
|
|
27
|
+
if "default_participant_index" in ctx.params:
|
|
28
|
+
default_value = ctx.params["default_participant_index"]
|
|
29
|
+
else:
|
|
30
|
+
default_value = 1
|
|
31
|
+
ctx.params["default_participant_index"] = click.prompt("Default participant index",
|
|
32
|
+
default_value,
|
|
33
|
+
type=click.IntRange(min=1, max_open=True))
|
|
34
|
+
|
|
35
|
+
|
|
19
36
|
@cli.command(aliases=["r"])
|
|
20
37
|
@click.argument("config-file")
|
|
21
|
-
|
|
38
|
+
# NOTE: making this eager to make sure the data is set for the ask callback
|
|
39
|
+
@click.option("-i", "--default-participant-index", default=1, type=click.IntRange(min=1, max_open=True), is_eager=True)
|
|
22
40
|
@click.option("-h", "--host", default='127.0.0.1')
|
|
23
41
|
@click.option("-p", "--port", default='5000')
|
|
42
|
+
@click.option("-a", "--ask-default-participant-index", is_flag=True, default=False, expose_value=False, callback=_ask_default_participant_index_callback)
|
|
24
43
|
def run(default_participant_index, config_file, host, port):
|
|
25
44
|
"""Launch server with the `config-file` used to setup the configurations"""
|
|
26
45
|
_server(default_participant_index=default_participant_index if default_participant_index > 0 else None, host=host, port=port, config_file=config_file)
|
|
@@ -64,7 +83,7 @@ def new_config_file(new_file_location):
|
|
|
64
83
|
"""
|
|
65
84
|
out_location = Path(new_file_location)
|
|
66
85
|
|
|
67
|
-
if out_location.suffix
|
|
86
|
+
if out_location.suffix != ".toml":
|
|
68
87
|
if out_location.exists():
|
|
69
88
|
logger.error(f"{out_location} exists and does not end with `.toml`")
|
|
70
89
|
return
|
|
@@ -196,18 +196,18 @@
|
|
|
196
196
|
hx-trigger="click"
|
|
197
197
|
hx-include="#checkUseDefault,#txtPPID"
|
|
198
198
|
hx-swap="none">
|
|
199
|
-
View config
|
|
199
|
+
View config for participant
|
|
200
200
|
</button>
|
|
201
201
|
</div>
|
|
202
202
|
</div>
|
|
203
203
|
<div class="row">
|
|
204
204
|
<div class="col-sm-12">
|
|
205
205
|
<button id="btnResetConfig" type="button" style="width:100%" class="btn btn-primary"
|
|
206
|
-
hx-get="/web/reset-
|
|
206
|
+
hx-get="/web/reset-participant"
|
|
207
207
|
hx-trigger="click"
|
|
208
208
|
hx-include="#checkUseDefault,#txtPPID"
|
|
209
209
|
hx-swap="none">
|
|
210
|
-
Reset config
|
|
210
|
+
Reset config for participant
|
|
211
211
|
</button>
|
|
212
212
|
</div>
|
|
213
213
|
</div>
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{experiment_server-0.3.2 → experiment_server-0.3.3}/experiment_server/_participant_ordering.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{experiment_server-0.3.2 → experiment_server-0.3.3}/experiment_server/static/initconfig.html
RENAMED
|
File without changes
|
{experiment_server-0.3.2 → experiment_server-0.3.3}/experiment_server/static/js/alpinejs3.min.js
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{experiment_server-0.3.2 → experiment_server-0.3.3}/experiment_server/static/js/htmx-1.9.10.js
RENAMED
|
File without changes
|
{experiment_server-0.3.2 → experiment_server-0.3.3}/experiment_server/static/js/jquery-3.5.1.min.js
RENAMED
|
File without changes
|
{experiment_server-0.3.2 → experiment_server-0.3.3}/experiment_server/static/js/popper-1.16.0.min.js
RENAMED
|
File without changes
|
{experiment_server-0.3.2 → experiment_server-0.3.3}/experiment_server/static/js/sweetalert2-11.js
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|