errorbars 0.2.3__tar.gz → 0.2.4__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.
- {errorbars-0.2.3 → errorbars-0.2.4}/CHANGELOG.md +10 -0
- {errorbars-0.2.3 → errorbars-0.2.4}/PKG-INFO +1 -1
- {errorbars-0.2.3 → errorbars-0.2.4}/pyproject.toml +1 -1
- {errorbars-0.2.3 → errorbars-0.2.4}/src/errorbars/__init__.py +1 -1
- {errorbars-0.2.3 → errorbars-0.2.4}/src/errorbars/_tables.py +27 -1
- {errorbars-0.2.3 → errorbars-0.2.4}/src/errorbars/cli.py +12 -2
- {errorbars-0.2.3 → errorbars-0.2.4}/.gitignore +0 -0
- {errorbars-0.2.3 → errorbars-0.2.4}/LICENSE +0 -0
- {errorbars-0.2.3 → errorbars-0.2.4}/README.md +0 -0
- {errorbars-0.2.3 → errorbars-0.2.4}/docs/formulas.md +0 -0
- {errorbars-0.2.3 → errorbars-0.2.4}/src/errorbars/adapters/__init__.py +0 -0
- {errorbars-0.2.3 → errorbars-0.2.4}/src/errorbars/adapters/inspect_ai.py +0 -0
- {errorbars-0.2.3 → errorbars-0.2.4}/src/errorbars/adapters/lm_eval.py +0 -0
- {errorbars-0.2.3 → errorbars-0.2.4}/src/errorbars/compare.py +0 -0
- {errorbars-0.2.3 → errorbars-0.2.4}/src/errorbars/inputs.py +0 -0
- {errorbars-0.2.3 → errorbars-0.2.4}/src/errorbars/io.py +0 -0
- {errorbars-0.2.3 → errorbars-0.2.4}/src/errorbars/leaderboard.py +0 -0
- {errorbars-0.2.3 → errorbars-0.2.4}/src/errorbars/plot.py +0 -0
- {errorbars-0.2.3 → errorbars-0.2.4}/src/errorbars/power.py +0 -0
- {errorbars-0.2.3 → errorbars-0.2.4}/src/errorbars/py.typed +0 -0
- {errorbars-0.2.3 → errorbars-0.2.4}/src/errorbars/stats.py +0 -0
|
@@ -2,6 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project are documented in this file.
|
|
4
4
|
|
|
5
|
+
## [0.2.4] - 2026-10-03
|
|
6
|
+
|
|
7
|
+
### Security
|
|
8
|
+
|
|
9
|
+
- A model name or question id holding a terminal escape sequence was printed as it came: the
|
|
10
|
+
tables and the errors that list models sent it to the terminal, which obeys it (clears the
|
|
11
|
+
screen, retitles the window, hides the rest of the line). Each control character in text
|
|
12
|
+
from the data is now written as a visible escape: `m\x1b]0;title\x07`. `--json` already
|
|
13
|
+
escaped them.
|
|
14
|
+
|
|
5
15
|
## [0.2.3] - 2026-10-03
|
|
6
16
|
|
|
7
17
|
### Compatibility
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: errorbars
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.4
|
|
4
4
|
Summary: Error bars for LLM evals: standard errors, clustering, paired comparisons, leaderboards, and power analysis.
|
|
5
5
|
Project-URL: Homepage, https://antonsoo.github.io/errorbars/
|
|
6
6
|
Project-URL: Repository, https://github.com/antonsoo/errorbars
|
|
@@ -32,7 +32,7 @@ include = ["/src", "/docs/*.md", "/README.md", "/CHANGELOG.md", "/LICENSE*", "/p
|
|
|
32
32
|
|
|
33
33
|
[project]
|
|
34
34
|
name = "errorbars"
|
|
35
|
-
version = "0.2.
|
|
35
|
+
version = "0.2.4"
|
|
36
36
|
description = "Error bars for LLM evals: standard errors, clustering, paired comparisons, leaderboards, and power analysis."
|
|
37
37
|
dynamic = ["readme"]
|
|
38
38
|
license = "MIT"
|
|
@@ -12,10 +12,14 @@ terminal follows three rules, each of which the first version of this broke:
|
|
|
12
12
|
columns wide and cuts each cell to fit, which left two models of one organisation with the
|
|
13
13
|
same visible name. A pipe gets the table at its full width, and a terminal too narrow for
|
|
14
14
|
it gets the long cells folded onto more lines.
|
|
15
|
+
- A name is printed as text. A control character in one (the ESC that starts a terminal escape
|
|
16
|
+
sequence) is written as a visible escape, ``\\x1b``, instead of being sent to the terminal,
|
|
17
|
+
where it could clear the screen, retitle the window or hide the rest of the line.
|
|
15
18
|
"""
|
|
16
19
|
|
|
17
20
|
from __future__ import annotations
|
|
18
21
|
|
|
22
|
+
import re
|
|
19
23
|
from dataclasses import dataclass, field
|
|
20
24
|
from typing import Literal
|
|
21
25
|
|
|
@@ -27,12 +31,32 @@ try:
|
|
|
27
31
|
except ImportError: # pragma: no cover - exercised by the test that hides rich
|
|
28
32
|
HAS_RICH = False
|
|
29
33
|
|
|
30
|
-
__all__ = ["HAS_RICH", "Output", "Table"]
|
|
34
|
+
__all__ = ["HAS_RICH", "Output", "Table", "visible"]
|
|
31
35
|
|
|
32
36
|
Justify = Literal["left", "right"]
|
|
33
37
|
|
|
34
38
|
_UNBOUNDED = 100_000
|
|
35
39
|
|
|
40
|
+
_CONTROL = re.compile(r"[\x00-\x08\x0b\x0c\x0e-\x1f\x7f-\x9f]")
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
def visible(text: str) -> str:
|
|
44
|
+
"""``text`` with each control character (bar tab and line breaks) written as ``\\xNN``.
|
|
45
|
+
|
|
46
|
+
Model names, question ids and the values in an error come from the data, and a terminal
|
|
47
|
+
obeys the escape sequences in what it is given.
|
|
48
|
+
"""
|
|
49
|
+
return _CONTROL.sub(lambda m: f"\\x{ord(m.group()):02x}", text)
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
def _visible_table(table: Table) -> Table:
|
|
53
|
+
return Table(
|
|
54
|
+
title=visible(table.title),
|
|
55
|
+
header_style=table.header_style,
|
|
56
|
+
columns=[(visible(header), justify) for header, justify in table.columns],
|
|
57
|
+
rows=[tuple(visible(cell) for cell in row) for row in table.rows],
|
|
58
|
+
)
|
|
59
|
+
|
|
36
60
|
|
|
37
61
|
@dataclass
|
|
38
62
|
class Table:
|
|
@@ -82,6 +106,7 @@ class Output:
|
|
|
82
106
|
return Console(markup=False, emoji=False, highlight=False, width=width)
|
|
83
107
|
|
|
84
108
|
def table(self, table: Table) -> None:
|
|
109
|
+
table = _visible_table(table)
|
|
85
110
|
if not self._rich:
|
|
86
111
|
if not self._first:
|
|
87
112
|
print()
|
|
@@ -106,6 +131,7 @@ class Output:
|
|
|
106
131
|
self._first = False
|
|
107
132
|
|
|
108
133
|
def note(self, text: str, style: str | None = None) -> None:
|
|
134
|
+
text = visible(text)
|
|
109
135
|
if self._rich:
|
|
110
136
|
self._console().print(text, style=style)
|
|
111
137
|
else:
|
|
@@ -9,7 +9,7 @@ from pathlib import Path
|
|
|
9
9
|
from typing import Any
|
|
10
10
|
|
|
11
11
|
from errorbars import __version__
|
|
12
|
-
from errorbars._tables import Output, Table
|
|
12
|
+
from errorbars._tables import Output, Table, visible
|
|
13
13
|
from errorbars.compare import paired_compare
|
|
14
14
|
from errorbars.inputs import load_inputs
|
|
15
15
|
from errorbars.io import ColumnMap, EvalData, write_csv
|
|
@@ -41,7 +41,7 @@ def _load(args: argparse.Namespace, model: str | None = None) -> EvalData:
|
|
|
41
41
|
except ImportError as exc:
|
|
42
42
|
raise SystemExit(f"error: {exc}") from exc
|
|
43
43
|
for note in loaded.notes:
|
|
44
|
-
print(f"note: {note}", file=sys.stderr)
|
|
44
|
+
print(f"note: {visible(note)}", file=sys.stderr)
|
|
45
45
|
return loaded.data
|
|
46
46
|
|
|
47
47
|
|
|
@@ -497,6 +497,16 @@ def main(argv: list[str] | None = None) -> None:
|
|
|
497
497
|
parser = build_parser()
|
|
498
498
|
args = parser.parse_args(argv)
|
|
499
499
|
_text_streams()
|
|
500
|
+
try:
|
|
501
|
+
_run(args)
|
|
502
|
+
except SystemExit as exc:
|
|
503
|
+
# The messages quote models, files and values from the data.
|
|
504
|
+
if isinstance(exc.code, str):
|
|
505
|
+
raise SystemExit(visible(exc.code)) from exc.__cause__
|
|
506
|
+
raise
|
|
507
|
+
|
|
508
|
+
|
|
509
|
+
def _run(args: argparse.Namespace) -> None:
|
|
500
510
|
try:
|
|
501
511
|
args.func(args)
|
|
502
512
|
except UnicodeDecodeError as exc:
|
|
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
|