cellproof 0.6.0__tar.gz → 0.6.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.
- {cellproof-0.6.0 → cellproof-0.6.1}/CHANGELOG.md +6 -0
- {cellproof-0.6.0 → cellproof-0.6.1}/PKG-INFO +1 -1
- {cellproof-0.6.0 → cellproof-0.6.1}/pyproject.toml +1 -1
- cellproof-0.6.1/src/cellproof/__init__.py +1 -0
- {cellproof-0.6.0 → cellproof-0.6.1}/src/cellproof/fn/maths.py +13 -0
- {cellproof-0.6.0 → cellproof-0.6.1}/src/cellproof/functions.py +0 -8
- {cellproof-0.6.0 → cellproof-0.6.1}/tests/test_maths.py +16 -0
- cellproof-0.6.0/src/cellproof/__init__.py +0 -1
- {cellproof-0.6.0 → cellproof-0.6.1}/.github/workflows/ci.yml +0 -0
- {cellproof-0.6.0 → cellproof-0.6.1}/.github/workflows/publish.yml +0 -0
- {cellproof-0.6.0 → cellproof-0.6.1}/.gitignore +0 -0
- {cellproof-0.6.0 → cellproof-0.6.1}/AGENTS.md +0 -0
- {cellproof-0.6.0 → cellproof-0.6.1}/DESIGN.md +0 -0
- {cellproof-0.6.0 → cellproof-0.6.1}/INFO.md +0 -0
- {cellproof-0.6.0 → cellproof-0.6.1}/LICENSE +0 -0
- {cellproof-0.6.0 → cellproof-0.6.1}/PLAN-2a.md +0 -0
- {cellproof-0.6.0 → cellproof-0.6.1}/PLAN-2b.md +0 -0
- {cellproof-0.6.0 → cellproof-0.6.1}/PLAN.md +0 -0
- {cellproof-0.6.0 → cellproof-0.6.1}/PROGRESS.md +0 -0
- {cellproof-0.6.0 → cellproof-0.6.1}/README.md +0 -0
- {cellproof-0.6.0 → cellproof-0.6.1}/SECURITY.md +0 -0
- {cellproof-0.6.0 → cellproof-0.6.1}/docs/JOURNEY.md +0 -0
- {cellproof-0.6.0 → cellproof-0.6.1}/docs/superpowers/plans/2026-10-14-plan-2c-speed.md +0 -0
- {cellproof-0.6.0 → cellproof-0.6.1}/docs/superpowers/plans/2026-10-14-plan-2d-table-mode.md +0 -0
- {cellproof-0.6.0 → cellproof-0.6.1}/docs/superpowers/specs/2026-10-14-plan-2c-speed-design.md +0 -0
- {cellproof-0.6.0 → cellproof-0.6.1}/docs/superpowers/specs/2026-10-14-plan-2d-table-mode-design.md +0 -0
- {cellproof-0.6.0 → cellproof-0.6.1}/docs/superpowers/specs/2026-10-18-running-totals-design.md +0 -0
- {cellproof-0.6.0 → cellproof-0.6.1}/docs/superpowers/specs/2026-10-19-lookups-row-wise-design.md +0 -0
- {cellproof-0.6.0 → cellproof-0.6.1}/examples/commission.xlsx +0 -0
- {cellproof-0.6.0 → cellproof-0.6.1}/examples/errors.xlsx +0 -0
- {cellproof-0.6.0 → cellproof-0.6.1}/examples/functions.xlsx +0 -0
- {cellproof-0.6.0 → cellproof-0.6.1}/examples/functions_unsaved.xlsx +0 -0
- {cellproof-0.6.0 → cellproof-0.6.1}/examples/make_commission.py +0 -0
- {cellproof-0.6.0 → cellproof-0.6.1}/examples/make_errors.py +0 -0
- {cellproof-0.6.0 → cellproof-0.6.1}/examples/make_functions.py +0 -0
- {cellproof-0.6.0 → cellproof-0.6.1}/src/cellproof/__main__.py +0 -0
- {cellproof-0.6.0 → cellproof-0.6.1}/src/cellproof/cli.py +0 -0
- {cellproof-0.6.0 → cellproof-0.6.1}/src/cellproof/compiler.py +0 -0
- {cellproof-0.6.0 → cellproof-0.6.1}/src/cellproof/compute.py +0 -0
- {cellproof-0.6.0 → cellproof-0.6.1}/src/cellproof/emitter.py +0 -0
- {cellproof-0.6.0 → cellproof-0.6.1}/src/cellproof/expr.py +0 -0
- {cellproof-0.6.0 → cellproof-0.6.1}/src/cellproof/fenwick.py +0 -0
- {cellproof-0.6.0 → cellproof-0.6.1}/src/cellproof/fn/__init__.py +0 -0
- {cellproof-0.6.0 → cellproof-0.6.1}/src/cellproof/fn/aggregate.py +0 -0
- {cellproof-0.6.0 → cellproof-0.6.1}/src/cellproof/fn/criteria.py +0 -0
- {cellproof-0.6.0 → cellproof-0.6.1}/src/cellproof/fn/dates.py +0 -0
- {cellproof-0.6.0 → cellproof-0.6.1}/src/cellproof/fn/dynamic.py +0 -0
- {cellproof-0.6.0 → cellproof-0.6.1}/src/cellproof/fn/finance.py +0 -0
- {cellproof-0.6.0 → cellproof-0.6.1}/src/cellproof/fn/logic.py +0 -0
- {cellproof-0.6.0 → cellproof-0.6.1}/src/cellproof/fn/lookup.py +0 -0
- {cellproof-0.6.0 → cellproof-0.6.1}/src/cellproof/fn/stats.py +0 -0
- {cellproof-0.6.0 → cellproof-0.6.1}/src/cellproof/fn/text.py +0 -0
- {cellproof-0.6.0 → cellproof-0.6.1}/src/cellproof/graph.py +0 -0
- {cellproof-0.6.0 → cellproof-0.6.1}/src/cellproof/impact.py +0 -0
- {cellproof-0.6.0 → cellproof-0.6.1}/src/cellproof/model.py +0 -0
- {cellproof-0.6.0 → cellproof-0.6.1}/src/cellproof/parser.py +0 -0
- {cellproof-0.6.0 → cellproof-0.6.1}/src/cellproof/r1c1.py +0 -0
- {cellproof-0.6.0 → cellproof-0.6.1}/src/cellproof/rangeindex.py +0 -0
- {cellproof-0.6.0 → cellproof-0.6.1}/src/cellproof/reader.py +0 -0
- {cellproof-0.6.0 → cellproof-0.6.1}/src/cellproof/refs.py +0 -0
- {cellproof-0.6.0 → cellproof-0.6.1}/src/cellproof/region.py +0 -0
- {cellproof-0.6.0 → cellproof-0.6.1}/src/cellproof/regions.py +0 -0
- {cellproof-0.6.0 → cellproof-0.6.1}/src/cellproof/report.py +0 -0
- {cellproof-0.6.0 → cellproof-0.6.1}/src/cellproof/tables.py +0 -0
- {cellproof-0.6.0 → cellproof-0.6.1}/src/cellproof/verifier.py +0 -0
- {cellproof-0.6.0 → cellproof-0.6.1}/tests/bench_shapes.py +0 -0
- {cellproof-0.6.0 → cellproof-0.6.1}/tests/corpus.py +0 -0
- {cellproof-0.6.0 → cellproof-0.6.1}/tests/test_aggregate.py +0 -0
- {cellproof-0.6.0 → cellproof-0.6.1}/tests/test_arrays.py +0 -0
- {cellproof-0.6.0 → cellproof-0.6.1}/tests/test_batches.py +0 -0
- {cellproof-0.6.0 → cellproof-0.6.1}/tests/test_cli.py +0 -0
- {cellproof-0.6.0 → cellproof-0.6.1}/tests/test_compiler.py +0 -0
- {cellproof-0.6.0 → cellproof-0.6.1}/tests/test_compute.py +0 -0
- {cellproof-0.6.0 → cellproof-0.6.1}/tests/test_corpus_findings.py +0 -0
- {cellproof-0.6.0 → cellproof-0.6.1}/tests/test_criteria.py +0 -0
- {cellproof-0.6.0 → cellproof-0.6.1}/tests/test_dates.py +0 -0
- {cellproof-0.6.0 → cellproof-0.6.1}/tests/test_dynamic.py +0 -0
- {cellproof-0.6.0 → cellproof-0.6.1}/tests/test_emitter.py +0 -0
- {cellproof-0.6.0 → cellproof-0.6.1}/tests/test_errors.py +0 -0
- {cellproof-0.6.0 → cellproof-0.6.1}/tests/test_excel_findings.py +0 -0
- {cellproof-0.6.0 → cellproof-0.6.1}/tests/test_excel_saved.py +0 -0
- {cellproof-0.6.0 → cellproof-0.6.1}/tests/test_fenwick.py +0 -0
- {cellproof-0.6.0 → cellproof-0.6.1}/tests/test_finance_stats.py +0 -0
- {cellproof-0.6.0 → cellproof-0.6.1}/tests/test_functions.py +0 -0
- {cellproof-0.6.0 → cellproof-0.6.1}/tests/test_graph.py +0 -0
- {cellproof-0.6.0 → cellproof-0.6.1}/tests/test_impact.py +0 -0
- {cellproof-0.6.0 → cellproof-0.6.1}/tests/test_implicit.py +0 -0
- {cellproof-0.6.0 → cellproof-0.6.1}/tests/test_index.py +0 -0
- {cellproof-0.6.0 → cellproof-0.6.1}/tests/test_lexed.py +0 -0
- {cellproof-0.6.0 → cellproof-0.6.1}/tests/test_limits.py +0 -0
- {cellproof-0.6.0 → cellproof-0.6.1}/tests/test_logic.py +0 -0
- {cellproof-0.6.0 → cellproof-0.6.1}/tests/test_lookup.py +0 -0
- {cellproof-0.6.0 → cellproof-0.6.1}/tests/test_lookups.py +0 -0
- {cellproof-0.6.0 → cellproof-0.6.1}/tests/test_parser.py +0 -0
- {cellproof-0.6.0 → cellproof-0.6.1}/tests/test_perf.py +0 -0
- {cellproof-0.6.0 → cellproof-0.6.1}/tests/test_r1c1.py +0 -0
- {cellproof-0.6.0 → cellproof-0.6.1}/tests/test_rangeindex.py +0 -0
- {cellproof-0.6.0 → cellproof-0.6.1}/tests/test_reader.py +0 -0
- {cellproof-0.6.0 → cellproof-0.6.1}/tests/test_refs.py +0 -0
- {cellproof-0.6.0 → cellproof-0.6.1}/tests/test_region.py +0 -0
- {cellproof-0.6.0 → cellproof-0.6.1}/tests/test_regions.py +0 -0
- {cellproof-0.6.0 → cellproof-0.6.1}/tests/test_regions_differential.py +0 -0
- {cellproof-0.6.0 → cellproof-0.6.1}/tests/test_regions_split.py +0 -0
- {cellproof-0.6.0 → cellproof-0.6.1}/tests/test_report.py +0 -0
- {cellproof-0.6.0 → cellproof-0.6.1}/tests/test_review_regressions.py +0 -0
- {cellproof-0.6.0 → cellproof-0.6.1}/tests/test_running.py +0 -0
- {cellproof-0.6.0 → cellproof-0.6.1}/tests/test_shapes.py +0 -0
- {cellproof-0.6.0 → cellproof-0.6.1}/tests/test_spill.py +0 -0
- {cellproof-0.6.0 → cellproof-0.6.1}/tests/test_tables.py +0 -0
- {cellproof-0.6.0 → cellproof-0.6.1}/tests/test_text.py +0 -0
- {cellproof-0.6.0 → cellproof-0.6.1}/tests/test_types.py +0 -0
- {cellproof-0.6.0 → cellproof-0.6.1}/tests/test_verifier.py +0 -0
- {cellproof-0.6.0 → cellproof-0.6.1}/tests/xlsxkit.py +0 -0
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.6.1 (2026-10-31)
|
|
4
|
+
|
|
5
|
+
- **ROUND rounds the value Excel shows** (15 significant digits, half away from zero): `ROUND(1.005, 2)` is 1.01,
|
|
6
|
+
as in Excel. The double 1.005 is 1.00499999..., and the binary rounding before gave 1.0 - an honest FAIL, never a
|
|
7
|
+
false PASS. Same method as ROUNDUP/ROUNDDOWN; Microsoft's ROUND examples are tests.
|
|
8
|
+
|
|
3
9
|
## 0.6.0 (2026-10-31)
|
|
4
10
|
|
|
5
11
|
- **A batch DuckDB rejects no longer stops the run:** its cells are UNRESOLVED with DuckDB's message, the book is
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: cellproof
|
|
3
|
-
Version: 0.6.
|
|
3
|
+
Version: 0.6.1
|
|
4
4
|
Summary: Turn an Excel workbook into SQL (a dbt project on DuckDB) and prove every number matches.
|
|
5
5
|
Project-URL: Homepage, https://github.com/Nikhil414/cellproof
|
|
6
6
|
Project-URL: Issues, https://github.com/Nikhil414/cellproof/issues
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.6.1"
|
|
@@ -94,6 +94,19 @@ def _digits(name: str, rnd: str):
|
|
|
94
94
|
register(name)(fn)
|
|
95
95
|
|
|
96
96
|
|
|
97
|
+
@register("ROUND")
|
|
98
|
+
def round_(c, args, sheet):
|
|
99
|
+
"""Excel rounds the value it shows, 15 significant digits, half away from zero: ROUND(1.005, 2) is 1.01 although
|
|
100
|
+
the double is 1.00499999... (binary rounding gave 1.0 before 0.6.1). Scaled, snapped to 15 digits, rounded."""
|
|
101
|
+
x, d = _two(c, args, sheet, "ROUND")
|
|
102
|
+
p = f"power(10, trunc({d.sql}))"
|
|
103
|
+
scaled = f"abs({x.sql}) * {p}"
|
|
104
|
+
# a number too big to scale already has no digits there; 10^-400 underflows to 0, and so does the rounded number
|
|
105
|
+
sql = (f"(CASE WHEN {d.sql} > 308 OR NOT isfinite({scaled}) THEN {x.sql} WHEN {p} = 0 THEN CAST(0 AS DOUBLE) "
|
|
106
|
+
f"ELSE sign({x.sql}) * round({xl15(scaled)}) / {p} END)")
|
|
107
|
+
return Expr(sql, "num", errs(x.err, d.err))
|
|
108
|
+
|
|
109
|
+
|
|
97
110
|
_digits("ROUNDUP", "ceil")
|
|
98
111
|
_digits("ROUNDDOWN", "floor")
|
|
99
112
|
_digits("TRUNC", "floor")
|
|
@@ -71,14 +71,6 @@ def if_(c, args, sheet):
|
|
|
71
71
|
return pick(cond.sql, yes, no, errs(cond.err, taken))
|
|
72
72
|
|
|
73
73
|
|
|
74
|
-
@register("ROUND")
|
|
75
|
-
def round_(c, args, sheet):
|
|
76
|
-
arity("ROUND", args, 2, 2)
|
|
77
|
-
x, digits = num(c.expr(args[0], sheet)), num(c.expr(args[1], sheet))
|
|
78
|
-
# DuckDB ROUND on DOUBLE rounds half away from zero like Excel (2.675 -> 2.68, verified on 1.5.6)
|
|
79
|
-
return Expr(f"ROUND({x.sql}, CAST(TRUNC({digits.sql}) AS INTEGER))", "num", errs(x.err, digits.err))
|
|
80
|
-
|
|
81
|
-
|
|
82
74
|
def logical_args(c, name: str, args, sheet: str) -> tuple[list[str], str]:
|
|
83
75
|
"""AND/OR/XOR arguments: (TRUE/FALSE SQL per argument, NULL when it is skipped; their error).
|
|
84
76
|
|
|
@@ -28,3 +28,19 @@ def test_math_functions_and_their_errors():
|
|
|
28
28
|
assert (kind, t) == ("e", want), formula
|
|
29
29
|
else:
|
|
30
30
|
assert kind == "n" and math.isclose(n, want, rel_tol=1e-12), (formula, n)
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def test_round_rounds_the_15_digit_value_excel_sees():
|
|
34
|
+
# Microsoft's ROUND examples, and ROUND(1.005, 2): Excel 1.01 (the double is 1.00499999..., which binary rounding
|
|
35
|
+
# took to 1.0 before 0.6.1); the digits may come from a cell
|
|
36
|
+
cases = [("=ROUND(2.15,1)", 2.2), ("=ROUND(2.149,1)", 2.1), ("=ROUND(-1.475,2)", -1.48), ("=ROUND(21.5,-1)", 20),
|
|
37
|
+
("=ROUND(626.3,-3)", 1000), ("=ROUND(1.98,-1)", 0), ("=ROUND(-50.55,-2)", -100), ("=ROUND(1.005,2)", 1.01),
|
|
38
|
+
("=ROUND(2.675,2)", 2.68), ("=ROUND(2.5,0)", 3), ("=ROUND(-2.5,0)", -3), ("=ROUND(1E+300,10)", 1e300),
|
|
39
|
+
("=ROUND(5,-400)", 0), ("=ROUND(1.005,B1)", 1.01), ("=ROUND(0.1+0.2,15)", 0.3)]
|
|
40
|
+
book = book_of({"S": {"B1": 2.0, **{f"A{i}": (f, v) for i, (f, v) in enumerate(cases, 1)}}})
|
|
41
|
+
compiled = compile_book(book)
|
|
42
|
+
got = execute(book, compiled)
|
|
43
|
+
assert compiled.unresolved == {}
|
|
44
|
+
for i, (formula, want) in enumerate(cases, 1):
|
|
45
|
+
kind, n, _ = got[("S", i, 1)]
|
|
46
|
+
assert kind == "n" and math.isclose(n, want, rel_tol=1e-12, abs_tol=1e-300), (formula, n)
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.6.0"
|
|
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
|
{cellproof-0.6.0 → cellproof-0.6.1}/docs/superpowers/specs/2026-10-14-plan-2c-speed-design.md
RENAMED
|
File without changes
|
{cellproof-0.6.0 → cellproof-0.6.1}/docs/superpowers/specs/2026-10-14-plan-2d-table-mode-design.md
RENAMED
|
File without changes
|
{cellproof-0.6.0 → cellproof-0.6.1}/docs/superpowers/specs/2026-10-18-running-totals-design.md
RENAMED
|
File without changes
|
{cellproof-0.6.0 → cellproof-0.6.1}/docs/superpowers/specs/2026-10-19-lookups-row-wise-design.md
RENAMED
|
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
|