cellproof 0.3.0__tar.gz → 0.3.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.
Files changed (110) hide show
  1. {cellproof-0.3.0 → cellproof-0.3.1}/CHANGELOG.md +6 -0
  2. {cellproof-0.3.0 → cellproof-0.3.1}/PKG-INFO +1 -1
  3. {cellproof-0.3.0 → cellproof-0.3.1}/pyproject.toml +1 -1
  4. cellproof-0.3.1/src/cellproof/__init__.py +1 -0
  5. {cellproof-0.3.0 → cellproof-0.3.1}/src/cellproof/fn/dates.py +3 -2
  6. {cellproof-0.3.0 → cellproof-0.3.1}/tests/test_finance_stats.py +8 -0
  7. cellproof-0.3.0/src/cellproof/__init__.py +0 -1
  8. {cellproof-0.3.0 → cellproof-0.3.1}/.github/workflows/ci.yml +0 -0
  9. {cellproof-0.3.0 → cellproof-0.3.1}/.github/workflows/publish.yml +0 -0
  10. {cellproof-0.3.0 → cellproof-0.3.1}/.gitignore +0 -0
  11. {cellproof-0.3.0 → cellproof-0.3.1}/AGENTS.md +0 -0
  12. {cellproof-0.3.0 → cellproof-0.3.1}/DESIGN.md +0 -0
  13. {cellproof-0.3.0 → cellproof-0.3.1}/INFO.md +0 -0
  14. {cellproof-0.3.0 → cellproof-0.3.1}/LICENSE +0 -0
  15. {cellproof-0.3.0 → cellproof-0.3.1}/PLAN-2a.md +0 -0
  16. {cellproof-0.3.0 → cellproof-0.3.1}/PLAN-2b.md +0 -0
  17. {cellproof-0.3.0 → cellproof-0.3.1}/PLAN.md +0 -0
  18. {cellproof-0.3.0 → cellproof-0.3.1}/PROGRESS.md +0 -0
  19. {cellproof-0.3.0 → cellproof-0.3.1}/README.md +0 -0
  20. {cellproof-0.3.0 → cellproof-0.3.1}/SECURITY.md +0 -0
  21. {cellproof-0.3.0 → cellproof-0.3.1}/docs/JOURNEY.md +0 -0
  22. {cellproof-0.3.0 → cellproof-0.3.1}/docs/superpowers/plans/2026-10-14-plan-2c-speed.md +0 -0
  23. {cellproof-0.3.0 → cellproof-0.3.1}/docs/superpowers/plans/2026-10-14-plan-2d-table-mode.md +0 -0
  24. {cellproof-0.3.0 → cellproof-0.3.1}/docs/superpowers/specs/2026-10-14-plan-2c-speed-design.md +0 -0
  25. {cellproof-0.3.0 → cellproof-0.3.1}/docs/superpowers/specs/2026-10-14-plan-2d-table-mode-design.md +0 -0
  26. {cellproof-0.3.0 → cellproof-0.3.1}/docs/superpowers/specs/2026-10-18-running-totals-design.md +0 -0
  27. {cellproof-0.3.0 → cellproof-0.3.1}/docs/superpowers/specs/2026-10-19-lookups-row-wise-design.md +0 -0
  28. {cellproof-0.3.0 → cellproof-0.3.1}/examples/commission.xlsx +0 -0
  29. {cellproof-0.3.0 → cellproof-0.3.1}/examples/errors.xlsx +0 -0
  30. {cellproof-0.3.0 → cellproof-0.3.1}/examples/functions.xlsx +0 -0
  31. {cellproof-0.3.0 → cellproof-0.3.1}/examples/functions_unsaved.xlsx +0 -0
  32. {cellproof-0.3.0 → cellproof-0.3.1}/examples/make_commission.py +0 -0
  33. {cellproof-0.3.0 → cellproof-0.3.1}/examples/make_errors.py +0 -0
  34. {cellproof-0.3.0 → cellproof-0.3.1}/examples/make_functions.py +0 -0
  35. {cellproof-0.3.0 → cellproof-0.3.1}/src/cellproof/__main__.py +0 -0
  36. {cellproof-0.3.0 → cellproof-0.3.1}/src/cellproof/cli.py +0 -0
  37. {cellproof-0.3.0 → cellproof-0.3.1}/src/cellproof/compiler.py +0 -0
  38. {cellproof-0.3.0 → cellproof-0.3.1}/src/cellproof/compute.py +0 -0
  39. {cellproof-0.3.0 → cellproof-0.3.1}/src/cellproof/emitter.py +0 -0
  40. {cellproof-0.3.0 → cellproof-0.3.1}/src/cellproof/expr.py +0 -0
  41. {cellproof-0.3.0 → cellproof-0.3.1}/src/cellproof/fenwick.py +0 -0
  42. {cellproof-0.3.0 → cellproof-0.3.1}/src/cellproof/fn/__init__.py +0 -0
  43. {cellproof-0.3.0 → cellproof-0.3.1}/src/cellproof/fn/aggregate.py +0 -0
  44. {cellproof-0.3.0 → cellproof-0.3.1}/src/cellproof/fn/criteria.py +0 -0
  45. {cellproof-0.3.0 → cellproof-0.3.1}/src/cellproof/fn/finance.py +0 -0
  46. {cellproof-0.3.0 → cellproof-0.3.1}/src/cellproof/fn/logic.py +0 -0
  47. {cellproof-0.3.0 → cellproof-0.3.1}/src/cellproof/fn/lookup.py +0 -0
  48. {cellproof-0.3.0 → cellproof-0.3.1}/src/cellproof/fn/maths.py +0 -0
  49. {cellproof-0.3.0 → cellproof-0.3.1}/src/cellproof/fn/stats.py +0 -0
  50. {cellproof-0.3.0 → cellproof-0.3.1}/src/cellproof/fn/text.py +0 -0
  51. {cellproof-0.3.0 → cellproof-0.3.1}/src/cellproof/functions.py +0 -0
  52. {cellproof-0.3.0 → cellproof-0.3.1}/src/cellproof/graph.py +0 -0
  53. {cellproof-0.3.0 → cellproof-0.3.1}/src/cellproof/impact.py +0 -0
  54. {cellproof-0.3.0 → cellproof-0.3.1}/src/cellproof/model.py +0 -0
  55. {cellproof-0.3.0 → cellproof-0.3.1}/src/cellproof/parser.py +0 -0
  56. {cellproof-0.3.0 → cellproof-0.3.1}/src/cellproof/r1c1.py +0 -0
  57. {cellproof-0.3.0 → cellproof-0.3.1}/src/cellproof/rangeindex.py +0 -0
  58. {cellproof-0.3.0 → cellproof-0.3.1}/src/cellproof/reader.py +0 -0
  59. {cellproof-0.3.0 → cellproof-0.3.1}/src/cellproof/refs.py +0 -0
  60. {cellproof-0.3.0 → cellproof-0.3.1}/src/cellproof/region.py +0 -0
  61. {cellproof-0.3.0 → cellproof-0.3.1}/src/cellproof/regions.py +0 -0
  62. {cellproof-0.3.0 → cellproof-0.3.1}/src/cellproof/report.py +0 -0
  63. {cellproof-0.3.0 → cellproof-0.3.1}/src/cellproof/tables.py +0 -0
  64. {cellproof-0.3.0 → cellproof-0.3.1}/src/cellproof/verifier.py +0 -0
  65. {cellproof-0.3.0 → cellproof-0.3.1}/tests/bench_shapes.py +0 -0
  66. {cellproof-0.3.0 → cellproof-0.3.1}/tests/corpus.py +0 -0
  67. {cellproof-0.3.0 → cellproof-0.3.1}/tests/test_aggregate.py +0 -0
  68. {cellproof-0.3.0 → cellproof-0.3.1}/tests/test_arrays.py +0 -0
  69. {cellproof-0.3.0 → cellproof-0.3.1}/tests/test_batches.py +0 -0
  70. {cellproof-0.3.0 → cellproof-0.3.1}/tests/test_cli.py +0 -0
  71. {cellproof-0.3.0 → cellproof-0.3.1}/tests/test_compiler.py +0 -0
  72. {cellproof-0.3.0 → cellproof-0.3.1}/tests/test_compute.py +0 -0
  73. {cellproof-0.3.0 → cellproof-0.3.1}/tests/test_corpus_findings.py +0 -0
  74. {cellproof-0.3.0 → cellproof-0.3.1}/tests/test_criteria.py +0 -0
  75. {cellproof-0.3.0 → cellproof-0.3.1}/tests/test_dates.py +0 -0
  76. {cellproof-0.3.0 → cellproof-0.3.1}/tests/test_emitter.py +0 -0
  77. {cellproof-0.3.0 → cellproof-0.3.1}/tests/test_errors.py +0 -0
  78. {cellproof-0.3.0 → cellproof-0.3.1}/tests/test_excel_findings.py +0 -0
  79. {cellproof-0.3.0 → cellproof-0.3.1}/tests/test_excel_saved.py +0 -0
  80. {cellproof-0.3.0 → cellproof-0.3.1}/tests/test_fenwick.py +0 -0
  81. {cellproof-0.3.0 → cellproof-0.3.1}/tests/test_functions.py +0 -0
  82. {cellproof-0.3.0 → cellproof-0.3.1}/tests/test_graph.py +0 -0
  83. {cellproof-0.3.0 → cellproof-0.3.1}/tests/test_impact.py +0 -0
  84. {cellproof-0.3.0 → cellproof-0.3.1}/tests/test_implicit.py +0 -0
  85. {cellproof-0.3.0 → cellproof-0.3.1}/tests/test_index.py +0 -0
  86. {cellproof-0.3.0 → cellproof-0.3.1}/tests/test_lexed.py +0 -0
  87. {cellproof-0.3.0 → cellproof-0.3.1}/tests/test_limits.py +0 -0
  88. {cellproof-0.3.0 → cellproof-0.3.1}/tests/test_logic.py +0 -0
  89. {cellproof-0.3.0 → cellproof-0.3.1}/tests/test_lookup.py +0 -0
  90. {cellproof-0.3.0 → cellproof-0.3.1}/tests/test_lookups.py +0 -0
  91. {cellproof-0.3.0 → cellproof-0.3.1}/tests/test_maths.py +0 -0
  92. {cellproof-0.3.0 → cellproof-0.3.1}/tests/test_parser.py +0 -0
  93. {cellproof-0.3.0 → cellproof-0.3.1}/tests/test_perf.py +0 -0
  94. {cellproof-0.3.0 → cellproof-0.3.1}/tests/test_r1c1.py +0 -0
  95. {cellproof-0.3.0 → cellproof-0.3.1}/tests/test_rangeindex.py +0 -0
  96. {cellproof-0.3.0 → cellproof-0.3.1}/tests/test_reader.py +0 -0
  97. {cellproof-0.3.0 → cellproof-0.3.1}/tests/test_refs.py +0 -0
  98. {cellproof-0.3.0 → cellproof-0.3.1}/tests/test_region.py +0 -0
  99. {cellproof-0.3.0 → cellproof-0.3.1}/tests/test_regions.py +0 -0
  100. {cellproof-0.3.0 → cellproof-0.3.1}/tests/test_regions_differential.py +0 -0
  101. {cellproof-0.3.0 → cellproof-0.3.1}/tests/test_regions_split.py +0 -0
  102. {cellproof-0.3.0 → cellproof-0.3.1}/tests/test_report.py +0 -0
  103. {cellproof-0.3.0 → cellproof-0.3.1}/tests/test_review_regressions.py +0 -0
  104. {cellproof-0.3.0 → cellproof-0.3.1}/tests/test_running.py +0 -0
  105. {cellproof-0.3.0 → cellproof-0.3.1}/tests/test_shapes.py +0 -0
  106. {cellproof-0.3.0 → cellproof-0.3.1}/tests/test_tables.py +0 -0
  107. {cellproof-0.3.0 → cellproof-0.3.1}/tests/test_text.py +0 -0
  108. {cellproof-0.3.0 → cellproof-0.3.1}/tests/test_types.py +0 -0
  109. {cellproof-0.3.0 → cellproof-0.3.1}/tests/test_verifier.py +0 -0
  110. {cellproof-0.3.0 → cellproof-0.3.1}/tests/xlsxkit.py +0 -0
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.3.1 (2026-10-31)
4
+
5
+ - **WORKDAY with a huge holidays range** (`WORKDAY(A1,5,I1:XFD1048576)`): the days it searched were sized by the
6
+ range's area, so one workbook could make DuckDB fail or exhaust memory. The search now covers 2 days per holiday
7
+ actually in the range, never past Excel's last date.
8
+
3
9
  ## 0.3.0 (2026-10-31)
