crc-framework 0.6.0__tar.gz → 1.0.0a2__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 (228) hide show
  1. crc_framework-1.0.0a2/.gitattributes +3 -0
  2. crc_framework-1.0.0a2/.github/actions/check-wheel/action.yml +45 -0
  3. crc_framework-0.6.0/.github/workflows/npm.yaml → crc_framework-1.0.0a2/.github/workflows/conformance.yaml +29 -50
  4. crc_framework-1.0.0a2/.github/workflows/npm.yaml +37 -0
  5. {crc_framework-0.6.0 → crc_framework-1.0.0a2}/.github/workflows/release.yaml +99 -33
  6. crc_framework-1.0.0a2/AGENTS.md +74 -0
  7. crc_framework-1.0.0a2/Cargo.lock +1409 -0
  8. {crc_framework-0.6.0 → crc_framework-1.0.0a2}/Cargo.toml +3 -2
  9. {crc_framework-0.6.0 → crc_framework-1.0.0a2}/PKG-INFO +40 -39
  10. {crc_framework-0.6.0 → crc_framework-1.0.0a2}/README.md +37 -33
  11. {crc_framework-0.6.0 → crc_framework-1.0.0a2}/crates/core/Cargo.toml +12 -3
  12. crc_framework-1.0.0a2/crates/core/src/canonical.rs +1358 -0
  13. crc_framework-1.0.0a2/crates/core/src/dataset.rs +1373 -0
  14. {crc_framework-0.6.0 → crc_framework-1.0.0a2}/crates/core/src/distribution/lmoments.rs +4 -1
  15. {crc_framework-0.6.0 → crc_framework-1.0.0a2}/crates/core/src/distribution.rs +884 -232
  16. {crc_framework-0.6.0 → crc_framework-1.0.0a2}/crates/core/src/impact/definition.rs +7 -56
  17. {crc_framework-0.6.0 → crc_framework-1.0.0a2}/crates/core/src/impact/expectation.rs +104 -7
  18. {crc_framework-0.6.0 → crc_framework-1.0.0a2}/crates/core/src/impact/kernel.rs +21 -11
  19. crc_framework-0.6.0/crates/core/src/canonical.rs → crc_framework-1.0.0a2/crates/core/src/impact/kernel_curve.rs +12 -11
  20. {crc_framework-0.6.0 → crc_framework-1.0.0a2}/crates/core/src/impact/mod.rs +54 -8
  21. crc_framework-1.0.0a2/crates/core/src/impact/pushforward.rs +1577 -0
  22. {crc_framework-0.6.0 → crc_framework-1.0.0a2}/crates/core/src/impact/reference.rs +2 -54
  23. {crc_framework-0.6.0 → crc_framework-1.0.0a2}/crates/core/src/impact/registry.rs +242 -461
  24. crc_framework-1.0.0a2/crates/core/src/impact/source.rs +1129 -0
  25. {crc_framework-0.6.0 → crc_framework-1.0.0a2}/crates/core/src/lib.rs +6 -8
  26. crc_framework-1.0.0a2/crates/core/src/numerical.rs +1928 -0
  27. crc_framework-1.0.0a2/crates/core/src/rank.rs +736 -0
  28. {crc_framework-0.6.0 → crc_framework-1.0.0a2}/crates/core/src/reference/climate/ag_params.rs +0 -36
  29. {crc_framework-0.6.0 → crc_framework-1.0.0a2}/crates/core/src/reference/climate/energy_params.rs +0 -77
  30. {crc_framework-0.6.0 → crc_framework-1.0.0a2}/crates/core/src/reference/climate/flood_params.rs +11 -44
  31. crc_framework-1.0.0a2/crates/core/src/reference/climate/spei_params.rs +192 -0
  32. {crc_framework-0.6.0 → crc_framework-1.0.0a2}/crates/core/src/reference/curve_fitting.rs +204 -11
  33. crc_framework-1.0.0a2/crates/core/tests/canonical_consumer.rs +65 -0
  34. {crc_framework-0.6.0 → crc_framework-1.0.0a2}/crates/core/tests/core_numerics.rs +76 -0
  35. crc_framework-1.0.0a2/crates/core/tests/dataset_contract.rs +297 -0
  36. {crc_framework-0.6.0 → crc_framework-1.0.0a2}/crates/core/tests/impact_contract_canonical.rs +7 -3
  37. {crc_framework-0.6.0 → crc_framework-1.0.0a2}/crates/core/tests/impact_operations.rs +22 -27
  38. crc_framework-1.0.0a2/crates/core/tests/impact_probability_mass.rs +160 -0
  39. {crc_framework-0.6.0 → crc_framework-1.0.0a2}/crates/core/tests/impact_registry_conformance.rs +62 -200
  40. {crc_framework-0.6.0 → crc_framework-1.0.0a2}/crates/core/tests/impact_regressions.rs +46 -50
  41. crc_framework-1.0.0a2/docs/README.md +36 -0
  42. crc_framework-1.0.0a2/docs/development.md +216 -0
  43. crc_framework-1.0.0a2/docs/impact-contracts.md +46 -0
  44. crc_framework-1.0.0a2/docs/javascript.md +80 -0
  45. crc_framework-1.0.0a2/docs/measurements.md +80 -0
  46. crc_framework-1.0.0a2/docs/migration-v1.md +542 -0
  47. crc_framework-1.0.0a2/docs/python.md +249 -0
  48. crc_framework-1.0.0a2/docs/releases.md +97 -0
  49. {crc_framework-0.6.0 → crc_framework-1.0.0a2}/js/README.md +68 -31
  50. {crc_framework-0.6.0 → crc_framework-1.0.0a2}/js/build.mjs +7 -0
  51. {crc_framework-0.6.0 → crc_framework-1.0.0a2}/js/package.json +5 -2
  52. crc_framework-1.0.0a2/js/src/bindings.js +133 -0
  53. crc_framework-1.0.0a2/js/src/index.d.ts +65 -0
  54. crc_framework-1.0.0a2/js/src/index.js +8 -0
  55. crc_framework-1.0.0a2/js/src/node.js +14 -0
  56. crc_framework-1.0.0a2/js/test/benchmark.mjs +15 -0
  57. crc_framework-1.0.0a2/js/test/browser.html +45 -0
  58. crc_framework-1.0.0a2/js/test/consumer.mjs +138 -0
  59. crc_framework-1.0.0a2/js/test/parity.test.mjs +120 -0
  60. {crc_framework-0.6.0 → crc_framework-1.0.0a2}/pyproject.toml +8 -4
  61. crc_framework-1.0.0a2/python/crc_framework/__init__.py +192 -0
  62. crc_framework-1.0.0a2/python/crc_framework/_core.pyi +216 -0
  63. crc_framework-1.0.0a2/python/crc_framework/_diagnostics.py +45 -0
  64. crc_framework-1.0.0a2/python/crc_framework/_distribution.py +988 -0
  65. crc_framework-1.0.0a2/python/crc_framework/_fitting.py +1178 -0
  66. crc_framework-1.0.0a2/python/crc_framework/_geography.py +40 -0
  67. crc_framework-1.0.0a2/python/crc_framework/_impacts.py +1160 -0
  68. crc_framework-1.0.0a2/python/crc_framework/_measurement.py +1442 -0
  69. crc_framework-1.0.0a2/python/crc_framework/_risk.py +153 -0
  70. crc_framework-1.0.0a2/python/crc_framework/_version.py +14 -0
  71. crc_framework-1.0.0a2/python/crc_framework/contracts/api/public-api.json +2631 -0
  72. crc_framework-1.0.0a2/python/crc_framework/contracts/api/release.json +17 -0
  73. crc_framework-1.0.0a2/python/crc_framework/contracts/dataset/dataset-2.0.schema.json +1193 -0
  74. crc_framework-1.0.0a2/python/crc_framework/contracts/dataset/fixtures.json +7040 -0
  75. {crc_framework-0.6.0 → crc_framework-1.0.0a2}/python/crc_framework/contracts/impact/catalogs/error-codes.json +2 -2
  76. {crc_framework-0.6.0 → crc_framework-1.0.0a2}/python/crc_framework/contracts/impact/catalogs/semantics-constants.json +2 -2
  77. {crc_framework-0.6.0 → crc_framework-1.0.0a2}/python/crc_framework/contracts/impact/fixtures/definitions.json +25 -25
  78. {crc_framework-0.6.0 → crc_framework-1.0.0a2}/python/crc_framework/contracts/impact/fixtures/evaluation-records.json +22 -22
  79. {crc_framework-0.6.0 → crc_framework-1.0.0a2}/python/crc_framework/contracts/impact/fixtures/operations.json +2 -2
  80. {crc_framework-0.6.0 → crc_framework-1.0.0a2}/python/crc_framework/contracts/impact/fixtures/point-evaluations.json +88 -7
  81. {crc_framework-0.6.0 → crc_framework-1.0.0a2}/python/crc_framework/contracts/impact/fixtures/registry-references.json +27 -45
  82. {crc_framework-0.6.0 → crc_framework-1.0.0a2}/python/crc_framework/contracts/impact/manifest.json +19 -19
  83. {crc_framework-0.6.0 → crc_framework-1.0.0a2}/python/crc_framework/contracts/impact/schemas/impact-definition-1.0.schema.json +7 -53
  84. {crc_framework-0.6.0 → crc_framework-1.0.0a2}/python/crc_framework/contracts/impact/schemas/impact-evaluation-record-1.0.schema.json +18 -18
  85. {crc_framework-0.6.0 → crc_framework-1.0.0a2}/python/crc_framework/contracts/impact/schemas/registry-impact-reference-1.0.schema.json +2 -98
  86. crc_framework-1.0.0a2/python/crc_framework/contracts/numerical/fitting-1.0.schema.json +886 -0
  87. crc_framework-1.0.0a2/python/crc_framework/contracts/numerical/fixtures-1.0.json +4180 -0
  88. crc_framework-1.0.0a2/python/crc_framework/contracts/numerical/numerical-1.0.schema.json +757 -0
  89. crc_framework-1.0.0a2/python/crc_framework/contracts/scientific/fixtures-1.0.json +1094 -0
  90. crc_framework-1.0.0a2/python/crc_framework/contracts/scientific/impact-2.0.schema.json +409 -0
  91. crc_framework-1.0.0a2/python/crc_framework/contracts/scientific/impact-context-1.0.schema.json +367 -0
  92. crc_framework-1.0.0a2/python/crc_framework/contracts/scientific/impact-reference-2.0.schema.json +45 -0
  93. crc_framework-1.0.0a2/python/crc_framework/contracts/scientific/kernel-bindings-1.0.json +44 -0
  94. crc_framework-1.0.0a2/python/crc_framework/contracts/scientific/measurement-1.0.schema.json +612 -0
  95. crc_framework-1.0.0a2/python/crc_framework/contracts/scientific/models-1.0.json +3759 -0
  96. crc_framework-1.0.0a2/python/crc_framework/contracts/taxonomy/fixtures.json +200 -0
  97. crc_framework-1.0.0a2/python/crc_framework/contracts/taxonomy/taxonomy-1.0.schema.json +313 -0
  98. crc_framework-1.0.0a2/src/impact.rs +337 -0
  99. crc_framework-1.0.0a2/src/lib.rs +407 -0
  100. crc_framework-1.0.0a2/src/numerical.rs +261 -0
  101. crc_framework-1.0.0a2/src/rank.rs +55 -0
  102. crc_framework-1.0.0a2/tests/test_api_contracts.py +268 -0
  103. crc_framework-1.0.0a2/tests/test_distributions.py +951 -0
  104. crc_framework-1.0.0a2/tests/test_fitting.py +506 -0
  105. crc_framework-1.0.0a2/tests/test_fitting_serialization.py +508 -0
  106. crc_framework-1.0.0a2/tests/test_kernel_artifacts.py +148 -0
  107. crc_framework-1.0.0a2/tests/test_lmoments.py +159 -0
  108. crc_framework-1.0.0a2/tests/test_measurements.py +385 -0
  109. crc_framework-1.0.0a2/tests/test_numerical_impacts.py +838 -0
  110. crc_framework-1.0.0a2/tests/test_precipitation_amount.py +93 -0
  111. crc_framework-1.0.0a2/tests/test_rank_risk.py +351 -0
  112. crc_framework-1.0.0a2/tests/test_shared_contracts.py +218 -0
  113. crc_framework-1.0.0a2/tests/typing_smoke.py +42 -0
  114. crc_framework-1.0.0a2/tools/api_contracts/check.py +871 -0
  115. {crc_framework-0.6.0 → crc_framework-1.0.0a2}/tools/benchmark_lmoments.py +7 -7
  116. crc_framework-1.0.0a2/tools/check_examples.py +41 -0
  117. {crc_framework-0.6.0 → crc_framework-1.0.0a2}/tools/impact_contracts/cases.py +29 -38
  118. {crc_framework-0.6.0 → crc_framework-1.0.0a2}/tools/impact_contracts/generate.py +2 -2
  119. {crc_framework-0.6.0 → crc_framework-1.0.0a2}/tools/impact_contracts/reference.py +17 -29
  120. {crc_framework-0.6.0 → crc_framework-1.0.0a2}/tools/impact_contracts/schemas.py +12 -19
  121. crc_framework-1.0.0a2/tools/numerical_contracts/fixtures.py +572 -0
  122. crc_framework-1.0.0a2/tools/numerical_contracts/generate.py +355 -0
  123. crc_framework-1.0.0a2/tools/scientific_contracts/generate.py +649 -0
  124. crc_framework-1.0.0a2/tools/sync_data_contracts.py +36 -0
  125. crc_framework-1.0.0a2/uv.lock +782 -0
  126. crc_framework-0.6.0/.gitattributes +0 -3
  127. crc_framework-0.6.0/AGENTS.md +0 -42
  128. crc_framework-0.6.0/Cargo.lock +0 -656
  129. crc_framework-0.6.0/build.rs +0 -6
  130. crc_framework-0.6.0/crates/core/src/impact/pushforward.rs +0 -796
  131. crc_framework-0.6.0/crates/core/src/impact/record.rs +0 -654
  132. crc_framework-0.6.0/crates/core/src/impact/source.rs +0 -727
  133. crc_framework-0.6.0/crates/core/src/reference/climate/spei_params.rs +0 -199
  134. crc_framework-0.6.0/crates/core/src/transform.rs +0 -690
  135. crc_framework-0.6.0/crates/core/tests/canonical_consumer.rs +0 -85
  136. crc_framework-0.6.0/docs/README.md +0 -29
  137. crc_framework-0.6.0/docs/development.md +0 -117
  138. crc_framework-0.6.0/docs/impact-contracts.md +0 -55
  139. crc_framework-0.6.0/docs/javascript.md +0 -86
  140. crc_framework-0.6.0/docs/python.md +0 -308
  141. crc_framework-0.6.0/docs/releases.md +0 -51
  142. crc_framework-0.6.0/js/src/index.d.ts +0 -75
  143. crc_framework-0.6.0/js/src/index.js +0 -213
  144. crc_framework-0.6.0/js/test/benchmark.mjs +0 -64
  145. crc_framework-0.6.0/js/test/browser.html +0 -47
  146. crc_framework-0.6.0/js/test/consumer.mjs +0 -64
  147. crc_framework-0.6.0/js/test/parity.test.mjs +0 -185
  148. crc_framework-0.6.0/python/crc_framework/__init__.py +0 -119
  149. crc_framework-0.6.0/python/crc_framework/_core.pyi +0 -339
  150. crc_framework-0.6.0/python/crc_framework/constants.py +0 -134
  151. crc_framework-0.6.0/python/crc_framework/contracts/__init__.py +0 -93
  152. crc_framework-0.6.0/python/crc_framework/distributions/__init__.py +0 -50
  153. crc_framework-0.6.0/python/crc_framework/distributions/base.py +0 -29
  154. crc_framework-0.6.0/python/crc_framework/distributions/empirical.py +0 -56
  155. crc_framework-0.6.0/python/crc_framework/distributions/fitted.py +0 -91
  156. crc_framework-0.6.0/python/crc_framework/distributions/fitting.py +0 -435
  157. crc_framework-0.6.0/python/crc_framework/distributions/hurdle.py +0 -84
  158. crc_framework-0.6.0/python/crc_framework/distributions/point_mass.py +0 -55
  159. crc_framework-0.6.0/python/crc_framework/distributions/tabulated.py +0 -109
  160. crc_framework-0.6.0/python/crc_framework/impacts/__init__.py +0 -805
  161. crc_framework-0.6.0/python/crc_framework/metrics/__init__.py +0 -33
  162. crc_framework-0.6.0/python/crc_framework/metrics/distribution.py +0 -36
  163. crc_framework-0.6.0/python/crc_framework/metrics/microscores.py +0 -141
  164. crc_framework-0.6.0/python/crc_framework/metrics/risk.py +0 -65
  165. crc_framework-0.6.0/python/crc_framework/metrics/spanning.py +0 -35
  166. crc_framework-0.6.0/python/crc_framework/models.py +0 -30
  167. crc_framework-0.6.0/python/crc_framework/spatial.py +0 -30
  168. crc_framework-0.6.0/python/crc_framework/transforms/__init__.py +0 -38
  169. crc_framework-0.6.0/python/crc_framework/transforms/base.py +0 -120
  170. crc_framework-0.6.0/python/crc_framework/transforms/builtin.py +0 -148
  171. crc_framework-0.6.0/python/crc_framework/transforms/climate.py +0 -93
  172. crc_framework-0.6.0/src/impact.rs +0 -699
  173. crc_framework-0.6.0/src/lib.rs +0 -1086
  174. crc_framework-0.6.0/tests/fixtures/canonical-quantiles.json +0 -645
  175. crc_framework-0.6.0/tests/test_consumer_parity.py +0 -19
  176. crc_framework-0.6.0/tests/test_core_numerics.py +0 -189
  177. crc_framework-0.6.0/tests/test_impact_contracts.py +0 -424
  178. crc_framework-0.6.0/tests/test_impact_expression.py +0 -575
  179. crc_framework-0.6.0/tests/test_impacts.py +0 -99
  180. crc_framework-0.6.0/tests/test_lmoments.py +0 -138
  181. crc_framework-0.6.0/tests/test_sdk.py +0 -199
  182. crc_framework-0.6.0/tests/typing_smoke.py +0 -46
  183. crc_framework-0.6.0/tools/generate_consumer_fixtures.py +0 -75
  184. crc_framework-0.6.0/uv.lock +0 -610
  185. {crc_framework-0.6.0 → crc_framework-1.0.0a2}/.all-contributorsrc +0 -0
  186. {crc_framework-0.6.0 → crc_framework-1.0.0a2}/.gitignore +0 -0
  187. {crc_framework-0.6.0 → crc_framework-1.0.0a2}/.python-version +0 -0
  188. {crc_framework-0.6.0 → crc_framework-1.0.0a2}/CLAUDE.md +0 -0
  189. {crc_framework-0.6.0 → crc_framework-1.0.0a2}/LICENSE +0 -0
  190. {crc_framework-0.6.0 → crc_framework-1.0.0a2}/THIRD_PARTY_NOTICES.md +0 -0
  191. {crc_framework-0.6.0 → crc_framework-1.0.0a2}/crates/core/src/constants.rs +0 -0
  192. {crc_framework-0.6.0 → crc_framework-1.0.0a2}/crates/core/src/error.rs +0 -0
  193. {crc_framework-0.6.0 → crc_framework-1.0.0a2}/crates/core/src/impact/error.rs +0 -0
  194. {crc_framework-0.6.0 → crc_framework-1.0.0a2}/crates/core/src/impact/json.rs +0 -0
  195. {crc_framework-0.6.0 → crc_framework-1.0.0a2}/crates/core/src/impact/quadrature.rs +0 -0
  196. {crc_framework-0.6.0 → crc_framework-1.0.0a2}/crates/core/src/metrics.rs +0 -0
  197. {crc_framework-0.6.0 → crc_framework-1.0.0a2}/crates/core/src/reference/climate/mod.rs +0 -0
  198. {crc_framework-0.6.0 → crc_framework-1.0.0a2}/crates/core/src/reference/climate/precipitation_thresholds.rs +0 -0
  199. {crc_framework-0.6.0 → crc_framework-1.0.0a2}/crates/core/src/reference/climate/wind_params.rs +0 -0
  200. {crc_framework-0.6.0 → crc_framework-1.0.0a2}/crates/core/src/reference/mod.rs +0 -0
  201. {crc_framework-0.6.0 → crc_framework-1.0.0a2}/crates/core/src/reference/spatial/continent_r4.rs +0 -0
  202. {crc_framework-0.6.0 → crc_framework-1.0.0a2}/crates/core/src/reference/spatial/geography_r5.rs +0 -0
  203. {crc_framework-0.6.0 → crc_framework-1.0.0a2}/crates/core/src/reference/spatial/ipcc.rs +0 -0
  204. {crc_framework-0.6.0 → crc_framework-1.0.0a2}/crates/core/src/reference/spatial/mod.rs +0 -0
  205. {crc_framework-0.6.0 → crc_framework-1.0.0a2}/crates/core/src/risk.rs +0 -0
  206. {crc_framework-0.6.0 → crc_framework-1.0.0a2}/crates/core/src/spatial.rs +0 -0
  207. {crc_framework-0.6.0 → crc_framework-1.0.0a2}/crates/core/tests/censored_quantile_fit.rs +0 -0
  208. {crc_framework-0.6.0 → crc_framework-1.0.0a2}/crates/core/tests/impact_definition_conformance.rs +0 -0
  209. {crc_framework-0.6.0 → crc_framework-1.0.0a2}/crates/core/tests/quantile_fit_golden.rs +0 -0
  210. {crc_framework-0.6.0 → crc_framework-1.0.0a2}/crates/core/tests/quantile_fit_golden.txt +0 -0
  211. {crc_framework-0.6.0 → crc_framework-1.0.0a2}/js/.nvmrc +0 -0
  212. {crc_framework-0.6.0 → crc_framework-1.0.0a2}/js/package-lock.json +0 -0
  213. {crc_framework-0.6.0 → crc_framework-1.0.0a2}/js/publish.mjs +0 -0
  214. {crc_framework-0.6.0 → crc_framework-1.0.0a2}/js/test/browser.mjs +0 -0
  215. {crc_framework-0.6.0 → crc_framework-1.0.0a2}/js/test/publish.test.mjs +0 -0
  216. {crc_framework-0.6.0 → crc_framework-1.0.0a2}/python/crc_framework/contracts/impact/catalogs/hazard-exposures.json +0 -0
  217. {crc_framework-0.6.0 → crc_framework-1.0.0a2}/python/crc_framework/contracts/impact/catalogs/native-capabilities.json +0 -0
  218. {crc_framework-0.6.0 → crc_framework-1.0.0a2}/python/crc_framework/contracts/impact/catalogs/registry-overrides.json +0 -0
  219. {crc_framework-0.6.0 → crc_framework-1.0.0a2}/python/crc_framework/contracts/impact/catalogs/unit-aliases.json +0 -0
  220. {crc_framework-0.6.0 → crc_framework-1.0.0a2}/python/crc_framework/contracts/impact/fixtures/canonical-json.json +0 -0
  221. {crc_framework-0.6.0 → crc_framework-1.0.0a2}/python/crc_framework/contracts/impact/fixtures/monotonicity.json +0 -0
  222. {crc_framework-0.6.0 → crc_framework-1.0.0a2}/python/crc_framework/contracts/impact/fixtures/spatial-policies.json +0 -0
  223. {crc_framework-0.6.0 → crc_framework-1.0.0a2}/python/crc_framework/contracts/impact/fixtures/spatial-records.json +0 -0
  224. {crc_framework-0.6.0 → crc_framework-1.0.0a2}/python/crc_framework/contracts/impact/schemas/spatial-combination-policy-1.0.schema.json +0 -0
  225. {crc_framework-0.6.0 → crc_framework-1.0.0a2}/python/crc_framework/contracts/impact/schemas/spatial-impact-evaluation-record-1.0.schema.json +0 -0
  226. {crc_framework-0.6.0 → crc_framework-1.0.0a2}/python/crc_framework/py.typed +0 -0
  227. {crc_framework-0.6.0 → crc_framework-1.0.0a2}/tools/benchmarks/lmoments-audit-m2-pro.json +0 -0
  228. {crc_framework-0.6.0 → crc_framework-1.0.0a2}/tools/requirements-lmoments-benchmark.txt +0 -0
