"""Section 7 gets the audit that shows the similarity in the step decides whether the readings pay (audit_similarity_places.py, rerun on the regenerated server sweeps); section 3 and the abstract refer to it correctly; 314% -> 315% (18422/4443 = 4.146). Exact anchors. python -u apply_article_audit_step.py """ from __future__ import annotations PATH = "article/sim_numerics.md" AUDIT_PARAGRAPH = ( "\n\n**Which similarity stands in the step decides whether a reading pays.** The readings above, " "and the decision *defect* of §7.2, compare quantities directly — an ordinal judgment of which is " "more similar, in which every decreasing $S$ would decide alike. Their gains nevertheless depend " "on the $S$ that sets the step (`audit_similarity_places.py`, on the same sweeps): on the canonical " "set the triple chosen by shape gains 493 evaluations with the tent in the step and loses 250 with " "$1/\\sqrt{1+z^2}$; *defect* gains 283 with the tent and loses 215 with $1-|z|^{1/3}$. The records " "of this section are the pairing of the tent step with these judgments, not the judgments alone." ) REPL = [ ("the readings of §7 pay only with the tent in the step (§7, the audit of the gains), and in the " "proposed method replacing the tent by any other function costs 12% to 314% (Table 9a).", "the readings of §7 pay most with the tent in the step and some of them lose with other functions " "(§7), and in the proposed method replacing the tent by any other function costs 12% to 315% " "(Table 9a)."), ("and the similarity that sets the step, whose form is decisive (replacing it costs 12% to 314%).", "and the similarity that sets the step, whose form is decisive (replacing it costs 12% to 315%)."), ] ANCHOR = ("Two selections that are each an improvement interfere, which is a reason to measure " "composition rather than assume it.") def main(): with open(PATH, encoding="utf8") as fh: text = fh.read() for old, _new in REPL + [(ANCHOR, "")]: if text.count(old) != 1: raise SystemExit(f"found {text.count(old)}x: {old[:80]}") for old, new in REPL: text = text.replace(old, new) text = text.replace(ANCHOR, ANCHOR + AUDIT_PARAGRAPH) with open(PATH, "w", encoding="utf8") as fh: fh.write(text) print("audit paragraph written") if __name__ == "__main__": main()