4
10
 
5
11
  - **Finance:** PMT, PV, FV, NPER, NPV. Microsoft's closed forms; NPV skips text, TRUE/FALSE and empty cells in a
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: cellproof
3
- Version: 0.3.0
3
+ Version: 0.3.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
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "cellproof"
7
- version = "0.3.0"
7
+ version = "0.3.1"
8
8
  description = "Turn an Excel workbook into SQL (a dbt project on DuckDB) and prove every number matches."
9
9
  readme = "README.md"
10
10
  license = "MIT"
@@ -0,0 +1 @@
1
+ __version__ = "0.3.1"
@@ -270,10 +270,11 @@ def workday(c, args, sheet):
270
270
  s = _serial(c, args[0], sheet)
271
271
  d = num(c.expr(args[1], sheet))
272
272
  rng, odd = _holidays(c, args, sheet, "WORKDAY", 2)
273
- extra = 0 if rng is None else 2 * (rng.area.r2 - rng.area.r1 + 1) * (rng.area.c2 - rng.area.c1 + 1)
273
+ # the holidays actually there, not the range's area (H:XFD would be 3E10 days); never past Excel's last date
274
+ extra = "0" if rng is None else f"2 * (SELECT COUNT(*) FROM ({_holiday_serials(rng)}) hol)"
274
275
  n = f"CAST(abs(trunc({d.sql})) AS BIGINT)"
