@climateriskcommons/crc-framework 0.6.0 → 1.0.0-alpha.1

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.
@@ -0,0 +1,409 @@
1
+ {
2
+ "$defs": {
3
+ "crop_vector": {
4
+ "additionalProperties": false,
5
+ "description": "Per-crop coefficient vector with exactly maize, rice and wheat.",
6
+ "properties": {
7
+ "maize": {
8
+ "$ref": "#/$defs/number",
9
+ "description": "Maize coefficient."
10
+ },
11
+ "rice": {
12
+ "$ref": "#/$defs/number",
13
+ "description": "Rice coefficient."
14
+ },
15
+ "wheat": {
16
+ "$ref": "#/$defs/number",
17
+ "description": "Wheat coefficient."
18
+ }
19
+ },
20
+ "required": [
21
+ "maize",
22
+ "rice",
23
+ "wheat"
24
+ ],
25
+ "type": "object"
26
+ },
27
+ "crop_weights": {
28
+ "additionalProperties": false,
29
+ "description": "Per-crop coefficient vector with exactly maize, rice and wheat.",
30
+ "properties": {
31
+ "maize": {
32
+ "$ref": "#/$defs/non_negative_number",
33
+ "description": "Maize coefficient."
34
+ },
35
+ "rice": {
36
+ "$ref": "#/$defs/non_negative_number",
37
+ "description": "Rice coefficient."
38
+ },
39
+ "wheat": {
40
+ "$ref": "#/$defs/non_negative_number",
41
+ "description": "Wheat coefficient."
42
+ }
43
+ },
44
+ "required": [
45
+ "maize",
46
+ "rice",
47
+ "wheat"
48
+ ],
49
+ "type": "object"
50
+ },
51
+ "model_binned": {
52
+ "additionalProperties": false,
53
+ "description": "Interval lookup over [edge_i, edge_(i+1)); the final interval includes the final edge and interior edges select the interval to their right.",
54
+ "properties": {
55
+ "bin_edges": {
56
+ "description": "Strictly increasing interval edges.",
57
+ "items": {
58
+ "$ref": "#/$defs/number"
59
+ },
60
+ "minItems": 2,
61
+ "type": "array"
62
+ },
63
+ "kind": {
64
+ "const": "binned",
65
+ "description": "Variant tag 'binned'.",
66
+ "type": "string"
67
+ },
68
+ "outside_domain": {
69
+ "description": "Below or above the table domain: clamp returns the nearest endpoint response; error rejects the exposure.",
70
+ "enum": [
71
+ "clamp",
72
+ "error"
73
+ ],
74
+ "type": "string"
75
+ },
76
+ "values": {
77
+ "description": "One finite response per interval.",
78
+ "items": {
79
+ "$ref": "#/$defs/number"
80
+ },
81
+ "minItems": 1,
82
+ "type": "array"
83
+ }
84
+ },
85
+ "required": [
86
+ "kind",
87
+ "bin_edges",
88
+ "values"
89
+ ],
90
+ "type": "object"
91
+ },
92
+ "model_cooling": {
93
+ "additionalProperties": false,
94
+ "description": "Registry snapshot: raw = 0 for x <= 1, else cooling_cost * x / (historic_mean * 10_000_000).",
95
+ "properties": {
96
+ "cooling_cost": {
97
+ "$ref": "#/$defs/non_negative_number",
98
+ "description": "Cooling cost coefficient."
99
+ },
100
+ "historic_mean": {
101
+ "$ref": "#/$defs/positive_number",
102
+ "description": "Historical baseline exposure."
103
+ },
104
+ "kind": {
105
+ "const": "cooling",
106
+ "description": "Variant tag 'cooling'.",
107
+ "type": "string"
108
+ }
109
+ },
110
+ "required": [
111
+ "kind",
112
+ "cooling_cost",
113
+ "historic_mean"
114
+ ],
115
+ "type": "object"
116
+ },
117
+ "model_crop": {
118
+ "additionalProperties": false,
119
+ "description": "Registry snapshot: weighted historical/future crop response with reference year 2010.",
120
+ "properties": {
121
+ "country": {
122
+ "$ref": "#/$defs/crop_vector",
123
+ "description": "Country coefficients."
124
+ },
125
+ "historic_mean": {
126
+ "$ref": "#/$defs/number",
127
+ "description": "Historical baseline exposure."
128
+ },
129
+ "index": {
130
+ "$ref": "#/$defs/crop_vector",
131
+ "description": "Exposure index coefficients."
132
+ },
133
+ "kind": {
134
+ "const": "crop",
135
+ "description": "Variant tag 'crop'.",
136
+ "type": "string"
137
+ },
138
+ "weights": {
139
+ "$ref": "#/$defs/crop_weights",
140
+ "description": "Non-negative crop weights with positive total; never renormalized."
141
+ },
142
+ "yearly": {
143
+ "$ref": "#/$defs/crop_vector",
144
+ "description": "Yearly trend coefficients."
145
+ }
146
+ },
147
+ "required": [
148
+ "kind",
149
+ "weights",
150
+ "country",
151
+ "yearly",
152
+ "index",
153
+ "historic_mean"
154
+ ],
155
+ "type": "object"
156
+ },
157
+ "model_linear": {
158
+ "additionalProperties": false,
159
+ "description": "raw(x) = slope * x + intercept.",
160
+ "properties": {
161
+ "intercept": {
162
+ "$ref": "#/$defs/number",
163
+ "description": "Intercept."
164
+ },
165
+ "kind": {
166
+ "const": "linear",
167
+ "description": "Variant tag 'linear'.",
168
+ "type": "string"
169
+ },
170
+ "slope": {
171
+ "$ref": "#/$defs/number",
172
+ "description": "Slope; positive, zero or negative."
173
+ }
174
+ },
175
+ "required": [
176
+ "kind",
177
+ "slope"
178
+ ],
179
+ "type": "object"
180
+ },
181
+ "model_sigmoid": {
182
+ "additionalProperties": false,
183
+ "description": "raw(x) = offset + amplitude * (L(steepness * (x - midpoint)) - [L(-steepness * midpoint) if subtract_at_zero]); raw(x) = 0 when zero_below is present and x < zero_below.",
184
+ "properties": {
185
+ "amplitude": {
186
+ "$ref": "#/$defs/non_negative_number",
187
+ "description": "Difference between the upper and lower asymptotes."
188
+ },
189
+ "kind": {
190
+ "const": "sigmoid",
191
+ "description": "Variant tag 'sigmoid'.",
192
+ "type": "string"
193
+ },
194
+ "midpoint": {
195
+ "$ref": "#/$defs/number",
196
+ "description": "Logistic midpoint."
197
+ },
198
+ "offset": {
199
+ "$ref": "#/$defs/number",
200
+ "description": "Lower asymptote of the response."
201
+ },
202
+ "origin_adjustment": {
203
+ "description": "subtract_at_zero subtracts the unit logistic at x = 0 without renormalizing the upper asymptote.",
204
+ "enum": [
205
+ "none",
206
+ "subtract_at_zero"
207
+ ],
208
+ "type": "string"
209
+ },
210
+ "steepness": {
211
+ "$ref": "#/$defs/number",
212
+ "description": "Logistic steepness; zero gives a constant response."
213
+ },
214
+ "zero_below": {
215
+ "anyOf": [
216
+ {
217
+ "$ref": "#/$defs/number"
218
+ },
219
+ {
220
+ "type": "null"
221
+ }
222
+ ],
223
+ "description": "Strict threshold: x < zero_below gives raw response 0; equality evaluates the sigmoid."
224
+ }
225
+ },
226
+ "required": [
227
+ "kind",
228
+ "midpoint",
229
+ "steepness"
230
+ ],
231
+ "type": "object"
232
+ },
233
+ "model_spei": {
234
+ "additionalProperties": false,
235
+ "description": "Registry snapshot: water-cost response with the fixed crc-impact/1 SPEI constants.",
236
+ "properties": {
237
+ "kind": {
238
+ "const": "spei",
239
+ "description": "Variant tag 'spei'.",
240
+ "type": "string"
241
+ },
242
+ "original_water_unit_cost": {
243
+ "$ref": "#/$defs/non_negative_number",
244
+ "description": "Water unit cost before drought scaling."
245
+ },
246
+ "water_consumption_asset": {
247
+ "$ref": "#/$defs/non_negative_number",
248
+ "description": "Asset water consumption."
249
+ }
250
+ },
251
+ "required": [
252
+ "kind",
253
+ "water_consumption_asset",
254
+ "original_water_unit_cost"
255
+ ],
256
+ "type": "object"
257
+ },
258
+ "model_tabulated": {
259
+ "additionalProperties": false,
260
+ "description": "Response table with strictly increasing x knots. Between knots: linear interpolates, step_left returns y_i, step_right returns y_(i+1); every mode returns y_i at x_i.",
261
+ "properties": {
262
+ "interpolation": {
263
+ "description": "Interpolation between adjacent knots.",
264
+ "enum": [
265
+ "linear",
266
+ "step_left",
267
+ "step_right"
268
+ ],
269
+ "type": "string"
270
+ },
271
+ "kind": {
272
+ "const": "tabulated",
273
+ "description": "Variant tag 'tabulated'.",
274
+ "type": "string"
275
+ },
276
+ "outside_domain": {
277
+ "description": "Below or above the table domain: clamp returns the nearest endpoint response; error rejects the exposure.",
278
+ "enum": [
279
+ "clamp",
280
+ "error"
281
+ ],
282
+ "type": "string"
283
+ },
284
+ "points": {
285
+ "description": "Ordered knots; order is preserved and never sorted.",
286
+ "items": {
287
+ "$ref": "#/$defs/point"
288
+ },
289
+ "minItems": 2,
290
+ "type": "array"
291
+ }
292
+ },
293
+ "required": [
294
+ "kind",
295
+ "points"
296
+ ],
297
+ "type": "object"
298
+ },
299
+ "non_negative_number": {
300
+ "minimum": 0,
301
+ "type": "number"
302
+ },
303
+ "number": {
304
+ "description": "JSON number converted once to finite IEEE binary64; booleans and strings are rejected.",
305
+ "type": "number"
306
+ },
307
+ "point": {
308
+ "additionalProperties": false,
309
+ "description": "One tabulated knot.",
310
+ "properties": {
311
+ "x": {
312
+ "$ref": "#/$defs/number",
313
+ "description": "Exposure in the calibrated exposure unit."
314
+ },
315
+ "y": {
316
+ "$ref": "#/$defs/number",
317
+ "description": "Raw response at x."
318
+ }
319
+ },
320
+ "required": [
321
+ "x",
322
+ "y"
323
+ ],
324
+ "type": "object"
325
+ },
326
+ "positive_number": {
327
+ "exclusiveMinimum": 0,
328
+ "type": "number"
329
+ }
330
+ },
331
+ "$id": "https://climateriskcommons.org/schemas/impact-2.0.schema.json",
332
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
333
+ "additionalProperties": false,
334
+ "properties": {
335
+ "clamp": {
336
+ "additionalProperties": false,
337
+ "minProperties": 1,
338
+ "properties": {
339
+ "maximum": {
340
+ "type": "number"
341
+ },
342
+ "minimum": {
343
+ "type": "number"
344
+ }
345
+ },
346
+ "required": [],
347
+ "type": "object"
348
+ },
349
+ "input": {
350
+ "$ref": "https://climateriskcommons.org/schemas/measurement-1.0.schema.json"
351
+ },
352
+ "model": {
353
+ "description": "Tagged numerical model containing every coefficient needed for evaluation.",
354
+ "oneOf": [
355
+ {
356
+ "$ref": "#/$defs/model_linear"
357
+ },
358
+ {
359
+ "$ref": "#/$defs/model_sigmoid"
360
+ },
361
+ {
362
+ "$ref": "#/$defs/model_tabulated"
363
+ },
364
+ {
365
+ "$ref": "#/$defs/model_binned"
366
+ },
367
+ {
368
+ "$ref": "#/$defs/model_spei"
369
+ },
370
+ {
371
+ "$ref": "#/$defs/model_cooling"
372
+ },
373
+ {
374
+ "$ref": "#/$defs/model_crop"
375
+ }
376
+ ]
377
+ },
378
+ "output": {
379
+ "$ref": "https://climateriskcommons.org/schemas/measurement-1.0.schema.json"
380
+ },
381
+ "provenance": {
382
+ "additionalProperties": false,
383
+ "properties": {
384
+ "context": {
385
+ "$ref": "https://climateriskcommons.org/schemas/impact-context-1.0.schema.json"
386
+ },
387
+ "model": {
388
+ "$ref": "https://climateriskcommons.org/schemas/impact-reference-2.0.schema.json"
389
+ }
390
+ },
391
+ "required": [
392
+ "model",
393
+ "context"
394
+ ],
395
+ "type": "object"
396
+ },
397
+ "schema_version": {
398
+ "const": "2.0"
399
+ }
400
+ },
401
+ "required": [
402
+ "schema_version",
403
+ "input",
404
+ "output",
405
+ "model"
406
+ ],
407
+ "title": "Impact",
408
+ "type": "object"
409
+ }