labnotes 0.0.68__tar.gz → 0.0.69__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.
- {labnotes-0.0.68 → labnotes-0.0.69}/PKG-INFO +1 -1
- {labnotes-0.0.68 → labnotes-0.0.69}/src/labnotes/runner/read_experiment_config.py +4 -3
- {labnotes-0.0.68 → labnotes-0.0.69}/src/labnotes/runner/run_experiment.py +6 -6
- {labnotes-0.0.68 → labnotes-0.0.69}/src/labnotes/runner/start_experiment.py +5 -2
- labnotes-0.0.69/src/labnotes/tables/experiment_run_ids.py +11 -0
- labnotes-0.0.69/src/labnotes/tables/file_text.py +12 -0
- {labnotes-0.0.68 → labnotes-0.0.69}/.gitignore +0 -0
- {labnotes-0.0.68 → labnotes-0.0.69}/CHANGELOG.md +0 -0
- {labnotes-0.0.68 → labnotes-0.0.69}/MIGRATIONS.md +0 -0
- {labnotes-0.0.68 → labnotes-0.0.69}/README.md +0 -0
- {labnotes-0.0.68 → labnotes-0.0.69}/pyproject.toml +0 -0
- {labnotes-0.0.68 → labnotes-0.0.69}/src/labnotes/__init__.py +0 -0
- {labnotes-0.0.68 → labnotes-0.0.69}/src/labnotes/asset_url.py +0 -0
- {labnotes-0.0.68 → labnotes-0.0.69}/src/labnotes/check_counts.py +0 -0
- {labnotes-0.0.68 → labnotes-0.0.69}/src/labnotes/cli.py +0 -0
- {labnotes-0.0.68 → labnotes-0.0.69}/src/labnotes/context.md +0 -0
- {labnotes-0.0.68 → labnotes-0.0.69}/src/labnotes/context_guide.py +0 -0
- {labnotes-0.0.68 → labnotes-0.0.69}/src/labnotes/count_runs.py +0 -0
- {labnotes-0.0.68 → labnotes-0.0.69}/src/labnotes/create_app.py +0 -0
- {labnotes-0.0.68 → labnotes-0.0.69}/src/labnotes/create_experiment.py +0 -0
- {labnotes-0.0.68 → labnotes-0.0.69}/src/labnotes/create_note.py +0 -0
- {labnotes-0.0.68 → labnotes-0.0.69}/src/labnotes/data_html.py +0 -0
- {labnotes-0.0.68 → labnotes-0.0.69}/src/labnotes/default_config_text.py +0 -0
- {labnotes-0.0.68 → labnotes-0.0.69}/src/labnotes/default_counts.py +0 -0
- {labnotes-0.0.68 → labnotes-0.0.69}/src/labnotes/drain_watch.py +0 -0
- {labnotes-0.0.68 → labnotes-0.0.69}/src/labnotes/experiment_notes.py +0 -0
- {labnotes-0.0.68 → labnotes-0.0.69}/src/labnotes/experiment_runs.py +0 -0
- {labnotes-0.0.68 → labnotes-0.0.69}/src/labnotes/experiments.py +0 -0
- {labnotes-0.0.68 → labnotes-0.0.69}/src/labnotes/file_changes.py +0 -0
- {labnotes-0.0.68 → labnotes-0.0.69}/src/labnotes/format_duration.py +0 -0
- {labnotes-0.0.68 → labnotes-0.0.69}/src/labnotes/format_value.py +0 -0
- {labnotes-0.0.68 → labnotes-0.0.69}/src/labnotes/group_runs.py +0 -0
- {labnotes-0.0.68 → labnotes-0.0.69}/src/labnotes/init.py +0 -0
- {labnotes-0.0.68 → labnotes-0.0.69}/src/labnotes/invocation_started.py +0 -0
- {labnotes-0.0.68 → labnotes-0.0.69}/src/labnotes/is_positive_int.py +0 -0
- {labnotes-0.0.68 → labnotes-0.0.69}/src/labnotes/list_experiments.py +0 -0
- {labnotes-0.0.68 → labnotes-0.0.69}/src/labnotes/list_runs.py +0 -0
- {labnotes-0.0.68 → labnotes-0.0.69}/src/labnotes/load_config.py +0 -0
- {labnotes-0.0.68 → labnotes-0.0.69}/src/labnotes/load_experiment.py +0 -0
- {labnotes-0.0.68 → labnotes-0.0.69}/src/labnotes/models.py +0 -0
- {labnotes-0.0.68 → labnotes-0.0.69}/src/labnotes/modes.py +0 -0
- {labnotes-0.0.68 → labnotes-0.0.69}/src/labnotes/nests_runs.py +0 -0
- {labnotes-0.0.68 → labnotes-0.0.69}/src/labnotes/note_path.py +0 -0
- {labnotes-0.0.68 → labnotes-0.0.69}/src/labnotes/notebook_kernel.py +0 -0
- {labnotes-0.0.68 → labnotes-0.0.69}/src/labnotes/output_html.py +0 -0
- {labnotes-0.0.68 → labnotes-0.0.69}/src/labnotes/parse_run_view.py +0 -0
- {labnotes-0.0.68 → labnotes-0.0.69}/src/labnotes/print_rows.py +0 -0
- {labnotes-0.0.68 → labnotes-0.0.69}/src/labnotes/python_blocks.py +0 -0
- {labnotes-0.0.68 → labnotes-0.0.69}/src/labnotes/read_config.py +0 -0
- {labnotes-0.0.68 → labnotes-0.0.69}/src/labnotes/read_path.py +0 -0
- {labnotes-0.0.68 → labnotes-0.0.69}/src/labnotes/render_markdown.py +0 -0
- {labnotes-0.0.68 → labnotes-0.0.69}/src/labnotes/runner/__init__.py +0 -0
- {labnotes-0.0.68 → labnotes-0.0.69}/src/labnotes/runner/describe_event.py +0 -0
- {labnotes-0.0.68 → labnotes-0.0.69}/src/labnotes/runner/execute_run.py +0 -0
- {labnotes-0.0.68 → labnotes-0.0.69}/src/labnotes/runner/hold_folder.py +0 -0
- {labnotes-0.0.68 → labnotes-0.0.69}/src/labnotes/runner/new_param_run_id.py +0 -0
- {labnotes-0.0.68 → labnotes-0.0.69}/src/labnotes/runner/new_run_id.py +0 -0
- {labnotes-0.0.68 → labnotes-0.0.69}/src/labnotes/runner/new_stamped_run_id.py +0 -0
- {labnotes-0.0.68 → labnotes-0.0.69}/src/labnotes/runner/param_args.py +0 -0
- {labnotes-0.0.68 → labnotes-0.0.69}/src/labnotes/runner/param_grid.py +0 -0
- {labnotes-0.0.68 → labnotes-0.0.69}/src/labnotes/runner/param_run_name.py +0 -0
- {labnotes-0.0.68 → labnotes-0.0.69}/src/labnotes/runner/plan_runs.py +0 -0
- {labnotes-0.0.68 → labnotes-0.0.69}/src/labnotes/runner/run_folder.py +0 -0
- {labnotes-0.0.68 → labnotes-0.0.69}/src/labnotes/runner/run_headless.py +0 -0
- {labnotes-0.0.68 → labnotes-0.0.69}/src/labnotes/runner/runs_parent.py +0 -0
- {labnotes-0.0.68 → labnotes-0.0.69}/src/labnotes/runner/shell_command.py +0 -0
- {labnotes-0.0.68 → labnotes-0.0.69}/src/labnotes/runner/stop_then_kill.py +0 -0
- {labnotes-0.0.68 → labnotes-0.0.69}/src/labnotes/runner/wait_for_group.py +0 -0
- {labnotes-0.0.68 → labnotes-0.0.69}/src/labnotes/runner/write_run_json.py +0 -0
- {labnotes-0.0.68 → labnotes-0.0.69}/src/labnotes/save_conflict_copy.py +0 -0
- {labnotes-0.0.68 → labnotes-0.0.69}/src/labnotes/save_note.py +0 -0
- {labnotes-0.0.68 → labnotes-0.0.69}/src/labnotes/saved_outputs.py +0 -0
- {labnotes-0.0.68 → labnotes-0.0.69}/src/labnotes/serve_app.py +0 -0
- {labnotes-0.0.68 → labnotes-0.0.69}/src/labnotes/server.py +0 -0
- {labnotes-0.0.68 → labnotes-0.0.69}/src/labnotes/sort_href.py +0 -0
- {labnotes-0.0.68 → labnotes-0.0.69}/src/labnotes/sql_quote.py +0 -0
- {labnotes-0.0.68 → labnotes-0.0.69}/src/labnotes/static/experiment.js +0 -0
- {labnotes-0.0.68 → labnotes-0.0.69}/src/labnotes/static/labnotes.css +0 -0
- {labnotes-0.0.68 → labnotes-0.0.69}/src/labnotes/static/new-note.js +0 -0
- {labnotes-0.0.68 → labnotes-0.0.69}/src/labnotes/static/note-edit.js +0 -0
- {labnotes-0.0.68 → labnotes-0.0.69}/src/labnotes/static/note-editor.js +0 -0
- {labnotes-0.0.68 → labnotes-0.0.69}/src/labnotes/static/row-link.js +0 -0
- {labnotes-0.0.68 → labnotes-0.0.69}/src/labnotes/static/run-cell.js +0 -0
- {labnotes-0.0.68 → labnotes-0.0.69}/src/labnotes/static/view-toggle.js +0 -0
- {labnotes-0.0.68 → labnotes-0.0.69}/src/labnotes/summarize_config.py +0 -0
- {labnotes-0.0.68 → labnotes-0.0.69}/src/labnotes/tables/__init__.py +0 -0
- {labnotes-0.0.68 → labnotes-0.0.69}/src/labnotes/tables/experiment_rows.py +0 -0
- {labnotes-0.0.68 → labnotes-0.0.69}/src/labnotes/tables/file_prefix.py +0 -0
- {labnotes-0.0.68 → labnotes-0.0.69}/src/labnotes/tables/iso_time.py +0 -0
- {labnotes-0.0.68 → labnotes-0.0.69}/src/labnotes/tables/list_experiment_runs.py +0 -0
- {labnotes-0.0.68 → labnotes-0.0.69}/src/labnotes/tables/note_text.py +0 -0
- {labnotes-0.0.68 → labnotes-0.0.69}/src/labnotes/tables/open_tables.py +0 -0
- {labnotes-0.0.68 → labnotes-0.0.69}/src/labnotes/tables/path_glob.py +0 -0
- {labnotes-0.0.68 → labnotes-0.0.69}/src/labnotes/tables/path_pattern.py +0 -0
- {labnotes-0.0.68 → labnotes-0.0.69}/src/labnotes/tables/read_experiment.py +0 -0
- {labnotes-0.0.68 → labnotes-0.0.69}/src/labnotes/tables/read_file.py +0 -0
- {labnotes-0.0.68 → labnotes-0.0.69}/src/labnotes/tables/read_run.py +0 -0
- {labnotes-0.0.68 → labnotes-0.0.69}/src/labnotes/tables/summarize_experiments.py +0 -0
- {labnotes-0.0.68 → labnotes-0.0.69}/src/labnotes/templates/base.html +0 -0
- {labnotes-0.0.68 → labnotes-0.0.69}/src/labnotes/templates/editor_imports.html +0 -0
- {labnotes-0.0.68 → labnotes-0.0.69}/src/labnotes/templates/experiment.html +0 -0
- {labnotes-0.0.68 → labnotes-0.0.69}/src/labnotes/templates/index.html +0 -0
- {labnotes-0.0.68 → labnotes-0.0.69}/src/labnotes/templates/note.html +0 -0
- {labnotes-0.0.68 → labnotes-0.0.69}/src/labnotes/tui/__init__.py +0 -0
- {labnotes-0.0.68 → labnotes-0.0.69}/src/labnotes/tui/dim.py +0 -0
- {labnotes-0.0.68 → labnotes-0.0.69}/src/labnotes/tui/format_elapsed.py +0 -0
- {labnotes-0.0.68 → labnotes-0.0.69}/src/labnotes/tui/run_app.py +0 -0
- {labnotes-0.0.68 → labnotes-0.0.69}/src/labnotes/tui/run_tui.py +0 -0
- {labnotes-0.0.68 → labnotes-0.0.69}/src/labnotes/tui/runs_table.py +0 -0
- {labnotes-0.0.68 → labnotes-0.0.69}/src/labnotes/wait_for_note.py +0 -0
- {labnotes-0.0.68 → labnotes-0.0.69}/testing-conventions.toml +0 -0
- {labnotes-0.0.68 → labnotes-0.0.69}/tests/integration/conftest.py +0 -0
- {labnotes-0.0.68 → labnotes-0.0.69}/uv.lock +0 -0
|
@@ -10,10 +10,11 @@ from labnotes.modes import MODES
|
|
|
10
10
|
SETTINGS = {"name", "command", "repeats", "params", "counts", "mode", "concurrency"}
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
def read_experiment_config(
|
|
13
|
+
def read_experiment_config(
|
|
14
|
+
path: Path, source: str, mode: str, concurrency: int
|
|
15
|
+
) -> ExperimentConfig:
|
|
14
16
|
try:
|
|
15
|
-
|
|
16
|
-
values = tomllib.load(file)
|
|
17
|
+
values = tomllib.loads(source)
|
|
17
18
|
except tomllib.TOMLDecodeError as error:
|
|
18
19
|
raise ValueError(f"{path}: {error}") from error
|
|
19
20
|
unknown = sorted(values.keys() - SETTINGS)
|
|
@@ -17,6 +17,7 @@ from labnotes.runner.new_stamped_run_id import new_stamped_run_id
|
|
|
17
17
|
from labnotes.runner.param_grid import param_grid
|
|
18
18
|
from labnotes.runner.plan_runs import plan_runs
|
|
19
19
|
from labnotes.runner.run_folder import run_folder
|
|
20
|
+
from labnotes.tables.experiment_run_ids import experiment_run_ids
|
|
20
21
|
from labnotes.tables.list_experiment_runs import list_experiment_runs
|
|
21
22
|
from labnotes.tables.open_tables import open_tables
|
|
22
23
|
|
|
@@ -31,18 +32,17 @@ async def run_experiment(
|
|
|
31
32
|
report: Report,
|
|
32
33
|
listen: Listen,
|
|
33
34
|
) -> list[dict[str, object]]:
|
|
35
|
+
tables = open_tables(config)
|
|
36
|
+
existing = await experiment_run_ids(tables, name)
|
|
34
37
|
finished: list[dict[str, object]] = []
|
|
35
38
|
match experiment.mode:
|
|
36
39
|
case "fill":
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
finished = [json.loads(str(r["params"])) for r in existing if r["counted"]]
|
|
40
|
+
counted = await list_experiment_runs(tables, name, experiment.counts)
|
|
41
|
+
finished = [json.loads(str(r["params"])) for r in counted if r["counted"]]
|
|
40
42
|
planned: set[str] = set()
|
|
41
43
|
|
|
42
44
|
def taken(run: str) -> bool:
|
|
43
|
-
return
|
|
44
|
-
run in planned or run_folder(config.root, config.runs, name, run).exists()
|
|
45
|
-
)
|
|
45
|
+
return run in planned or run in existing
|
|
46
46
|
|
|
47
47
|
group = new_stamped_run_id(taken) if experiment.mode == "adhoc" else None
|
|
48
48
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import asyncio
|
|
1
2
|
from collections.abc import Callable
|
|
2
3
|
from functools import partial
|
|
3
4
|
from pathlib import Path
|
|
@@ -7,6 +8,7 @@ from labnotes.runner.hold_folder import hold_folder
|
|
|
7
8
|
from labnotes.runner.read_experiment_config import read_experiment_config
|
|
8
9
|
from labnotes.runner.run_experiment import run_experiment
|
|
9
10
|
from labnotes.runner.runs_parent import runs_parent
|
|
11
|
+
from labnotes.tables.file_text import file_text
|
|
10
12
|
|
|
11
13
|
|
|
12
14
|
def start_experiment(
|
|
@@ -19,10 +21,11 @@ def start_experiment(
|
|
|
19
21
|
if experiment_config is None:
|
|
20
22
|
folder = config.experiments.replace("{experiment}", name)
|
|
21
23
|
experiment_config = config.root / folder / "experiment.toml"
|
|
22
|
-
|
|
24
|
+
source = asyncio.run(file_text(config.root, experiment_config))
|
|
25
|
+
if source is None:
|
|
23
26
|
raise ValueError(f"No experiment.toml for {name} at {experiment_config}.")
|
|
24
27
|
experiment = read_experiment_config(
|
|
25
|
-
experiment_config, config.mode, config.concurrency
|
|
28
|
+
experiment_config, source, config.mode, config.concurrency
|
|
26
29
|
)
|
|
27
30
|
if concurrency is None:
|
|
28
31
|
concurrency = experiment.concurrency
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
from dirsql import DirSQL
|
|
2
|
+
|
|
3
|
+
from labnotes.sql_quote import quote_string
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
async def experiment_run_ids(tables: DirSQL, name: str) -> set[str]:
|
|
7
|
+
rows = await tables.query(
|
|
8
|
+
f"SELECT id FROM runs WHERE experiment = {quote_string(name)}"
|
|
9
|
+
)
|
|
10
|
+
ids = {str(row["id"]) for row in rows}
|
|
11
|
+
return ids | {run.split("/")[0] for run in ids}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
from pathlib import Path
|
|
2
|
+
|
|
3
|
+
from dirsql import DirSQL
|
|
4
|
+
|
|
5
|
+
from labnotes.sql_quote import quote_string
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
async def file_text(root: Path, path: Path) -> str | None:
|
|
9
|
+
rows = await DirSQL(str(root), tables=[], no_ignore=True).query(
|
|
10
|
+
f"SELECT content FROM {quote_string(str(path))}"
|
|
11
|
+
)
|
|
12
|
+
return next((str(row["content"] or "") for row in rows), None)
|
|
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
|
|
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
|
|
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
|
|
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
|