Repository navigation
Conversation
…mmands A paper_numbers rule computes every number the paper cites from the workflow's outputs and writes one table: name, value, format (a Python format spec), source, description. The numbers_tex rule renders it as results/numbers.tex, one \newcommand per row with its source as a comment; main.tex inputs it and the text uses the commands, so a mistyped or missing name stops the build. The renderer (python -m project_name.paper_numbers) escapes commas and percent signs and rejects names that are not letters only or appear twice.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Numbers the paper cites now come from the workflow instead of being typed into the text.
workflow/scripts/paper_numbers.py(rulepaper_numbers) computes each number from the workflow's outputs. It writes one table,results/numbers.csv, with the columnsname, value, format, source, description. The value is stored unformatted;formatis a Python format spec such as,.0for.0%.python -m project_name.paper_numbers(rulenumbers_tex) renders the table asresults/numbers.tex, one\newcommandper row, with the description and source as a comment.2{,}133, 0.559 →56\%.main.texinputs the file, and the text uses the commands (\nExampleRows{}). A mistyped or missing name stops the build.CLAUDE.mdandresults/README.mdnow say not to type computed numbers into the paper.duckdb.sql("from 'results/numbers.csv'").Tested:
make allbuilds through the PDF ("The example dataset has 2 rows, with values summing to 3.").make checkpasses: lint, format, 9 tests, the dry run.