"""Run Econ-ARK's published-number validator against a package. Usage: python -I validate_published.py PKG_DIR ECONARK_CODE_DIR PKG_DIR's ``econ_scenarios`` is imported ahead of Econ-ARK's, so the validator checks that package. """ import sys sys.path.insert(0, sys.argv[2]) sys.path.insert(0, sys.argv[1]) import econ_scenarios # noqa: E402 from validation.published import cached_runner, checks # noqa: E402 print("package:", econ_scenarios.__file__) all_checks = checks(cached_runner()) missed = [c for c in all_checks if not c.ok] print(f"published numbers checked: {len(all_checks)}; missed: {len(missed)}") for c in missed: print(f" MISS {c.source}: {c.label}: published {c.published}, model {c.model:.4f}")