@@ -0,0 +1,3 @@
1
+ # Generated resources are checked byte for byte, including in installed wheels.
2
+ python/crc_framework/contracts/** text eol=lf
3
+ docs/measurements.md text eol=lf
@@ -0,0 +1,45 @@
1
+ name: Verify framework wheels
2
+ description: Run the public API, tests, and user examples on the built artifacts
3
+ inputs:
4
+ python-versions:
5
+ description: Space-separated CPython versions represented in the wheel directory
6
+ required: true
7
+ wheel-directory:
8
+ description: Directory containing the candidate wheels
9
+ required: true
10
+ runs:
11
+ using: composite
12
+ steps:
13
+ - uses: astral-sh/setup-uv@v10.3.3
14
+ - name: Test each installed wheel
15
+ shell: bash
16
+ env:
17
+ PYTHON_VERSIONS: ${{ inputs.python-versions }}
18
+ WHEEL_DIRECTORY: ${{ inputs.wheel-directory }}
19
+ run: |
20
+ set -euo pipefail
21
+ shopt -s nullglob
22
+ for version in $PYTHON_VERSIONS; do
23
+ abi="${version/./}"
24
+ wheels=( "$WHEEL_DIRECTORY"/crc_framework-*-cp"${abi%t}"-cp"$abi"-*.whl )
25
+ if [[ "${#wheels[@]}" != 1 ]]; then
26
+ echo "Expected exactly one candidate wheel for CPython $version" >&2
27
+ exit 1
28
+ fi
29
+ venv="$RUNNER_TEMP/framework-$version"
30
+ uv venv --python "$version" "$venv"
31
+ wheel_python="$venv/bin/python"
32
+ if [[ "$RUNNER_OS" == Windows ]]; then
33
+ wheel_python="$venv/Scripts/python.exe"
34
+ fi
35
+ # The test tools come from the checkout's `test` dependency group;
36
+ # they are not published as an extra of the wheel.
37
+ uv pip install --python "$wheel_python" "${wheels[0]}" --group test
38
+ uv pip check --python "$wheel_python"
39
+ (
40
+ cd "$RUNNER_TEMP"
41
+ "$wheel_python" -I "$GITHUB_WORKSPACE/tools/api_contracts/check.py" --runtime
42
+ "$wheel_python" -I -m pytest -q --import-mode=importlib "$GITHUB_WORKSPACE/tests"
43
+ "$wheel_python" -I "$GITHUB_WORKSPACE/tools/check_examples.py"
44
+ )
45
+ done
@@ -1,10 +1,6 @@
1
- name: JavaScript WASM
1
+ name: Package conformance
2
2
  on:
3
- pull_request:
4
- push:
5
- branches: [main, master]
6
- tags: ['v*']
7
- workflow_dispatch:
3
+ workflow_call:
8
4
  permissions:
9
5
  contents: read
10
6
  jobs:
@@ -21,25 +17,37 @@ jobs:
21
17
  python-version: '3.12'
22
18
  - name: Format, clippy and mypy
23
19
  run: |
20
+ python tools/api_contracts/check.py
24
21
  cargo fmt --all -- --check
25
22
  cargo clippy --workspace --all-targets --locked -- -D warnings
26
- pip install numpy mypy
23
+ pip install numpy mypy jsonschema types-jsonschema
27
24
  python -m mypy
28
- impact-contracts:
25
+ - name: Check the declared minimum Rust version
26
+ run: |
27
+ rust_version=$(python -c 'import tomllib; print(tomllib.load(open("Cargo.toml", "rb"))["workspace"]["package"]["rust-version"])')
28
+ rustup toolchain install "$rust_version" --profile minimal
29
+ cargo +"$rust_version" check --workspace --all-targets --locked
30
+ python-contracts:
29
31
  runs-on: ubuntu-latest
30
32
  steps:
31
33
  - uses: actions/checkout@v7
34
+ - uses: Swatinem/rust-cache@v2
32
35
  - uses: actions/setup-python@v7
33
36
  with:
34
37
  python-version: '3.12'
35
- - name: Verify generated contract artifact
38
+ - name: Verify generated contracts and build the Python wheel
36
39
  run: |
37
- pip install maturin numpy pytest jsonschema
40
+ pip install maturin numpy pytest jsonschema rfc3339-validator
41
+ maturin build --release --locked --out "$RUNNER_TEMP/contract-wheel"
42
+ pip install "$RUNNER_TEMP"/contract-wheel/*.whl
38
43
  python tools/impact_contracts/generate.py --check
39
- maturin build --release --locked --out /tmp/impact-contract-wheel
40
- pip install /tmp/impact-contract-wheel/*.whl
41
- cd /tmp
42
- python -m pytest -q "$GITHUB_WORKSPACE/tests/test_impact_contracts.py"
44
+ python tools/numerical_contracts/generate.py --check
45
+ python tools/numerical_contracts/fixtures.py --check
46
+ python tools/scientific_contracts/generate.py --check
47
+ - uses: ./.github/actions/check-wheel
48
+ with:
49
+ python-versions: "3.12"
50
+ wheel-directory: ${{ runner.temp }}/contract-wheel
43
51
  native-contracts:
44
52
  runs-on: ubuntu-latest
45
53
  steps:
@@ -48,10 +56,11 @@ jobs:
48
56
  - uses: Swatinem/rust-cache@v2
49
57
  - name: Consume canonical artifact in the native core
50
58
  run: |
51
- cargo test -p crc-framework-core --test impact_contract_canonical --test impact_definition_conformance --test impact_registry_conformance --locked
52
- cargo test -p crc-framework-core --no-default-features --test impact_contract_canonical --test impact_definition_conformance --test impact_registry_conformance --locked
59
+ cargo test -p crc-framework-core --test canonical_consumer --test dataset_contract --test impact_contract_canonical --test impact_definition_conformance --test impact_registry_conformance --locked
60
+ cargo test -p crc-framework-core --no-default-features --test canonical_consumer --test dataset_contract --test impact_contract_canonical --test impact_definition_conformance --test impact_registry_conformance --locked
53
61
  build:
54
- needs: [impact-contracts, native-contracts]
62
+ # Independent of the other jobs; running it alongside them keeps the
63
+ # slowest job (WASM optimization and browser tests) off the critical path.
55
64
  runs-on: ubuntu-latest
56
65
  steps:
57
66
  - uses: actions/checkout@v7
@@ -67,18 +76,8 @@ jobs:
67
76
  - uses: actions/setup-python@v7
68
77
  with:
69
78
  python-version: '3.12'
70
- - name: Test native core and Python parity
71
- run: |
72
- cargo test -p crc-framework-core --locked
73
- cargo test -p crc-framework-core --no-default-features --lib --test canonical_consumer --locked
74
- pip install maturin pytest numpy jsonschema
75
- python tools/impact_contracts/generate.py --check
76
- maturin build --release --locked --out /tmp/crc-wheels
77
- pip install /tmp/crc-wheels/*.whl
78
- cd /tmp
79
- python -c "from crc_framework.contracts import verify_impact_contracts; verify_impact_contracts()"
80
- cd "$GITHUB_WORKSPACE"
81
- python -m pytest -q
79
+ - name: Test the native workspace
80
+ run: cargo test --workspace --locked
82
81
  - name: Install WASM build tooling
83
82
  run: cargo install wasm-pack --version 0.15.0 --locked
84
83
  - name: Build and test package
@@ -93,27 +92,7 @@ jobs:
93
92
  npm run test:consumer
94
93
  - name: Verify build leaves version sources unchanged
95
94
  run: git diff --exit-code -- Cargo.toml Cargo.lock crates/core/Cargo.toml crates/wasm/Cargo.toml js/package.json js/package-lock.json
96
- - uses: actions/upload-artifact@v4
95
+ - uses: actions/upload-artifact@v7
97
96
  with:
98
97
  name: npm-package
99
98
  path: js/dist/*.tgz
100
- publish:
101
- if: startsWith(github.ref, 'refs/tags/v')
102
- needs: build
103
- runs-on: ubuntu-latest
104
- environment: production
105
- permissions:
106
- contents: read
107
- id-token: write
108
- steps:
109
- - uses: actions/checkout@v7
110
- - uses: actions/setup-node@v7
111
- with:
112
- node-version-file: js/.nvmrc
113
- registry-url: https://registry.npmjs.org
114
- - uses: actions/download-artifact@v8
115
- with:
116
- name: npm-package
117
- path: artifact
118
- - name: Publish tested tarball using npm OIDC
119
- run: node js/publish.mjs artifact
@@ -0,0 +1,37 @@
1
+ name: JavaScript WASM
2
+ on:
3
+ pull_request:
4
+ push:
5
+ branches: [main, master]
6
+ tags: ['v*']
7
+ workflow_dispatch:
8
+ permissions:
9
+ contents: read
10
+ concurrency:
11
+ # A new push to a pull request supersedes its running checks. Branch and tag
12
+ # runs get a group of their own, so they are never queued or cancelled.
13
+ group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.ref || github.run_id }}
14
+ cancel-in-progress: true
15
+ jobs:
16
+ conformance:
17
+ uses: ./.github/workflows/conformance.yaml
18
+ publish:
19
+ if: startsWith(github.ref, 'refs/tags/v')
20
+ needs: conformance
21
+ runs-on: ubuntu-latest
22
+ environment: production
23
+ permissions:
24
+ contents: read
25
+ id-token: write
26
+ steps:
27
+ - uses: actions/checkout@v7
28
+ - uses: actions/setup-node@v7
29
+ with:
30
+ node-version-file: js/.nvmrc
31
+ registry-url: https://registry.npmjs.org
32
+ - uses: actions/download-artifact@v8
33
+ with:
34
+ name: npm-package
35
+ path: artifact
36
+ - name: Publish tested tarball using npm OIDC
37
+ run: node js/publish.mjs artifact
@@ -5,11 +5,31 @@ on:
5
5
  - "v*"
6
6
  workflow_dispatch:
7
7
  permissions:
8
- contents: write
9
- id-token: write
8
+ contents: read
10
9
  jobs:
11
10
 
11
+ release-contract:
12
+ name: Release declarations and Git tag
13
+ runs-on: ubuntu-latest
14
+ permissions:
15
+ contents: read
16
+ steps:
17
+ - uses: actions/checkout@v7
18
+ - uses: astral-sh/setup-uv@v10.3.3
19
+ - name: Validate release tag and declared contract
20
+ env:
21
+ RELEASE_REF_TYPE: ${{ github.ref_type }}
22
+ RELEASE_REF_NAME: ${{ github.ref_name }}
23
+ run: |
24
+ uv run --no-project --python 3.12 python tools/api_contracts/check.py
25
+ uv run --no-project --python 3.12 python -c 'import os, tomllib; version=tomllib.load(open("Cargo.toml", "rb"))["workspace"]["package"]["version"]; assert os.environ["RELEASE_REF_TYPE"] == "tag" and os.environ["RELEASE_REF_NAME"] == "v" + version, "Release must run from the matching version tag"'
26
+
27
+ conformance:
28
+ needs: release-contract
29
+ uses: ./.github/workflows/conformance.yaml
30
+
12
31
  linux:
32
+ needs: release-contract
13
33
  runs-on: ubuntu-22.04
14
34
  env:
15
35
  CARGO_NET_GIT_FETCH_WITH_CLI: "true"
@@ -17,8 +37,8 @@ jobs:
17
37
  matrix:
18
38
  target: [x86_64]
19
39
  steps:
20
- - uses: actions/checkout@v4
21
- - uses: actions/cache@v4
40
+ - uses: actions/checkout@v7
41
+ - uses: actions/cache@v6
22
42
  with:
23
43
  path: |
24
44
  ~/.cargo/bin/
@@ -34,27 +54,45 @@ jobs:
34
54
  with:
35
55
  target: ${{ matrix.target }}
36
56
  args: >-
37
- --release
38
- --out dist
57
+ --release
58
+ --locked
59
+ --out dist
39
60
  --compatibility manylinux_2_28
40
61
  --interpreter python3.11 python3.12 python3.13 python3.14 python3.14t
41
62
  sccache: "true"
42
63
  manylinux: auto
43
64
  container: "2_28"
65
+ - uses: ./.github/actions/check-wheel
66
+ with:
67
+ python-versions: 3.11 3.12 3.13 3.14 3.14t
68
+ wheel-directory: dist
44
69
  - name: Upload wheels
45
- uses: actions/upload-artifact@v4
70
+ uses: actions/upload-artifact@v7
46
71
  with:
47
72
  name: wheels-linux-${{ matrix.target }}
48
73
  path: dist
49
74
 
50
75
  macos:
51
- runs-on: macos-latest
76
+ needs: release-contract
77
+ runs-on: ${{ matrix.os }}
52
78
  strategy:
79
+ fail-fast: false
53
80
  matrix:
54
- target: [x86_64, aarch64]
81
+ # The free-threaded build gets its own job: once setup-python installs
82
+ # 3.14t next to 3.14, `python3.14` resolves to the free-threaded
83
+ # interpreter and no regular 3.14 wheel is built (see the Windows job).
84
+ os: [macos-15-intel, macos-15]
85
+ build: [regular, free-threaded]
86
+ include:
87
+ - {os: macos-15-intel, target: x86_64}
88
+ - {os: macos-15, target: aarch64}
89
+ - build: regular
90
+ python: "3.11 3.12 3.13 3.14"
91
+ - build: free-threaded
92
+ python: "3.14t"
55
93
  steps:
56
- - uses: actions/checkout@v4
57
- - uses: actions/cache@v4
94
+ - uses: actions/checkout@v7
95
+ - uses: actions/cache@v6
58
96
  with:
59
97
  path: |
60
98
  ~/.cargo/bin/
@@ -62,15 +100,21 @@ jobs:
62
100
  ~/.cargo/registry/cache/
63
101
  ~/.cargo/git/db/
64
102
  target/
65
- key: ${{ runner.os }}-${{ matrix.target }}-cargo-${{ hashFiles('**/Cargo.lock') }}
66
- - uses: actions/setup-python@v5
67
- with:
68
- python-version: |
69
- 3.11
70
- 3.12
71
- 3.13
72
- 3.14
73
- 3.14t
103
+ key: ${{ runner.os }}-${{ matrix.target }}-${{ matrix.build }}-cargo-${{ hashFiles('**/Cargo.lock') }}
104
+ - name: Select interpreters
105
+ id: interpreters
106
+ env:
107
+ PYTHON_VERSIONS: ${{ matrix.python }}
108
+ run: |
109
+ {
110
+ echo "versions<<EOF"
111
+ tr ' ' '\n' <<< "$PYTHON_VERSIONS"
112
+ echo "EOF"
113
+ echo "names=$(printf 'python%s ' $PYTHON_VERSIONS)"
114
+ } >> "$GITHUB_OUTPUT"
115
+ - uses: actions/setup-python@v7
116
+ with:
117
+ python-version: ${{ steps.interpreters.outputs.versions }}
74
118
  - name: Build wheels
