pysuto 0.1.0rc1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (362) hide show
  1. pysuto-0.1.0rc1/.git_archival.txt +4 -0
  2. pysuto-0.1.0rc1/.gitattributes +1 -0
  3. pysuto-0.1.0rc1/.githooks/commit-msg +20 -0
  4. pysuto-0.1.0rc1/.githooks/pre-commit +20 -0
  5. pysuto-0.1.0rc1/.gitignore +49 -0
  6. pysuto-0.1.0rc1/CITATION.cff +23 -0
  7. pysuto-0.1.0rc1/GLOSSARY.md +1435 -0
  8. pysuto-0.1.0rc1/LICENSE +21 -0
  9. pysuto-0.1.0rc1/LICENSE-DATA +21 -0
  10. pysuto-0.1.0rc1/PKG-INFO +74 -0
  11. pysuto-0.1.0rc1/README.md +1492 -0
  12. pysuto-0.1.0rc1/README_PYPI.md +26 -0
  13. pysuto-0.1.0rc1/config/config.yaml +2 -0
  14. pysuto-0.1.0rc1/docs/adr/0001-replace-coherence-sum-eq-with-bilateral-anchoring.md +19 -0
  15. pysuto-0.1.0rc1/docs/adr/0002-single-endpoint-rows-fan-out-not-replicate.md +112 -0
  16. pysuto-0.1.0rc1/docs/adr/0003-row-geographic-pedigree-penalty.md +20 -0
  17. pysuto-0.1.0rc1/docs/adr/0004-process-recipe-traversal-imputer.md +113 -0
  18. pysuto-0.1.0rc1/docs/adr/0005-pool-scrap-into-eff-constraint-and-stripping-ratio.md +88 -0
  19. pysuto-0.1.0rc1/docs/adr/0006-scale-total-supersedes-external-control-total.md +61 -0
  20. pysuto-0.1.0rc1/docs/adr/0007-downstream-psut-piot-follows-piolab-suh-no-external-io-lib.md +42 -0
  21. pysuto-0.1.0rc1/docs/adr/0008-unweighted-fans-are-not-distributed.md +65 -0
  22. pysuto-0.1.0rc1/docs/adr/0009-warm-start-prior-chain.md +54 -0
  23. pysuto-0.1.0rc1/docs/adr/0010-trade-first-seeding-of-bilateral-flow-process-inputs.md +177 -0
  24. pysuto-0.1.0rc1/docs/adr/0011-one-edge-relation-shared-across-imputation-and-constraints.md +94 -0
  25. pysuto-0.1.0rc1/docs/adr/0012-scrap-one-mixed-grade-commodity.md +64 -0
  26. pysuto-0.1.0rc1/docs/adr/0013-no-data-flat-prior-anchor.md +115 -0
  27. pysuto-0.1.0rc1/docs/adr/0014-bilateral-feeds-scoped-to-cross-region-edges.md +121 -0
  28. pysuto-0.1.0rc1/docs/adr/0015-in-situ-ore-grades-on-allocated-ore-basis.md +103 -0
  29. pysuto-0.1.0rc1/docs/adr/0016-provenance-aware-sigma-on-scale-totals.md +54 -0
  30. pysuto-0.1.0rc1/docs/adr/0017-size-damped-sigma-on-bilateral-trade-legs.md +88 -0
  31. pysuto-0.1.0rc1/docs/adr/0018-import-free-fans-distribute-domestically.md +111 -0
  32. pysuto-0.1.0rc1/docs/adr/0019-contradicted-flow-nodes-lose-anchor-authority.md +133 -0
  33. pysuto-0.1.0rc1/docs/adr/0020-withhold-restored-totals-that-contradict-their-own-chain.md +76 -0
  34. pysuto-0.1.0rc1/docs/adr/0021-icsg-refined-production-anchors-anode-into-er.md +195 -0
  35. pysuto-0.1.0rc1/docs/adr/0022-er-pools-its-anode-input-over-all-source-regions.md +101 -0
  36. pysuto-0.1.0rc1/docs/adr/0023-ore-grade-carried-past-the-crude-ore-feed.md +140 -0
  37. pysuto-0.1.0rc1/docs/adr/0024-fan-domestic-leg-bounded-by-own-production.md +277 -0
  38. pysuto-0.1.0rc1/docs/adr/0025-scale-totals-carry-the-feeds-reporting-resolution-as-a-sigma-floor.md +136 -0
  39. pysuto-0.1.0rc1/docs/adr/0026-bilateral-trade-legs-are-not-time-interpolated.md +111 -0
  40. pysuto-0.1.0rc1/docs/adr/0027-re-exports-are-re-attributed-at-feed-time.md +297 -0
  41. pysuto-0.1.0rc1/docs/adr/0028-grade-sigma-is-stated-not-derived-from-the-band.md +128 -0
  42. pysuto-0.1.0rc1/docs/adr/0029-the-concentrate-grade-stays-global.md +146 -0
  43. pysuto-0.1.0rc1/docs/adr/0030-secondary-smelter-copper-enters-the-chain-once.md +244 -0
  44. pysuto-0.1.0rc1/docs/adr/0031-icsg-scrap-series-anchor-their-level-not-only-their-share.md +198 -0
  45. pysuto-0.1.0rc1/docs/adr/0032-one-territory-one-label.md +236 -0
  46. pysuto-0.1.0rc1/docs/adr/0033-baci-quantity-contradicts-its-own-value.md +293 -0
  47. pysuto-0.1.0rc1/docs/adr/0034-roles-are-the-frameworks-labels-are-the-cases.md +31 -0
  48. pysuto-0.1.0rc1/docs/adr/0035-the-yearbooks-label-is-not-on-the-row-it-owns.md +140 -0
  49. pysuto-0.1.0rc1/docs/adr/0036-a-renamed-type-is-a-second-stream-not-a-restatement.md +120 -0
  50. pysuto-0.1.0rc1/docs/adr/0037-psut-piot-two-classes-piot-is-a-construct-family.md +62 -0
  51. pysuto-0.1.0rc1/docs/adr/0038-waste-rock-is-a-satellite-mass-flow.md +38 -0
  52. pysuto-0.1.0rc1/docs/adr/0039-flow-lower-bounds-are-enforced-in-the-qp.md +65 -0
  53. pysuto-0.1.0rc1/docs/adr/0040-stock-change-legs-are-held-at-their-prior.md +72 -0
  54. pysuto-0.1.0rc1/docs/adr/0041-signed-edges-carry-no-one-signed-hard-band-and-are-seeded.md +68 -0
  55. pysuto-0.1.0rc1/docs/adr/0042-stage-4-owns-the-model-a-qp-backend-solves-a-standard-form-qp.md +28 -0
  56. pysuto-0.1.0rc1/docs/adr/0043-a-stock-change-is-drawn-from-its-regions-cathode-supply.md +39 -0
  57. pysuto-0.1.0rc1/docs/adr/0044-the-posterior-is-the-qps-linearisation-at-its-active-set.md +17 -0
  58. pysuto-0.1.0rc1/docs/adr/0045-knobs-are-overridden-at-the-driver-boundary.md +87 -0
  59. pysuto-0.1.0rc1/docs/adr/0046-an-accounting-structure-is-declared-by-a-spec.md +42 -0
  60. pysuto-0.1.0rc1/docs/adr/0047-pysuto-ships-no-study-case.md +24 -0
  61. pysuto-0.1.0rc1/docs/agents/domain.md +47 -0
  62. pysuto-0.1.0rc1/docs/agents/issue-tracker.md +59 -0
  63. pysuto-0.1.0rc1/docs/agents/measure-tickets.md +54 -0
  64. pysuto-0.1.0rc1/docs/agents/parallel-worktrees.md +50 -0
  65. pysuto-0.1.0rc1/docs/agents/triage-labels.md +17 -0
  66. pysuto-0.1.0rc1/docs/conf/ISIE2027_abstract.docx +0 -0
  67. pysuto-0.1.0rc1/docs/conf/ISIE2027_abstract_reviews.md +176 -0
  68. pysuto-0.1.0rc1/docs/conf/ISIESEM_abstract_finis.docx +0 -0
  69. pysuto-0.1.0rc1/docs/manuscript/discussion.md +253 -0
  70. pysuto-0.1.0rc1/docs/manuscript/figs/fig3_problem.png +0 -0
  71. pysuto-0.1.0rc1/docs/manuscript/figs/fig4_reconciliation.png +0 -0
  72. pysuto-0.1.0rc1/docs/manuscript/figs/fig5_uncertainty.png +0 -0
  73. pysuto-0.1.0rc1/docs/manuscript/figs/fig6_copper_system.png +0 -0
  74. pysuto-0.1.0rc1/docs/manuscript/figs/manuscript_numbers.json +3709 -0
  75. pysuto-0.1.0rc1/docs/manuscript/figs/numbers.json +1156 -0
  76. pysuto-0.1.0rc1/docs/manuscript/figs/si_s15_a4_gradient.csv +31 -0
  77. pysuto-0.1.0rc1/docs/manuscript/figs/si_s15_decomposition.csv +31 -0
  78. pysuto-0.1.0rc1/docs/manuscript/figs/si_s15_embodied_folded.csv +8 -0
  79. pysuto-0.1.0rc1/docs/manuscript/figs/si_s15_hhi_1995_2024.csv +17 -0
  80. pysuto-0.1.0rc1/docs/manuscript/figs/si_s15_knob_criteria.png +0 -0
  81. pysuto-0.1.0rc1/docs/manuscript/figs/si_s15_ledger.csv +9 -0
  82. pysuto-0.1.0rc1/docs/manuscript/figs/si_s15_retention_by_stage.csv +10 -0
  83. pysuto-0.1.0rc1/docs/manuscript/figs/si_s15_secondary_pooled.csv +9 -0
  84. pysuto-0.1.0rc1/docs/manuscript/figs/si_s15_tolerance_pair.csv +10 -0
  85. pysuto-0.1.0rc1/docs/manuscript/figs/si_s16_share_soft_ratios.csv +10 -0
  86. pysuto-0.1.0rc1/docs/manuscript/figs/si_s16_top_identities_edges.csv +26 -0
  87. pysuto-0.1.0rc1/docs/manuscript/figs/si_s16_top_identities_soft_ratios.csv +26 -0
  88. pysuto-0.1.0rc1/docs/manuscript/figs/si_s16_top_identities_sum_rows.csv +26 -0
  89. pysuto-0.1.0rc1/docs/manuscript/figs/si_s17_legs.csv +95 -0
  90. pysuto-0.1.0rc1/docs/manuscript/figs/si_s6_birge_by_year.csv +32 -0
  91. pysuto-0.1.0rc1/docs/manuscript/figs/si_s6_calibration.csv +9 -0
  92. pysuto-0.1.0rc1/docs/manuscript/figs/si_s6_contraction_by_category.csv +55 -0
  93. pysuto-0.1.0rc1/docs/manuscript/figs/si_s6_contraction_by_class.csv +5 -0
  94. pysuto-0.1.0rc1/docs/manuscript/figs/si_s6_contraction_shift.png +0 -0
  95. pysuto-0.1.0rc1/docs/manuscript/figs/si_s6_shift_calibration.png +0 -0
  96. pysuto-0.1.0rc1/docs/manuscript/figs/si_tables.md +478 -0
  97. pysuto-0.1.0rc1/docs/manuscript/figs/table3_intervals.csv +362 -0
  98. pysuto-0.1.0rc1/docs/manuscript/figs/table3_ledger.csv +9 -0
  99. pysuto-0.1.0rc1/docs/manuscript/introduction.md +117 -0
  100. pysuto-0.1.0rc1/docs/manuscript/method.md +808 -0
  101. pysuto-0.1.0rc1/docs/manuscript/refs.bib +365 -0
  102. pysuto-0.1.0rc1/docs/manuscript/results.md +199 -0
  103. pysuto-0.1.0rc1/docs/manuscript/si.md +1004 -0
  104. pysuto-0.1.0rc1/docs/pap/CONVENT.md +111 -0
  105. pysuto-0.1.0rc1/docs/pap/skel.yaml +342 -0
  106. pysuto-0.1.0rc1/environment-reference.yml +268 -0
  107. pysuto-0.1.0rc1/environment.yml +10 -0
  108. pysuto-0.1.0rc1/pyproject.toml +98 -0
  109. pysuto-0.1.0rc1/scripts/acc.py +217 -0
  110. pysuto-0.1.0rc1/scripts/baci_feed.py +77 -0
  111. pysuto-0.1.0rc1/scripts/build_baci_reexport.py +301 -0
  112. pysuto-0.1.0rc1/scripts/build_ore_grade.py +204 -0
  113. pysuto-0.1.0rc1/scripts/build_trade_shares.py +235 -0
  114. pysuto-0.1.0rc1/scripts/collect_aggregate_impute.py +128 -0
  115. pysuto-0.1.0rc1/scripts/constraints.py +111 -0
  116. pysuto-0.1.0rc1/scripts/copper.py +971 -0
  117. pysuto-0.1.0rc1/scripts/copper_feed.py +979 -0
  118. pysuto-0.1.0rc1/scripts/crude_ore_feed.py +77 -0
  119. pysuto-0.1.0rc1/scripts/icsg_feed.py +76 -0
  120. pysuto-0.1.0rc1/scripts/input_status.py +43 -0
  121. pysuto-0.1.0rc1/scripts/issue_audit.py +138 -0
  122. pysuto-0.1.0rc1/scripts/migrate_registries.py +452 -0
  123. pysuto-0.1.0rc1/scripts/parse/baci_parse/baci_parse_feed.py +447 -0
  124. pysuto-0.1.0rc1/scripts/parse/copper_params_parse.py +356 -0
  125. pysuto-0.1.0rc1/scripts/parse/crude_ore_parse_feed.py +101 -0
  126. pysuto-0.1.0rc1/scripts/parse/icsg_parse/icsg_2005.py +751 -0
  127. pysuto-0.1.0rc1/scripts/parse/icsg_parse/icsg_2014.py +704 -0
  128. pysuto-0.1.0rc1/scripts/parse/icsg_parse/icsg_2023f.py +1056 -0
  129. pysuto-0.1.0rc1/scripts/parse/icsg_parse/icsg_cap.py +214 -0
  130. pysuto-0.1.0rc1/scripts/parse/icsg_parse/icsg_clean.py +615 -0
  131. pysuto-0.1.0rc1/scripts/parse/icsg_parse/icsg_comb.py +305 -0
  132. pysuto-0.1.0rc1/scripts/parse/icsg_parse/process_icsg.py +210 -0
  133. pysuto-0.1.0rc1/scripts/parse/ore_grade_parse.py +289 -0
  134. pysuto-0.1.0rc1/scripts/psut.py +108 -0
  135. pysuto-0.1.0rc1/scripts/refresh_tutorial.py +100 -0
  136. pysuto-0.1.0rc1/scripts/report/copper_metabolism_insights.py +866 -0
  137. pysuto-0.1.0rc1/scripts/report/fonts/Inter[opsz,wght].ttf +0 -0
  138. pysuto-0.1.0rc1/scripts/report/fonts/JetBrainsMono[wght].ttf +0 -0
  139. pysuto-0.1.0rc1/scripts/report/fonts/OFL-Inter.txt +93 -0
  140. pysuto-0.1.0rc1/scripts/report/fonts/OFL-JetBrainsMono.txt +93 -0
  141. pysuto-0.1.0rc1/scripts/report/insights_artifact.py +553 -0
  142. pysuto-0.1.0rc1/scripts/report/insights_artifact_page/assemble.py +35 -0
  143. pysuto-0.1.0rc1/scripts/report/insights_artifact_page/helpers.js +103 -0
  144. pysuto-0.1.0rc1/scripts/report/insights_artifact_page/main.js +366 -0
  145. pysuto-0.1.0rc1/scripts/report/insights_artifact_page/template.html +392 -0
  146. pysuto-0.1.0rc1/scripts/report/insights_docx/build.cjs +157 -0
  147. pysuto-0.1.0rc1/scripts/report/insights_docx/shoot.cjs +90 -0
  148. pysuto-0.1.0rc1/scripts/report/insights_docx/text.md +134 -0
  149. pysuto-0.1.0rc1/scripts/report/make_logo.py +1029 -0
  150. pysuto-0.1.0rc1/scripts/report/manuscript_numbers.py +1574 -0
  151. pysuto-0.1.0rc1/scripts/report/results_figs.py +1382 -0
  152. pysuto-0.1.0rc1/scripts/report/supervisor_figs_20260907.py +274 -0
  153. pysuto-0.1.0rc1/scripts/report/table3_intervals.py +421 -0
  154. pysuto-0.1.0rc1/scripts/run_solver.py +106 -0
  155. pysuto-0.1.0rc1/scripts/solve_diag.py +85 -0
  156. pysuto-0.1.0rc1/scripts/solver_stats.py +81 -0
  157. pysuto-0.1.0rc1/scripts/sweep.py +147 -0
  158. pysuto-0.1.0rc1/scripts/sweep_diag.py +87 -0
  159. pysuto-0.1.0rc1/scripts/uncertainty_propagation.py +85 -0
  160. pysuto-0.1.0rc1/scripts/uncprop_diag.py +92 -0
  161. pysuto-0.1.0rc1/src/pysuto/__init__.py +13 -0
  162. pysuto-0.1.0rc1/src/pysuto/__main__.py +110 -0
  163. pysuto-0.1.0rc1/src/pysuto/_conditioning.py +151 -0
  164. pysuto-0.1.0rc1/src/pysuto/_step.py +90 -0
  165. pysuto-0.1.0rc1/src/pysuto/acc.py +1989 -0
  166. pysuto-0.1.0rc1/src/pysuto/agg.py +172 -0
  167. pysuto-0.1.0rc1/src/pysuto/case.py +451 -0
  168. pysuto-0.1.0rc1/src/pysuto/clarabel_backend.py +249 -0
  169. pysuto-0.1.0rc1/src/pysuto/collector.py +216 -0
  170. pysuto-0.1.0rc1/src/pysuto/conc.py +826 -0
  171. pysuto-0.1.0rc1/src/pysuto/config.py +52 -0
  172. pysuto-0.1.0rc1/src/pysuto/constraints/__init__.py +42 -0
  173. pysuto-0.1.0rc1/src/pysuto/constraints/anchors.py +206 -0
  174. pysuto-0.1.0rc1/src/pysuto/constraints/base.py +91 -0
  175. pysuto-0.1.0rc1/src/pysuto/constraints/emit.py +112 -0
  176. pysuto-0.1.0rc1/src/pysuto/constraints/engine.py +835 -0
  177. pysuto-0.1.0rc1/src/pysuto/constraints/flow_bound.py +83 -0
  178. pysuto-0.1.0rc1/src/pysuto/constraints/mass_balance.py +82 -0
  179. pysuto-0.1.0rc1/src/pysuto/constraints/naming.py +141 -0
  180. pysuto-0.1.0rc1/src/pysuto/constraints/ratio.py +545 -0
  181. pysuto-0.1.0rc1/src/pysuto/constraints/run.py +83 -0
  182. pysuto-0.1.0rc1/src/pysuto/constraints/sum.py +679 -0
  183. pysuto-0.1.0rc1/src/pysuto/diag/__init__.py +93 -0
  184. pysuto-0.1.0rc1/src/pysuto/diag/_plot.py +207 -0
  185. pysuto-0.1.0rc1/src/pysuto/diag/agg.py +368 -0
  186. pysuto-0.1.0rc1/src/pysuto/diag/const.py +612 -0
  187. pysuto-0.1.0rc1/src/pysuto/diag/feed.py +258 -0
  188. pysuto-0.1.0rc1/src/pysuto/diag/imp.py +1011 -0
  189. pysuto-0.1.0rc1/src/pysuto/diag/psut.py +300 -0
  190. pysuto-0.1.0rc1/src/pysuto/diag/solver.py +1435 -0
  191. pysuto-0.1.0rc1/src/pysuto/diag/stats/__init__.py +56 -0
  192. pysuto-0.1.0rc1/src/pysuto/diag/stats/_core.py +255 -0
  193. pysuto-0.1.0rc1/src/pysuto/diag/stats/const.py +81 -0
  194. pysuto-0.1.0rc1/src/pysuto/diag/stats/coverage.py +163 -0
  195. pysuto-0.1.0rc1/src/pysuto/diag/stats/objective.py +319 -0
  196. pysuto-0.1.0rc1/src/pysuto/diag/stats/problem.py +442 -0
  197. pysuto-0.1.0rc1/src/pysuto/diag/stats/solver.py +437 -0
  198. pysuto-0.1.0rc1/src/pysuto/diag/stats/sweep.py +799 -0
  199. pysuto-0.1.0rc1/src/pysuto/diag/stats/uncprop.py +519 -0
  200. pysuto-0.1.0rc1/src/pysuto/diag/stats/val.py +95 -0
  201. pysuto-0.1.0rc1/src/pysuto/diag/sweep.py +509 -0
  202. pysuto-0.1.0rc1/src/pysuto/diag/truth.py +333 -0
  203. pysuto-0.1.0rc1/src/pysuto/diag/uncprop.py +691 -0
  204. pysuto-0.1.0rc1/src/pysuto/feed.py +67 -0
  205. pysuto-0.1.0rc1/src/pysuto/feedpipe.py +982 -0
  206. pysuto-0.1.0rc1/src/pysuto/feedprep/__init__.py +10 -0
  207. pysuto-0.1.0rc1/src/pysuto/feedprep/ore_grade.py +333 -0
  208. pysuto-0.1.0rc1/src/pysuto/feedprep/reexport.py +544 -0
  209. pysuto-0.1.0rc1/src/pysuto/feedprep/trade_shares.py +315 -0
  210. pysuto-0.1.0rc1/src/pysuto/flow_node_balance.py +89 -0
  211. pysuto-0.1.0rc1/src/pysuto/impute/__init__.py +51 -0
  212. pysuto-0.1.0rc1/src/pysuto/impute/base.py +140 -0
  213. pysuto-0.1.0rc1/src/pysuto/impute/engine.py +292 -0
  214. pysuto-0.1.0rc1/src/pysuto/impute/fill.py +124 -0
  215. pysuto-0.1.0rc1/src/pysuto/impute/flat_prior.py +371 -0
  216. pysuto-0.1.0rc1/src/pysuto/impute/ledger.py +194 -0
  217. pysuto-0.1.0rc1/src/pysuto/impute/network.py +600 -0
  218. pysuto-0.1.0rc1/src/pysuto/impute/screens.py +195 -0
  219. pysuto-0.1.0rc1/src/pysuto/impute/share.py +302 -0
  220. pysuto-0.1.0rc1/src/pysuto/impute/time.py +340 -0
  221. pysuto-0.1.0rc1/src/pysuto/input_registry.py +484 -0
  222. pysuto-0.1.0rc1/src/pysuto/knobs.py +130 -0
  223. pysuto-0.1.0rc1/src/pysuto/logging.py +108 -0
  224. pysuto-0.1.0rc1/src/pysuto/lp.py +31 -0
  225. pysuto-0.1.0rc1/src/pysuto/masks.py +227 -0
  226. pysuto-0.1.0rc1/src/pysuto/meta.py +174 -0
  227. pysuto-0.1.0rc1/src/pysuto/piot.py +466 -0
  228. pysuto-0.1.0rc1/src/pysuto/pipeline.py +731 -0
  229. pysuto-0.1.0rc1/src/pysuto/psut.py +675 -0
  230. pysuto-0.1.0rc1/src/pysuto/qp.py +90 -0
  231. pysuto-0.1.0rc1/src/pysuto/registry/__init__.py +66 -0
  232. pysuto-0.1.0rc1/src/pysuto/registry/_sidecar.py +146 -0
  233. pysuto-0.1.0rc1/src/pysuto/registry/base.py +132 -0
  234. pysuto-0.1.0rc1/src/pysuto/registry/constraint.py +227 -0
  235. pysuto-0.1.0rc1/src/pysuto/registry/feed.py +271 -0
  236. pysuto-0.1.0rc1/src/pysuto/registry/imputation.py +227 -0
  237. pysuto-0.1.0rc1/src/pysuto/registry/lock.py +101 -0
  238. pysuto-0.1.0rc1/src/pysuto/registry/optim.py +196 -0
  239. pysuto-0.1.0rc1/src/pysuto/registry/psut.py +185 -0
  240. pysuto-0.1.0rc1/src/pysuto/registry/sweep.py +70 -0
  241. pysuto-0.1.0rc1/src/pysuto/registry/uncprop.py +147 -0
  242. pysuto-0.1.0rc1/src/pysuto/relation/__init__.py +15 -0
  243. pysuto-0.1.0rc1/src/pysuto/relation/balance.py +65 -0
  244. pysuto-0.1.0rc1/src/pysuto/relation/param_relation.py +379 -0
  245. pysuto-0.1.0rc1/src/pysuto/relation/params.py +254 -0
  246. pysuto-0.1.0rc1/src/pysuto/relation/prior.py +85 -0
  247. pysuto-0.1.0rc1/src/pysuto/relation/ratio_relation.py +174 -0
  248. pysuto-0.1.0rc1/src/pysuto/relation/relation.py +90 -0
  249. pysuto-0.1.0rc1/src/pysuto/relation/sources.py +147 -0
  250. pysuto-0.1.0rc1/src/pysuto/relation/structure.py +153 -0
  251. pysuto-0.1.0rc1/src/pysuto/solver.py +820 -0
  252. pysuto-0.1.0rc1/src/pysuto/stages.py +683 -0
  253. pysuto-0.1.0rc1/src/pysuto/tutorial/00_world.ipynb +1335 -0
  254. pysuto-0.1.0rc1/src/pysuto/tutorial/01_datafeed.ipynb +1882 -0
  255. pysuto-0.1.0rc1/src/pysuto/tutorial/02_aggregate_impute.ipynb +1873 -0
  256. pysuto-0.1.0rc1/src/pysuto/tutorial/03_constraints.ipynb +1682 -0
  257. pysuto-0.1.0rc1/src/pysuto/tutorial/04_solver.ipynb +1068 -0
  258. pysuto-0.1.0rc1/src/pysuto/tutorial/05_posterior.ipynb +883 -0
  259. pysuto-0.1.0rc1/src/pysuto/tutorial/06_psut_piot.ipynb +3248 -0
  260. pysuto-0.1.0rc1/src/pysuto/tutorial/07_scoreboard.ipynb +1365 -0
  261. pysuto-0.1.0rc1/src/pysuto/tutorial/08_break_it.ipynb +948 -0
  262. pysuto-0.1.0rc1/src/pysuto/tutorial/09_bridge.ipynb +1149 -0
  263. pysuto-0.1.0rc1/src/pysuto/tutorial/10_your_case.ipynb +1327 -0
  264. pysuto-0.1.0rc1/src/pysuto/tutorial/README.md +15 -0
  265. pysuto-0.1.0rc1/src/pysuto/tutorial/__init__.py +72 -0
  266. pysuto-0.1.0rc1/src/pysuto/tutorial/params_template.csv +77 -0
  267. pysuto-0.1.0rc1/src/pysuto/tutorial/toy.py +1476 -0
  268. pysuto-0.1.0rc1/src/pysuto/tutorial/toy_coproduct.py +37 -0
  269. pysuto-0.1.0rc1/src/pysuto/tutorial/toy_ext.py +618 -0
  270. pysuto-0.1.0rc1/src/pysuto/unc.py +371 -0
  271. pysuto-0.1.0rc1/src/pysuto/uncprop.py +954 -0
  272. pysuto-0.1.0rc1/src/pysuto/utils.py +449 -0
  273. pysuto-0.1.0rc1/tests/copper_case.py +18 -0
  274. pysuto-0.1.0rc1/tests/test_acc_roles.py +425 -0
  275. pysuto-0.1.0rc1/tests/test_acc_spec.py +412 -0
  276. pysuto-0.1.0rc1/tests/test_accounting_structure.py +1591 -0
  277. pysuto-0.1.0rc1/tests/test_agg.py +240 -0
  278. pysuto-0.1.0rc1/tests/test_anchors.py +195 -0
  279. pysuto-0.1.0rc1/tests/test_baci_mirror_duplicates.py +183 -0
  280. pysuto-0.1.0rc1/tests/test_baci_quantity_recon.py +382 -0
  281. pysuto-0.1.0rc1/tests/test_case.py +263 -0
  282. pysuto-0.1.0rc1/tests/test_case_resolution.py +201 -0
  283. pysuto-0.1.0rc1/tests/test_case_screens.py +114 -0
  284. pysuto-0.1.0rc1/tests/test_collector.py +319 -0
  285. pysuto-0.1.0rc1/tests/test_conc.py +889 -0
  286. pysuto-0.1.0rc1/tests/test_config.py +42 -0
  287. pysuto-0.1.0rc1/tests/test_const_stats_diag.py +98 -0
  288. pysuto-0.1.0rc1/tests/test_constraints.py +2845 -0
  289. pysuto-0.1.0rc1/tests/test_copper_feed.py +415 -0
  290. pysuto-0.1.0rc1/tests/test_copper_stage1.py +128 -0
  291. pysuto-0.1.0rc1/tests/test_coverage_diag.py +212 -0
  292. pysuto-0.1.0rc1/tests/test_driver_data_dir.py +483 -0
  293. pysuto-0.1.0rc1/tests/test_driver_knobs.py +162 -0
  294. pysuto-0.1.0rc1/tests/test_feed_diag.py +36 -0
  295. pysuto-0.1.0rc1/tests/test_feed_spec.py +118 -0
  296. pysuto-0.1.0rc1/tests/test_feedpipe.py +553 -0
  297. pysuto-0.1.0rc1/tests/test_feedprep_ore_grade.py +286 -0
  298. pysuto-0.1.0rc1/tests/test_feedprep_reexport.py +695 -0
  299. pysuto-0.1.0rc1/tests/test_feedprep_trade_shares.py +705 -0
  300. pysuto-0.1.0rc1/tests/test_flatprior_row.py +165 -0
  301. pysuto-0.1.0rc1/tests/test_flow_node_balance.py +87 -0
  302. pysuto-0.1.0rc1/tests/test_generic_drivers.py +286 -0
  303. pysuto-0.1.0rc1/tests/test_githooks.py +49 -0
  304. pysuto-0.1.0rc1/tests/test_icsg_2005_merged_cells.py +70 -0
  305. pysuto-0.1.0rc1/tests/test_icsg_2014_region_fill.py +91 -0
  306. pysuto-0.1.0rc1/tests/test_icsg_clean.py +586 -0
  307. pysuto-0.1.0rc1/tests/test_icsg_comb_renamed_collisions.py +85 -0
  308. pysuto-0.1.0rc1/tests/test_icsg_comb_zero_revision.py +65 -0
  309. pysuto-0.1.0rc1/tests/test_icsg_nas.py +190 -0
  310. pysuto-0.1.0rc1/tests/test_icsg_parse_imports.py +30 -0
  311. pysuto-0.1.0rc1/tests/test_icsg_stock_levels.py +221 -0
  312. pysuto-0.1.0rc1/tests/test_imp_diag.py +624 -0
  313. pysuto-0.1.0rc1/tests/test_import_no_writes.py +139 -0
  314. pysuto-0.1.0rc1/tests/test_imputation.py +1678 -0
  315. pysuto-0.1.0rc1/tests/test_impute_share.py +207 -0
  316. pysuto-0.1.0rc1/tests/test_input_registry.py +491 -0
  317. pysuto-0.1.0rc1/tests/test_issue_audit.py +57 -0
  318. pysuto-0.1.0rc1/tests/test_iwcc_enduse.py +131 -0
  319. pysuto-0.1.0rc1/tests/test_knobs.py +87 -0
  320. pysuto-0.1.0rc1/tests/test_licence.py +46 -0
  321. pysuto-0.1.0rc1/tests/test_lp.py +30 -0
  322. pysuto-0.1.0rc1/tests/test_manuscript_numbers.py +147 -0
  323. pysuto-0.1.0rc1/tests/test_masks.py +228 -0
  324. pysuto-0.1.0rc1/tests/test_meta.py +24 -0
  325. pysuto-0.1.0rc1/tests/test_naming.py +61 -0
  326. pysuto-0.1.0rc1/tests/test_network_imputer.py +1204 -0
  327. pysuto-0.1.0rc1/tests/test_objective_stats.py +331 -0
  328. pysuto-0.1.0rc1/tests/test_outlier_screen.py +412 -0
  329. pysuto-0.1.0rc1/tests/test_own_case.py +131 -0
  330. pysuto-0.1.0rc1/tests/test_packaging.py +22 -0
  331. pysuto-0.1.0rc1/tests/test_param_fill.py +364 -0
  332. pysuto-0.1.0rc1/tests/test_param_relation.py +361 -0
  333. pysuto-0.1.0rc1/tests/test_piot.py +302 -0
  334. pysuto-0.1.0rc1/tests/test_pipeline.py +671 -0
  335. pysuto-0.1.0rc1/tests/test_problem_stats_diag.py +339 -0
  336. pysuto-0.1.0rc1/tests/test_psut.py +848 -0
  337. pysuto-0.1.0rc1/tests/test_pysuto_run.py +244 -0
  338. pysuto-0.1.0rc1/tests/test_readme_links.py +33 -0
  339. pysuto-0.1.0rc1/tests/test_registry.py +974 -0
  340. pysuto-0.1.0rc1/tests/test_relation_emit.py +111 -0
  341. pysuto-0.1.0rc1/tests/test_relation_params.py +189 -0
  342. pysuto-0.1.0rc1/tests/test_relation_prior.py +205 -0
  343. pysuto-0.1.0rc1/tests/test_relation_structure.py +112 -0
  344. pysuto-0.1.0rc1/tests/test_row_penalty.py +130 -0
  345. pysuto-0.1.0rc1/tests/test_run_lineage.py +154 -0
  346. pysuto-0.1.0rc1/tests/test_solver.py +1574 -0
  347. pysuto-0.1.0rc1/tests/test_solver_diag.py +468 -0
  348. pysuto-0.1.0rc1/tests/test_solver_stats_diag.py +336 -0
  349. pysuto-0.1.0rc1/tests/test_stage_lock.py +99 -0
  350. pysuto-0.1.0rc1/tests/test_stats_diag.py +202 -0
  351. pysuto-0.1.0rc1/tests/test_sweep_diag.py +547 -0
  352. pysuto-0.1.0rc1/tests/test_table3_intervals.py +104 -0
  353. pysuto-0.1.0rc1/tests/test_toy_case.py +531 -0
  354. pysuto-0.1.0rc1/tests/test_toy_coproduct.py +118 -0
  355. pysuto-0.1.0rc1/tests/test_toy_ext.py +217 -0
  356. pysuto-0.1.0rc1/tests/test_tutorial_copy.py +107 -0
  357. pysuto-0.1.0rc1/tests/test_tutorial_notebooks.py +190 -0
  358. pysuto-0.1.0rc1/tests/test_unc.py +1025 -0
  359. pysuto-0.1.0rc1/tests/test_uncprop.py +1168 -0
  360. pysuto-0.1.0rc1/tests/test_uncprop_calibration.py +492 -0
  361. pysuto-0.1.0rc1/tests/test_uncprop_diag.py +329 -0
  362. pysuto-0.1.0rc1/tests/test_uncprop_stats_diag.py +328 -0
