mirror of
https://github.com/harvard-edge/cs249r_book.git
synced 2026-07-19 01:14:07 -05:00
- Migrated all legacy constants from constants.py to hardware and model registries - Updated dozens of LEGO blocks in Volume 1 and Volume 2 to use Engine.solve and formulas - Resolved all resulting NameError, TypeError, and AttributeError exceptions in the inline Python blocks - Master Quarto HTML build now passes with zero execution failures
17 lines
573 B
Python
17 lines
573 B
Python
import glob
|
|
|
|
qmds = glob.glob('book/quarto/contents/**/*.qmd', recursive=True)
|
|
for q in qmds:
|
|
with open(q, 'r') as f: c = f.read()
|
|
orig = c
|
|
|
|
# Remove allow_zero=True from fmt_percent
|
|
c = c.replace('fmt_percent(bert_util_peak, precision=1, allow_zero=True, commas=False)', 'fmt_percent(bert_util_peak, precision=1, commas=False)')
|
|
|
|
# Remove allow_zero=True from fmt_percent generally
|
|
c = c.replace('fmt_percent(val, precision=1, allow_zero=True', 'fmt_percent(val, precision=1')
|
|
|
|
if c != orig:
|
|
with open(q, 'w') as f: f.write(c)
|
|
|