75
119
  uses: PyO3/maturin-action@v1
76
120
  env:
@@ -79,17 +123,23 @@ jobs:
79
123
  target: ${{ matrix.target }}
80
124
  args: >-
81
125
  --release
126
+ --locked
82
127
  --out dist
83
- --find-interpreter
128
+ --interpreter ${{ steps.interpreters.outputs.names }}
84
129
  sccache: "true"
85
130
  container: "off"
131
+ - uses: ./.github/actions/check-wheel
132
+ with:
133
+ python-versions: ${{ matrix.python }}
134
+ wheel-directory: dist
86
135
  - name: Upload wheels
87
- uses: actions/upload-artifact@v4
136
+ uses: actions/upload-artifact@v7
88
137
  with:
89
- name: wheels-mac-${{ matrix.target }}
138
+ name: wheels-mac-${{ matrix.target }}-${{ matrix.build }}
90
139
  path: dist
91
140
 
92
141
  windows:
142
+ needs: release-contract
93
143
  runs-on: windows-latest
94
144
  env:
95
145
  CARGO_NET_GIT_FETCH_WITH_CLI: "true"
@@ -101,11 +151,11 @@ jobs:
101
151
  # (python/cpython#127294, PyO3/maturin-action#313).
102
152
  interpreter: ["3.11", "3.12", "3.13", "3.14", "3.14t"]