275
276
  step = f"(CASE WHEN {d.sql} < 0 THEN -1 ELSE 1 END)"
276
- span = f"({n} * 7 // 5 + 7 + {extra})" # enough calendar days to hold n working days and every holiday
277
+ span = f"LEAST({n} * 7 // 5 + 7 + {extra}, {MAX_SERIAL + 7})" # room for n working days and each holiday
277
278
  start = f"CAST({s.sql} AS BIGINT)"
278
279
  skip = "" if rng is None else f" AND x NOT IN ({_holiday_serials(rng)})"
279
280
  days = (f"SELECT x, row_number() OVER (ORDER BY x * {step}) AS rn FROM "
@@ -125,3 +125,11 @@ def test_pasted_down_columns_equal_cell_mode():
125
125
  assert regions.unresolved == cells.unresolved
126
126
  assert execute(book, regions) == execute(book, cells)
127
127
  assert len(cells.unresolved) < 12, cells.unresolved # only the UNCHECKED-free formulas compile everywhere
128
+
129
+
130
+ def test_workday_over_a_huge_holiday_range_stays_small():
131
+ # the span is sized by the holidays present, not the range's area (I1:XFD1048576 is 1.7E10 empty cells)
132
+ import time
133
+ t = time.time()
134
+ run([("=WORKDAY(39722,151,D!I1:XFD1048576)", 39933), ("=WORKDAY(39722,151,D!G1:G1048576)", 39938)])
135
+ assert time.time() - t < 10
@@ -1 +0,0 @@
1
- __version__ = "0.3.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
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