@@ -0,0 +1,4 @@
1
+ node: $Format:%H$
2
+ node-date: $Format:%cI$
3
+ describe-name: $Format:%(describe:tags=true,match=*[0-9]*)$
4
+ ref-names: $Format:%D$
@@ -0,0 +1 @@
1
+ .git_archival.txt export-subst
@@ -0,0 +1,20 @@
1
+ #!/usr/bin/env bash
2
+ # commit-msg: refuse a GitHub closing keyword before an issue number. An issue closes through
3
+ # `gh issue close <n> --comment` with its REP; pushed to main, "fix #98" closes it as a side
4
+ # effect (a merge message once closed #98 before its measurement). `git merge` runs this hook too.
5
+ # Enable once per clone: git config core.hooksPath .githooks (docs/agents/issue-tracker.md)
6
+ set -euo pipefail
7
+
8
+ # The message ends at `git commit -v`'s scissors line; the diff below it is not the message.
9
+ REF='(([[:alnum:]_.-]+/[[:alnum:]_.-]+)?#[0-9]+|https?://github\.com/[^[:space:]]+/issues/[0-9]+)'
10
+ hits=$(sed -n '/^# -* >8 -*$/q;p' "$1" | grep -v '^#' \
11
+ | grep -oiE "\b(close[sd]?|fix(e[sd])?|resolve[sd]?):?[[:space:]]+$REF" \
12
+ || true)
13
+ [ -z "$hits" ] && exit 0
14
+
15
+ cat >&2 <<EOF
16
+ commit-msg: GitHub would close an issue when this commit reaches main:
17
+ $hits
18
+ Name the issue bare, e.g. "(#98)", and close it with: gh issue close <n> --comment "<REP>"
19
+ EOF
20
+ exit 1
@@ -0,0 +1,20 @@
1
+ #!/usr/bin/env bash
2
+ # pre-commit: run ruff check (when installed) and the test suite when a commit touches Python under src/, scripts/ or tests/.
3
+ # Enable once per clone: git config core.hooksPath .githooks
4
+ # Tests import this checkout's src/ (PYTHONPATH), so a worktree tests its own code.
5
+ set -euo pipefail
6
+
7
+ git diff --cached --name-only --diff-filter=ACMRD | grep -qE '^(src|scripts|tests)/.*\.py$' || exit 0
8
+
9
+ PY=${PYSUTO_PYTHON:-python}
10
+ export PYTHONPATH="src${PYTHONPATH:+:$PYTHONPATH}"
11
+ if ! "$PY" -c "import pysuto" 2>/dev/null; then
12
+ echo "pre-commit: '$PY' cannot import pysuto; activate the conda env 'pysuto' or set PYSUTO_PYTHON." >&2
13
+ exit 1
14
+ fi
15
+ if command -v ruff >/dev/null 2>&1; then
16
+ ruff check
17
+ else
18
+ echo "pre-commit: ruff not installed; CI lints"
19
+ fi
20
+ exec "$PY" -m pytest tests/ -q -x
@@ -0,0 +1,49 @@
1
+ # Python cache files
2
+ **/__pycache__/
3
+ *.pyc
4
+ *.pyo
5
+ *.pyd
6
+ *.egg-info/
7
+
8
+ # Virtual environment
9
+ .venv/
10
+ env/
11
+ venv/
12
+
13
+ # Data folders
14
+ # data/ is not tracked: bulk source values.csv, script-generated params
15
+ # (ore_grade, trade_shares) and the run tree are all reproducible or too large.
16
+ # EXCEPTION: the hand-authored inputs under data/input are force-added to git
17
+ # (~290 KB) so a fresh clone can reconstruct the configuration. The input
18
+ # registry already versions and content-hashes them per run (data/input/*/
19
+ # registry.json, vN/ retained, run metadata parents.inputs) — git adds
20
+ # off-machine durability, not versioning. Add new hand-authored inputs with
21
+ # `git add -f`; anything a script writes stays ignored.
22
+ data/
23
+ orga/
24
+ figs/ex/
25
+ figs/mn/
26
+ figs/psut/
27
+ #test/
28
+ res/
29
+ logs/
30
+ scripts/obs
31
+ #.claude/
32
+ .agents/
33
+ plans/
34
+ docs/ref/
35
+ leg/
36
+
37
+ # VSCode settings (optional)
38
+ .vscode/
39
+
40
+ # insight page: build outputs of assemble.py (the tracked copy sits beside its run's data)
41
+ scripts/report/insights_artifact_page/copper_metabolism.html
42
+ scripts/report/insights_artifact_page/inline.js
43
+ src/pysuto/tutorial/runs/
44
+ src/pysuto/tutorial/.ipynb_checkpoints/
45
+
46
+ # Hygiene (#196): local scratch and build output
47
+ .scratch/
48
+ build/
49
+ dist/
@@ -0,0 +1,23 @@
1
+ cff-version: 1.2.0
2
+ message: "If you use pySUTO, please cite it as below."
3
+ type: software
4
+ title: "pySUTO: Python-based Supply-Use Table Optimiser"
5
+ abstract: >-
6
+ pySUTO reconciles supply-use tables from conflicting sources: a sigma-weighted
7
+ quadratic programme, solved with Clarabel, returns the flows that agree with the
8
+ accounting constraints at the smallest weighted distance from the data, and the
9
+ posterior uncertainty of every flow.
10
+ authors:
11
+ - given-names: Florian
12
+ family-names: Huber
13
+ email: florian.huber1@wu.ac.at
14
+ affiliation: "Vienna University of Economics and Business (WU)"
15
+ orcid: "https://orcid.org/0009-0000-4927-3104"
16
+ license: MIT
17
+ repository-code: "https://github.com/florihu/pySUTO"
18
+ keywords:
19
+ - material flow analysis
20
+ - supply-use tables
21
+ - data reconciliation
22
+ - uncertainty
23
+ - copper