103
153
  steps:
104
- - uses: actions/checkout@v4
154
+ - uses: actions/checkout@v7
105
155
  - name: Enable long paths
106
156
  run: |
107
157
  reg add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem /v LongPathsEnabled /t REG_DWORD /d 1 /f
108
- - uses: actions/cache@v4
158
+ - uses: actions/cache@v6
109
159
  with:
110
160
  path: |
111
161
  ~/.cargo/bin/
@@ -114,7 +164,7 @@ jobs:
114
164
  ~/.cargo/git/db/
115
165
  target/
116
166
  key: ${{ runner.os }}-x64-${{ matrix.interpreter }}-cargo-${{ hashFiles('**/Cargo.lock') }}
117
- - uses: actions/setup-python@v5
167
+ - uses: actions/setup-python@v7
118
168
  id: setup-python
119
169
  with:
120
170
  python-version: ${{ matrix.interpreter }}
@@ -127,20 +177,26 @@ jobs:
127
177
  target: x64
128
178
  args: >-
129
179
  --release
180
+ --locked
130
181
  --out dist
131
182
  --interpreter ${{ steps.setup-python.outputs.python-path }}
132
183
  sccache: "true"
133
184
  container: "off"
185
+ - uses: ./.github/actions/check-wheel
186
+ with:
187
+ python-versions: ${{ matrix.interpreter }}
188
+ wheel-directory: dist
134
189
  - name: Upload wheels
