@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,757 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://climateriskcommons.org/schemas/numerical/1.0",
4
+ "description": "Current numerical objects. Ordered knots, exact masses and modelling records require the numerical semantic validator in addition to structural validation.",
5
+ "$defs": {
6
+ "data": {
7
+ "oneOf": [
8
+ {
9
+ "type": "object",
10
+ "properties": {
11
+ "kind": {
12
+ "const": "parametric"
13
+ },
14
+ "family": {
15
+ "enum": [
16
+ "gumbel_r",
17
+ "gumbel_l"
18
+ ]
19
+ },
20
+ "location": {
21
+ "type": "number",
22
+ "minimum": -1.7976931348623157e+308,
23
+ "maximum": 1.7976931348623157e+308
24
+ },
25
+ "scale": {
26
+ "type": "number",
27
+ "minimum": -1.7976931348623157e+308,
28
+ "maximum": 1.7976931348623157e+308,
29
+ "exclusiveMinimum": 0
30
+ }
31
+ },
32
+ "required": [
33
+ "kind",
34
+ "family",
35
+ "location",
36
+ "scale"
37
+ ],
38
+ "additionalProperties": false
39
+ },
40
+ {
41
+ "type": "object",
42
+ "properties": {
43
+ "kind": {
44
+ "const": "parametric"
45
+ },
46
+ "family": {
47
+ "enum": [
48
+ "genextreme",
49
+ "weibull_min",
50
+ "weibull_max",
51
+ "skewnorm",
52
+ "genpareto"
53
+ ]
54
+ },
55
+ "location": {
56
+ "type": "number",
57
+ "minimum": -1.7976931348623157e+308,
58
+ "maximum": 1.7976931348623157e+308
59
+ },
60
+ "scale": {
61
+ "type": "number",
62
+ "minimum": -1.7976931348623157e+308,
63
+ "maximum": 1.7976931348623157e+308,
64
+ "exclusiveMinimum": 0
65
+ },
66
+ "shape": {
67
+ "type": "number",
68
+ "minimum": -1.7976931348623157e+308,
69
+ "maximum": 1.7976931348623157e+308
70
+ }
71
+ },
72
+ "required": [
73
+ "kind",
74
+ "family",
75
+ "location",
76
+ "scale",
77
+ "shape"
78
+ ],
79
+ "additionalProperties": false
80
+ },
81
+ {
82
+ "type": "object",
83
+ "properties": {
84
+ "kind": {
85
+ "const": "discrete"
86
+ },
87
+ "values": {
88
+ "type": "array",
89
+ "items": {
90
+ "type": "number",
91
+ "minimum": -1.7976931348623157e+308,
92
+ "maximum": 1.7976931348623157e+308
93
+ },
94
+ "minItems": 1
95
+ },
96
+ "probabilities": {
97
+ "type": "array",
98
+ "items": {
99
+ "type": "number",
100
+ "minimum": 0,
101
+ "maximum": 1
102
+ },
103
+ "minItems": 1
104
+ },
105
+ "counts": {
106
+ "type": "array",
107
+ "items": {
108
+ "type": "integer",
109
+ "minimum": 1,
110
+ "maximum": 9007199254740992
111
+ },
112
+ "minItems": 1
113
+ }
114
+ },
115
+ "required": [
116
+ "kind",
117
+ "values",
118
+ "probabilities"
119
+ ],
120
+ "additionalProperties": false
121
+ },
122
+ {
123
+ "type": "object",
124
+ "properties": {
125
+ "kind": {
126
+ "const": "histogram"
127
+ },
128
+ "edges": {
129
+ "type": "array",
130
+ "items": {
131
+ "type": "number",
132
+ "minimum": -1.7976931348623157e+308,
133
+ "maximum": 1.7976931348623157e+308
134
+ },
135
+ "minItems": 2
136
+ },
137
+ "probabilities": {
138
+ "type": "array",
139
+ "items": {
140
+ "type": "number",
141
+ "minimum": 0,
142
+ "maximum": 1
143
+ },
144
+ "minItems": 1
145
+ }
146
+ },
147
+ "required": [
148
+ "kind",
149
+ "edges",
150
+ "probabilities"
151
+ ],
152
+ "additionalProperties": false
153
+ },
154
+ {
155
+ "type": "object",
156
+ "properties": {
157
+ "kind": {
158
+ "const": "point_mass"
159
+ },
160
+ "value": {
161
+ "type": "number",
162
+ "minimum": -1.7976931348623157e+308,
163
+ "maximum": 1.7976931348623157e+308
164
+ }
165
+ },
166
+ "required": [
167
+ "kind",
168
+ "value"
169
+ ],
170
+ "additionalProperties": false
171
+ },
172
+ {
173
+ "type": "object",
174
+ "properties": {
175
+ "kind": {
176
+ "const": "hurdle"
177
+ },
178
+ "base": {
179
+ "$ref": "#/$defs/data"
180
+ },
181
+ "atom_probability": {
182
+ "type": "number",
183
+ "minimum": 0,
184
+ "maximum": 1
185
+ },
186
+ "atom_location": {
187
+ "type": "number",
188
+ "minimum": -1.7976931348623157e+308,
189
+ "maximum": 1.7976931348623157e+308
190
+ }
191
+ },
192
+ "required": [
193
+ "kind",
194
+ "base",
195
+ "atom_probability",
196
+ "atom_location"
197
+ ],
198
+ "additionalProperties": false
199
+ },
200
+ {
201
+ "type": "object",
202
+ "properties": {
203
+ "kind": {
204
+ "const": "quantile"
205
+ },
206
+ "probabilities": {
207
+ "type": "array",
208
+ "items": {
209
+ "type": "number",
210
+ "minimum": 0,
211
+ "maximum": 1
212
+ },
213
+ "minItems": 2
214
+ },
215
+ "values": {
216
+ "type": "array",
217
+ "items": {
218
+ "type": "number",
219
+ "minimum": -1.7976931348623157e+308,
220
+ "maximum": 1.7976931348623157e+308
221
+ },
222
+ "minItems": 2
223
+ },
224
+ "evidence": {
225
+ "oneOf": [
226
+ {
227
+ "type": "object",
228
+ "properties": {
229
+ "source": {
230
+ "$ref": "#/$defs/quantile_curve"
231
+ },
232
+ "operation": {
233
+ "const": "condition"
234
+ },
235
+ "q_min": {
236
+ "type": "number",
237
+ "minimum": 0,
238
+ "maximum": 1
239
+ },
240
+ "q_max": {
241
+ "type": "number",
242
+ "minimum": 0,
243
+ "maximum": 1
244
+ }
245
+ },
246
+ "required": [
247
+ "source",
248
+ "operation",
249
+ "q_min",
250
+ "q_max"
251
+ ],
252
+ "additionalProperties": false
253
+ },
254
+ {
255
+ "type": "object",
256
+ "properties": {
257
+ "source": {
258
+ "$ref": "#/$defs/quantile_curve"
259
+ },
260
+ "operation": {
261
+ "const": "complete"
262
+ },
263
+ "policy": {
264
+ "type": "object",
265
+ "properties": {
266
+ "name": {
267
+ "const": "finite_endpoints"
268
+ },
269
+ "lower": {
270
+ "type": "number",
271
+ "minimum": -1.7976931348623157e+308,
272
+ "maximum": 1.7976931348623157e+308
273
+ },
274
+ "upper": {
275
+ "type": "number",
276
+ "minimum": -1.7976931348623157e+308,
277
+ "maximum": 1.7976931348623157e+308
278
+ }
279
+ },
280
+ "required": [
281
+ "name",
282
+ "lower",
283
+ "upper"
284
+ ],
285
+ "additionalProperties": false
286
+ }
287
+ },
288
+ "required": [
289
+ "source",
290
+ "operation",
291
+ "policy"
292
+ ],
293
+ "additionalProperties": false
294
+ }
295
+ ]
296
+ }
297
+ },
298
+ "required": [
299
+ "kind",
300
+ "probabilities",
301
+ "values"
302
+ ],
303
+ "additionalProperties": false
304
+ },
305
+ {
306
+ "type": "object",
307
+ "properties": {
308
+ "kind": {
309
+ "const": "transformed"
310
+ },
311
+ "source": {
312
+ "$ref": "#/$defs/distribution"
313
+ },
314
+ "impact": {
315
+ "$ref": "https://climateriskcommons.org/schemas/impact-2.0.schema.json"
316
+ }
317
+ },
318
+ "required": [
319
+ "kind",
320
+ "source",
321
+ "impact"
322
+ ],
323
+ "additionalProperties": false
324
+ }
325
+ ]
326
+ },
327
+ "quantile_curve": {
328
+ "type": "object",
329
+ "properties": {
330
+ "schema_version": {
331
+ "const": "1.0"
332
+ },
333
+ "object": {
334
+ "const": "quantile_curve"
335
+ },
336
+ "probabilities": {
337
+ "type": "array",
338
+ "items": {
339
+ "type": "number",
340
+ "minimum": 0,
341
+ "maximum": 1
342
+ },
343
+ "minItems": 2
344
+ },
345
+ "values": {
346
+ "type": "array",
347
+ "items": {
348
+ "type": "number",
349
+ "minimum": -1.7976931348623157e+308,
350
+ "maximum": 1.7976931348623157e+308
351
+ },
352
+ "minItems": 2
353
+ }
354
+ },
355
+ "required": [
356
+ "schema_version",
357
+ "object",
358
+ "probabilities",
359
+ "values"
360
+ ],
361
+ "additionalProperties": false
362
+ },
363
+ "distribution": {
364
+ "oneOf": [
365
+ {
366
+ "type": "object",
367
+ "properties": {
368
+ "schema_version": {
369
+ "const": "1.0"
370
+ },
371
+ "object": {
372
+ "const": "distribution"
373
+ },
374
+ "kind": {
375
+ "const": "parametric"
376
+ },
377
+ "family": {
378
+ "enum": [
379
+ "gumbel_r",
380
+ "gumbel_l"
381
+ ]
382
+ },
383
+ "location": {
384
+ "type": "number",
385
+ "minimum": -1.7976931348623157e+308,
386
+ "maximum": 1.7976931348623157e+308
387
+ },
388
+ "scale": {
389
+ "type": "number",
390
+ "minimum": -1.7976931348623157e+308,
391
+ "maximum": 1.7976931348623157e+308,
392
+ "exclusiveMinimum": 0
393
+ }
394
+ },
395
+ "required": [
396
+ "schema_version",
397
+ "object",
398
+ "kind",
399
+ "family",
400
+ "location",
401
+ "scale"
402
+ ],
403
+ "additionalProperties": false
404
+ },
405
+ {
406
+ "type": "object",
407
+ "properties": {
408
+ "schema_version": {
409
+ "const": "1.0"
410
+ },
411
+ "object": {
412
+ "const": "distribution"
413
+ },
414
+ "kind": {
415
+ "const": "parametric"
416
+ },
417
+ "family": {
418
+ "enum": [
419
+ "genextreme",
420
+ "weibull_min",
421
+ "weibull_max",
422
+ "skewnorm",
423
+ "genpareto"
424
+ ]
425
+ },
426
+ "location": {
427
+ "type": "number",
428
+ "minimum": -1.7976931348623157e+308,
429
+ "maximum": 1.7976931348623157e+308
430
+ },
431
+ "scale": {
432
+ "type": "number",
433
+ "minimum": -1.7976931348623157e+308,
434
+ "maximum": 1.7976931348623157e+308,
435
+ "exclusiveMinimum": 0
436
+ },
437
+ "shape": {
438
+ "type": "number",
439
+ "minimum": -1.7976931348623157e+308,
440
+ "maximum": 1.7976931348623157e+308
441
+ }
442
+ },
443
+ "required": [
444
+ "schema_version",
445
+ "object",
446
+ "kind",
447
+ "family",
448
+ "location",
449
+ "scale",
450
+ "shape"
451
+ ],
452
+ "additionalProperties": false
453
+ },
454
+ {
455
+ "type": "object",
456
+ "properties": {
457
+ "schema_version": {
458
+ "const": "1.0"
459
+ },
460
+ "object": {
461
+ "const": "distribution"
462
+ },
463
+ "kind": {
464
+ "const": "discrete"
465
+ },
466
+ "values": {
467
+ "type": "array",
468
+ "items": {
469
+ "type": "number",
470
+ "minimum": -1.7976931348623157e+308,
471
+ "maximum": 1.7976931348623157e+308
472
+ },
473
+ "minItems": 1
474
+ },
475
+ "probabilities": {
476
+ "type": "array",
477
+ "items": {
478
+ "type": "number",
479
+ "minimum": 0,
480
+ "maximum": 1
481
+ },
482
+ "minItems": 1
483
+ },
484
+ "counts": {
485
+ "type": "array",
486
+ "items": {
487
+ "type": "integer",
488
+ "minimum": 1,
489
+ "maximum": 9007199254740992
490
+ },
491
+ "minItems": 1
492
+ }
493
+ },
494
+ "required": [
495
+ "schema_version",
496
+ "object",
497
+ "kind",
498
+ "values",
499
+ "probabilities"
500
+ ],
501
+ "additionalProperties": false
502
+ },
503
+ {
504
+ "type": "object",
505
+ "properties": {
506
+ "schema_version": {
507
+ "const": "1.0"
508
+ },
509
+ "object": {
510
+ "const": "distribution"
511
+ },
512
+ "kind": {
513
+ "const": "histogram"
514
+ },
515
+ "edges": {
516
+ "type": "array",
517
+ "items": {
518
+ "type": "number",
519
+ "minimum": -1.7976931348623157e+308,
520
+ "maximum": 1.7976931348623157e+308
521
+ },
522
+ "minItems": 2
523
+ },
524
+ "probabilities": {
525
+ "type": "array",
526
+ "items": {
527
+ "type": "number",
528
+ "minimum": 0,
529
+ "maximum": 1
530
+ },
531
+ "minItems": 1
532
+ }
533
+ },
534
+ "required": [
535
+ "schema_version",
536
+ "object",
537
+ "kind",
538
+ "edges",
539
+ "probabilities"
540
+ ],
541
+ "additionalProperties": false
542
+ },
543
+ {
544
+ "type": "object",
545
+ "properties": {
546
+ "schema_version": {
547
+ "const": "1.0"
548
+ },
549
+ "object": {
550
+ "const": "distribution"
551
+ },
552
+ "kind": {
553
+ "const": "point_mass"
554
+ },
555
+ "value": {
556
+ "type": "number",
557
+ "minimum": -1.7976931348623157e+308,
558
+ "maximum": 1.7976931348623157e+308
559
+ }
560
+ },
561
+ "required": [
562
+ "schema_version",
563
+ "object",
564
+ "kind",
565
+ "value"
566
+ ],
567
+ "additionalProperties": false
568
+ },
569
+ {
570
+ "type": "object",
571
+ "properties": {
572
+ "schema_version": {
573
+ "const": "1.0"
574
+ },
575
+ "object": {
576
+ "const": "distribution"
577
+ },
578
+ "kind": {
579
+ "const": "hurdle"
580
+ },
581
+ "base": {
582
+ "$ref": "#/$defs/data"
583
+ },
584
+ "atom_probability": {
585
+ "type": "number",
586
+ "minimum": 0,
587
+ "maximum": 1
588
+ },
589
+ "atom_location": {
590
+ "type": "number",
591
+ "minimum": -1.7976931348623157e+308,
592
+ "maximum": 1.7976931348623157e+308
593
+ }
594
+ },
595
+ "required": [
596
+ "schema_version",
597
+ "object",
598
+ "kind",
599
+ "base",
600
+ "atom_probability",
601
+ "atom_location"
602
+ ],
603
+ "additionalProperties": false
604
+ },
605
+ {
606
+ "type": "object",
607
+ "properties": {
608
+ "schema_version": {
609
+ "const": "1.0"
610
+ },
611
+ "object": {
612
+ "const": "distribution"
613
+ },
614
+ "kind": {
615
+ "const": "quantile"
616
+ },
617
+ "probabilities": {
618
+ "type": "array",
619
+ "items": {
620
+ "type": "number",
621
+ "minimum": 0,
622
+ "maximum": 1
623
+ },
624
+ "minItems": 2
625
+ },
626
+ "values": {
627
+ "type": "array",
628
+ "items": {
629
+ "type": "number",
630
+ "minimum": -1.7976931348623157e+308,
631
+ "maximum": 1.7976931348623157e+308
632
+ },
633
+ "minItems": 2
634
+ },
635
+ "evidence": {
636
+ "oneOf": [
637
+ {
638
+ "type": "object",
639
+ "properties": {
640
+ "source": {
641
+ "$ref": "#/$defs/quantile_curve"
642
+ },
643
+ "operation": {
644
+ "const": "condition"
645
+ },
646
+ "q_min": {
647
+ "type": "number",
648
+ "minimum": 0,
649
+ "maximum": 1
650
+ },
651
+ "q_max": {
652
+ "type": "number",
653
+ "minimum": 0,
654
+ "maximum": 1
655
+ }
656
+ },
657
+ "required": [
658
+ "source",
659
+ "operation",
660
+ "q_min",
661
+ "q_max"
662
+ ],
663
+ "additionalProperties": false
664
+ },
665
+ {
666
+ "type": "object",
667
+ "properties": {
668
+ "source": {
669
+ "$ref": "#/$defs/quantile_curve"
670
+ },
671
+ "operation": {
672
+ "const": "complete"
673
+ },
674
+ "policy": {
675
+ "type": "object",
676
+ "properties": {
677
+ "name": {
678
+ "const": "finite_endpoints"
679
+ },
680
+ "lower": {
681
+ "type": "number",
682
+ "minimum": -1.7976931348623157e+308,
683
+ "maximum": 1.7976931348623157e+308
684
+ },
685
+ "upper": {
686
+ "type": "number",
687
+ "minimum": -1.7976931348623157e+308,
688
+ "maximum": 1.7976931348623157e+308
689
+ }
690
+ },
691
+ "required": [
692
+ "name",
693
+ "lower",
694
+ "upper"
695
+ ],
696
+ "additionalProperties": false
697
+ }
698
+ },
699
+ "required": [
700
+ "source",
701
+ "operation",
702
+ "policy"
703
+ ],
704
+ "additionalProperties": false
705
+ }
706
+ ]
707
+ }
708
+ },
709
+ "required": [
710
+ "schema_version",
711
+ "object",
712
+ "kind",
713
+ "probabilities",
714
+ "values"
715
+ ],
716
+ "additionalProperties": false
717
+ },
718
+ {
719
+ "type": "object",
720
+ "properties": {
721
+ "schema_version": {
722
+ "const": "1.0"
723
+ },
724
+ "object": {
725
+ "const": "distribution"
726
+ },
727
+ "kind": {
728
+ "const": "transformed"
729
+ },
730
+ "source": {
731
+ "$ref": "#/$defs/distribution"
732
+ },
733
+ "impact": {
734
+ "$ref": "https://climateriskcommons.org/schemas/impact-2.0.schema.json"
735
+ }
736
+ },
737
+ "required": [
738
+ "schema_version",
739
+ "object",
740
+ "kind",
741
+ "source",
742
+ "impact"
743
+ ],
744
+ "additionalProperties": false
745
+ }
746
+ ]
747
+ }
748
+ },
749
+ "oneOf": [
750
+ {
751
+ "$ref": "#/$defs/quantile_curve"
752
+ },
753
+ {
754
+ "$ref": "#/$defs/distribution"
755
+ }
756
+ ]
757
+ }