#!/usr/bin/env python
"""Every derived figure in the NYC Local Law 144 essay, recomputed from the counts as published.

SHOW YOUR WORK (the authoring rule): no percentage in the essay is typed by hand. Each input below
is a COUNT read off a primary, with its locator; this file does the division so a reader can check
the arithmetic without trusting the prose.

Inputs and where they come from:
  FAccT/arXiv 2406.01399 "Null Compliance", section 6.1 — "Among 267 employers posting open jobs in
      NYC, we found 14 audit reports and 12 transparency notices."
  Same paper, section 5.1 — 155 student investigators, fieldwork 24 Oct to 9 Nov 2023.
  Same paper, section 6.1 — of 26 firms that responded to the survey, 23 reported LL 144 did not
      apply to them.
  NY State Comptroller, "Enforcement of Local Law 144 - Automated Employment Decision Tools",
      published 2 Dec 2025 -
      audit period July 2023 through June 2025; 2 complaints received; 32 companies surveyed;
      1 non-compliance issue identified by DCWP; 17 potential instances identified by auditors.
  Same paper, abstract — "155 student investigators recorded 391 employers' compliance ... 18 posted
      audit reports". Carried here ONLY to show that it is a different population from section 6.1's 267,
      not a correction.

Run: python rates_c5500.py
"""

ROWS = [
    # label, numerator, denominator, source locator
    ("audit reports posted, NYC-job population", 14, 267, "arXiv 2406.01399 section 6.1"),
    ("transparency notices posted, NYC-job population", 12, 267, "arXiv 2406.01399 section 6.1"),
    ("audit reports posted, all employers recorded", 18, 391, "arXiv 2406.01399 abstract"),
    ("survey respondents saying the law did not apply", 23, 26, "arXiv 2406.01399 section 6.1"),
    ("DCWP-identified non-compliance in its own sample", 1, 32, "OSC audit, Dec 2025"),
    ("auditor-identified potential non-compliance, same sample", 17, 32, "OSC audit, Dec 2025"),
]

AUDIT_MONTHS = 24          # July 2023 through June 2025 inclusive of the window the audit names
COMPLAINTS = 2             # OSC audit, Dec 2025


def main():
    print("%-58s %7s %8s" % ("figure", "rate", "source"))
    for label, num, den, src in ROWS:
        print("%-58s %6.1f%%  %s  (%d of %d)" % (label, 100.0 * num / den, src, num, den))
    print()
    print("complaints per month over the audited window: %d / %d = %.3f"
          % (COMPLAINTS, AUDIT_MONTHS, COMPLAINTS / float(AUDIT_MONTHS)))
    print("months per complaint: %.1f" % (AUDIT_MONTHS / float(COMPLAINTS)))
    print()
    print("RATIO the essay leans on: auditors found %.0fx as many potential instances as DCWP did "
          "in the SAME 32-company sample." % (17 / 1.0))
    print("⚠ The 14/267 and 18/391 rows are DIFFERENT POPULATIONS, not two estimates of one "
          "quantity. Quoting either without its denominator is the error this file exists to "
          "prevent.")


if __name__ == "__main__":
    main()