135
- uses: actions/upload-artifact@v4
190
+ uses: actions/upload-artifact@v7
136
191
  with:
137
192
  name: wheels-windows-x64-${{ matrix.interpreter }}
138
193
  path: dist
139
194
 
140
195
  sdist:
196
+ needs: release-contract
141
197
  runs-on: ubuntu-latest
142
198
  steps:
143
- - uses: actions/checkout@v4
199
+ - uses: actions/checkout@v7
144
200
  - name: Build sdist
145
201
  uses: PyO3/maturin-action@v1
146
202
  env:
@@ -148,8 +204,15 @@ jobs:
148
204
  with:
149
205
  command: sdist
150
206
  args: --out dist
207
+ - uses: astral-sh/setup-uv@v10.3.3
208
+ - name: Build a wheel from the source distribution
209
+ run: uv build --wheel --python 3.12 --out-dir "$RUNNER_TEMP/sdist-wheel" dist/*.tar.gz
210
+ - uses: ./.github/actions/check-wheel
211
+ with:
212
+ python-versions: "3.12"
213
+ wheel-directory: ${{ runner.temp }}/sdist-wheel
151
214
  - name: Upload sdist
152
- uses: actions/upload-artifact@v4
215
+ uses: actions/upload-artifact@v7
153
216
  with:
154
217
  name: wheels-dist
155
218
  path: dist
@@ -158,20 +221,23 @@ jobs:
158
221
  name: Release
159
222
  environment: production
160
223
  runs-on: ubuntu-latest
161
- needs: [linux, macos, windows, sdist]
224
+ needs: [linux, macos, windows, sdist, conformance]
225
+ permissions:
226
+ contents: write
227
+ id-token: write
162
228
  steps:
163
- - uses: actions/checkout@v4
229
+ - uses: actions/checkout@v7
164
230
 
165
231
  - name: Download
166
232
  id: download
167
- uses: actions/download-artifact@v4
233
+ uses: actions/download-artifact@v8
168
234
  with:
169
235
  pattern: wheels-*
170
236
  path: dist
171
237
  merge-multiple: true
172
238
 
173
239
  - name: Create release
174
- uses: softprops/action-gh-release@v1
240
+ uses: softprops/action-gh-release@v3
175
241
  with:
176
242
  generate_release_notes: true
177
243
  fail_on_unmatched_files: true
@@ -0,0 +1,74 @@
1
+ # Agent guide
2
+
3
+ crc-framework is the numerical core of Climate Risk Commons: a Rust crate with
4
+ Python (PyO3) and JavaScript/WASM bindings. Data access and workflows live in
5
+ [crc-sdk](https://github.com/RiskThinking/crc-sdk).
6
+
7
+ ## Read first
8
+
9
+ - [docs/README.md](docs/README.md): reading order and source-of-truth map.
10
+ - [docs/python.md](docs/python.md): Python API, probability conventions and the
11
+ public export list.
12
+ - [docs/javascript.md](docs/javascript.md): current numerical inputs and errors.
13
+ - [docs/measurements.md](docs/measurements.md): typed scientific records and model-owned requirements.
14
+ - [python/crc_framework/contracts/api/public-api.json](python/crc_framework/contracts/api/public-api.json): authoritative Python exports, call signatures, enum members, and removals.
15
+ - [python/crc_framework/contracts/api/release.json](python/crc_framework/contracts/api/release.json): package and artifact version ledger.
16
+
17
+ ## Layout
18
+
19
+ | Path | Contents |
20
+ | --- | --- |
21
+ | `crates/core` | All algorithms and reference data (edit here first) |
22
+ | `src/` | PyO3 bindings (`crc_framework._core`) |
23
+ | `python/crc_framework` | Typed Python API; `_core.pyi` must match `src/` |
24
+ | `crates/wasm`, `js/` | WASM exports and the JS adapter |
25
+ | `python/crc_framework/contracts/numerical` | Numerical/fitting schemas and shared query fixtures; edit `tools/numerical_contracts/` |
26
+ | `python/crc_framework/contracts/scientific` | Measurement/context/impact schemas, model science, private table bindings, and shared fixtures; edit `tools/scientific_contracts/` and typed Python records |
27
+ | `python/crc_framework/contracts/dataset`, `python/crc_framework/contracts/taxonomy` | Dataset/taxonomy resources shared with CRC-SDK; keep vendored bytes identical |
28
+ | `python/crc_framework/contracts/impact` | Private numerical-kernel and reference-table conformance assets; edit `tools/impact_contracts/` |
29
+ | `python/crc_framework/contracts/api` | Python interface declarations and the release version ledger |
30
+ | `tools/api_contracts/check.py` | Declaration validation and installed-package release enforcement |
31
+ | `tools/sync_data_contracts.py` | Sync/check dataset and taxonomy resources from an explicit matching SDK checkout |
32
+
33
+ ## Checks
34
+
35
+ ```sh
36
+ cargo fmt --all -- --check
37
+ cargo clippy --workspace --all-targets -- -D warnings
38
+ cargo test --workspace --locked
39
+ .venv/bin/maturin develop --release && .venv/bin/python -m pytest -q
40
+ .venv/bin/python -m mypy
41
+ .venv/bin/python tools/api_contracts/check.py
42
+ .venv/bin/python tools/numerical_contracts/generate.py --check
43
+ .venv/bin/python tools/numerical_contracts/fixtures.py --check
44
+ .venv/bin/python tools/scientific_contracts/generate.py --check
45
+ ```
46
+
47
+ ## Rules
48
+
49
+ - Probabilities are non-exceedance `q` in `[0, 1]`; upper-tail return period
50
+ `T` is `q = 1 - 1/T`.
51
+ - Keep Python, JSON Schema, Arrow, Rust and WASM admission consistent. Run the
52
+ shared accepted/rejected fixtures through their structural and scientific
53
+ validators; numeric queries use explicit tolerances.
54
+ - Regenerate current contract resources from their owners, including the
55
+ generated measurement reference. Dataset and taxonomy definitions belong to
56
+ CRC-SDK; use `tools/sync_data_contracts.py --sdk PATH --check` to verify the
57
+ framework copies are byte-identical consumers. Private table assets
58
+ are implementation inputs and never a second public interchange contract.
59
+ - Long native calls release the GIL (`py.detach`).
60
+ - Implement the declared Python and numerical contracts directly. Remove
61
+ superseded exports, aliases, schemas, defaults, and compatibility adapters;
62
+ old export lists and the old JS `CurveProperties` shape impose no preservation
63
+ requirement.
64
+ - Use one public name per concept and the canonical root Python import. Closed
65
+ library choices use enums; user identities and custom scientific values stay
66
+ open. Do not hide public input or result types behind `Any`.
67
+ - Keep scientific choices separate from resource handling. Fit specifications
68
+ belong to the framework and are consumed unchanged by the SDK and catalogs.
69
+ - Follow the single release ledger. Unshipped contract revisions replace their
70
+ definitions in place; they do not cause another major version increment.
71
+ - Installed-package releases must pass
72
+ `tools/api_contracts/check.py --runtime`; declaration checks alone do not prove
73
+ that an implementation satisfies the public contract.
74
+ - Docs, code and commit messages are in English.