crc-framework 0.2.1__tar.gz → 0.2.4__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.
- {crc_framework-0.2.1 → crc_framework-0.2.4}/.github/workflows/release.yaml +2 -5
- {crc_framework-0.2.1 → crc_framework-0.2.4}/Cargo.lock +12 -52
- {crc_framework-0.2.1 → crc_framework-0.2.4}/Cargo.toml +2 -2
- {crc_framework-0.2.1 → crc_framework-0.2.4}/PKG-INFO +4 -1
- {crc_framework-0.2.1 → crc_framework-0.2.4}/crates/core/Cargo.toml +1 -1
- {crc_framework-0.2.1 → crc_framework-0.2.4}/crates/core/src/reference/curve_fitting.rs +27 -0
- {crc_framework-0.2.1 → crc_framework-0.2.4}/pyproject.toml +5 -0
- {crc_framework-0.2.1 → crc_framework-0.2.4}/.gitignore +0 -0
- {crc_framework-0.2.1 → crc_framework-0.2.4}/LICENSE +0 -0
- {crc_framework-0.2.1 → crc_framework-0.2.4}/README.md +0 -0
- {crc_framework-0.2.1 → crc_framework-0.2.4}/THIRD_PARTY_NOTICES.md +0 -0
- {crc_framework-0.2.1 → crc_framework-0.2.4}/crates/core/src/constants.rs +0 -0
- {crc_framework-0.2.1 → crc_framework-0.2.4}/crates/core/src/distribution.rs +0 -0
- {crc_framework-0.2.1 → crc_framework-0.2.4}/crates/core/src/error.rs +0 -0
- {crc_framework-0.2.1 → crc_framework-0.2.4}/crates/core/src/lib.rs +0 -0
- {crc_framework-0.2.1 → crc_framework-0.2.4}/crates/core/src/metrics.rs +0 -0
- {crc_framework-0.2.1 → crc_framework-0.2.4}/crates/core/src/reference/climate/ag_params.rs +0 -0
- {crc_framework-0.2.1 → crc_framework-0.2.4}/crates/core/src/reference/climate/energy_params.rs +0 -0
- {crc_framework-0.2.1 → crc_framework-0.2.4}/crates/core/src/reference/climate/flood_params.rs +0 -0
- {crc_framework-0.2.1 → crc_framework-0.2.4}/crates/core/src/reference/climate/mod.rs +0 -0
- {crc_framework-0.2.1 → crc_framework-0.2.4}/crates/core/src/reference/climate/precipitation_thresholds.rs +0 -0
- {crc_framework-0.2.1 → crc_framework-0.2.4}/crates/core/src/reference/climate/spei_params.rs +0 -0
- {crc_framework-0.2.1 → crc_framework-0.2.4}/crates/core/src/reference/climate/wind_params.rs +0 -0
- {crc_framework-0.2.1 → crc_framework-0.2.4}/crates/core/src/reference/mod.rs +0 -0
- {crc_framework-0.2.1 → crc_framework-0.2.4}/crates/core/src/reference/spatial/continent_r4.rs +0 -0
- {crc_framework-0.2.1 → crc_framework-0.2.4}/crates/core/src/reference/spatial/geography_r5.rs +0 -0
- {crc_framework-0.2.1 → crc_framework-0.2.4}/crates/core/src/reference/spatial/ipcc.rs +0 -0
- {crc_framework-0.2.1 → crc_framework-0.2.4}/crates/core/src/reference/spatial/mod.rs +0 -0
- {crc_framework-0.2.1 → crc_framework-0.2.4}/crates/core/src/risk.rs +0 -0
- {crc_framework-0.2.1 → crc_framework-0.2.4}/crates/core/src/spatial.rs +0 -0
- {crc_framework-0.2.1 → crc_framework-0.2.4}/crates/core/src/transform.rs +0 -0
- {crc_framework-0.2.1 → crc_framework-0.2.4}/python/crc_framework/__init__.py +0 -0
- {crc_framework-0.2.1 → crc_framework-0.2.4}/python/crc_framework/_core.pyi +0 -0
- {crc_framework-0.2.1 → crc_framework-0.2.4}/python/crc_framework/constants.py +0 -0
- {crc_framework-0.2.1 → crc_framework-0.2.4}/python/crc_framework/distributions/__init__.py +0 -0
- {crc_framework-0.2.1 → crc_framework-0.2.4}/python/crc_framework/distributions/base.py +0 -0
- {crc_framework-0.2.1 → crc_framework-0.2.4}/python/crc_framework/distributions/empirical.py +0 -0
- {crc_framework-0.2.1 → crc_framework-0.2.4}/python/crc_framework/distributions/fitted.py +0 -0
- {crc_framework-0.2.1 → crc_framework-0.2.4}/python/crc_framework/distributions/fitting.py +0 -0
- {crc_framework-0.2.1 → crc_framework-0.2.4}/python/crc_framework/distributions/hurdle.py +0 -0
- {crc_framework-0.2.1 → crc_framework-0.2.4}/python/crc_framework/distributions/point_mass.py +0 -0
- {crc_framework-0.2.1 → crc_framework-0.2.4}/python/crc_framework/distributions/tabulated.py +0 -0
- {crc_framework-0.2.1 → crc_framework-0.2.4}/python/crc_framework/metrics/__init__.py +0 -0
- {crc_framework-0.2.1 → crc_framework-0.2.4}/python/crc_framework/metrics/distribution.py +0 -0
- {crc_framework-0.2.1 → crc_framework-0.2.4}/python/crc_framework/metrics/microscores.py +0 -0
- {crc_framework-0.2.1 → crc_framework-0.2.4}/python/crc_framework/metrics/risk.py +0 -0
- {crc_framework-0.2.1 → crc_framework-0.2.4}/python/crc_framework/metrics/spanning.py +0 -0
- {crc_framework-0.2.1 → crc_framework-0.2.4}/python/crc_framework/models.py +0 -0
- {crc_framework-0.2.1 → crc_framework-0.2.4}/python/crc_framework/py.typed +0 -0
- {crc_framework-0.2.1 → crc_framework-0.2.4}/python/crc_framework/spatial.py +0 -0
- {crc_framework-0.2.1 → crc_framework-0.2.4}/python/crc_framework/transforms/__init__.py +0 -0
- {crc_framework-0.2.1 → crc_framework-0.2.4}/python/crc_framework/transforms/base.py +0 -0
- {crc_framework-0.2.1 → crc_framework-0.2.4}/python/crc_framework/transforms/builtin.py +0 -0
- {crc_framework-0.2.1 → crc_framework-0.2.4}/python/crc_framework/transforms/climate.py +0 -0
- {crc_framework-0.2.1 → crc_framework-0.2.4}/src/lib.rs +0 -0
- {crc_framework-0.2.1 → crc_framework-0.2.4}/tests/test_impacts.py +0 -0
- {crc_framework-0.2.1 → crc_framework-0.2.4}/tests/test_sdk.py +0 -0
- {crc_framework-0.2.1 → crc_framework-0.2.4}/tests/typing_smoke.py +0 -0
|
@@ -69,7 +69,6 @@ jobs:
|
|
|
69
69
|
3.11
|
|
70
70
|
3.12
|
|
71
71
|
3.13
|
|
72
|
-
3.13t
|
|
73
72
|
3.14
|
|
74
73
|
3.14t
|
|
75
74
|
- name: Build wheels
|
|
@@ -79,12 +78,11 @@ jobs:
|
|
|
79
78
|
with:
|
|
80
79
|
target: ${{ matrix.target }}
|
|
81
80
|
args: >-
|
|
82
|
-
--release
|
|
83
|
-
--out dist
|
|
81
|
+
--release
|
|
82
|
+
--out dist
|
|
84
83
|
--find-interpreter
|
|
85
84
|
sccache: "true"
|
|
86
85
|
container: "off"
|
|
87
|
-
rust-toolchain: nightly-2026-01-27
|
|
88
86
|
- name: Upload wheels
|
|
89
87
|
uses: actions/upload-artifact@v4
|
|
90
88
|
with:
|
|
@@ -102,7 +100,6 @@ jobs:
|
|
|
102
100
|
with:
|
|
103
101
|
command: sdist
|
|
104
102
|
args: --out dist
|
|
105
|
-
rust-toolchain: nightly-2026-01-27
|
|
106
103
|
- name: Upload sdist
|
|
107
104
|
uses: actions/upload-artifact@v4
|
|
108
105
|
with:
|
|
@@ -15,12 +15,6 @@ dependencies = [
|
|
|
15
15
|
"zerocopy",
|
|
16
16
|
]
|
|
17
17
|
|
|
18
|
-
[[package]]
|
|
19
|
-
name = "autocfg"
|
|
20
|
-
version = "1.5.1"
|
|
21
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
22
|
-
checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53"
|
|
23
|
-
|
|
24
18
|
[[package]]
|
|
25
19
|
name = "cfg-if"
|
|
26
20
|
version = "1.0.4"
|
|
@@ -49,7 +43,7 @@ dependencies = [
|
|
|
49
43
|
|
|
50
44
|
[[package]]
|
|
51
45
|
name = "crc-framework-core"
|
|
52
|
-
version = "0.2.
|
|
46
|
+
version = "0.2.4"
|
|
53
47
|
dependencies = [
|
|
54
48
|
"h3o",
|
|
55
49
|
"phf",
|
|
@@ -58,7 +52,7 @@ dependencies = [
|
|
|
58
52
|
|
|
59
53
|
[[package]]
|
|
60
54
|
name = "crc-framework-rs"
|
|
61
|
-
version = "0.2.
|
|
55
|
+
version = "0.2.4"
|
|
62
56
|
dependencies = [
|
|
63
57
|
"crc-framework-core",
|
|
64
58
|
"h3o",
|
|
@@ -137,15 +131,6 @@ version = "0.5.0"
|
|
|
137
131
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
138
132
|
checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
|
|
139
133
|
|
|
140
|
-
[[package]]
|
|
141
|
-
name = "indoc"
|
|
142
|
-
version = "2.0.7"
|
|
143
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
144
|
-
checksum = "79cf5c93f93228cf8efb3ba362535fb11199ac548a09ce117c9b1adc3030d706"
|
|
145
|
-
dependencies = [
|
|
146
|
-
"rustversion",
|
|
147
|
-
]
|
|
148
|
-
|
|
149
134
|
[[package]]
|
|
150
135
|
name = "libc"
|
|
151
136
|
version = "0.2.188"
|
|
@@ -158,15 +143,6 @@ version = "0.2.16"
|
|
|
158
143
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
159
144
|
checksum = "b6d2cec3eae94f9f509c767b45932f1ada8350c4bdb85af2fcab4a3c14807981"
|
|
160
145
|
|
|
161
|
-
[[package]]
|
|
162
|
-
name = "memoffset"
|
|
163
|
-
version = "0.9.1"
|
|
164
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
165
|
-
checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a"
|
|
166
|
-
dependencies = [
|
|
167
|
-
"autocfg",
|
|
168
|
-
]
|
|
169
|
-
|
|
170
146
|
[[package]]
|
|
171
147
|
name = "once_cell"
|
|
172
148
|
version = "1.21.4"
|
|
@@ -242,35 +218,32 @@ dependencies = [
|
|
|
242
218
|
|
|
243
219
|
[[package]]
|
|
244
220
|
name = "pyo3"
|
|
245
|
-
version = "0.
|
|
221
|
+
version = "0.29.0"
|
|
246
222
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
247
|
-
checksum = "
|
|
223
|
+
checksum = "cd274650b21d4bfc26a0a47587962c1edb425f69287324355cd040c3ea66071c"
|
|
248
224
|
dependencies = [
|
|
249
|
-
"indoc",
|
|
250
225
|
"libc",
|
|
251
|
-
"memoffset",
|
|
252
226
|
"once_cell",
|
|
253
227
|
"portable-atomic",
|
|
254
228
|
"pyo3-build-config",
|
|
255
229
|
"pyo3-ffi",
|
|
256
230
|
"pyo3-macros",
|
|
257
|
-
"unindent",
|
|
258
231
|
]
|
|
259
232
|
|
|
260
233
|
[[package]]
|
|
261
234
|
name = "pyo3-build-config"
|
|
262
|
-
version = "0.
|
|
235
|
+
version = "0.29.0"
|
|
263
236
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
264
|
-
checksum = "
|
|
237
|
+
checksum = "c5e2a7d2f0d013342f295c048ad19237add5154a55b1c5a254c0ec93d4109078"
|
|
265
238
|
dependencies = [
|
|
266
239
|
"target-lexicon",
|
|
267
240
|
]
|
|
268
241
|
|
|
269
242
|
[[package]]
|
|
270
243
|
name = "pyo3-ffi"
|
|
271
|
-
version = "0.
|
|
244
|
+
version = "0.29.0"
|
|
272
245
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
273
|
-
checksum = "
|
|
246
|
+
checksum = "ca85c467da1bbc8d866eea5deff9cf29ea5f7785054a17da36e65bda9c05845b"
|
|
274
247
|
dependencies = [
|
|
275
248
|
"libc",
|
|
276
249
|
"pyo3-build-config",
|
|
@@ -278,9 +251,9 @@ dependencies = [
|
|
|
278
251
|
|
|
279
252
|
[[package]]
|
|
280
253
|
name = "pyo3-macros"
|
|
281
|
-
version = "0.
|
|
254
|
+
version = "0.29.0"
|
|
282
255
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
283
|
-
checksum = "
|
|
256
|
+
checksum = "9ac53762fd065daa3194dd09337a38bd793a188100fd1a9304c4ab312d901771"
|
|
284
257
|
dependencies = [
|
|
285
258
|
"proc-macro2",
|
|
286
259
|
"pyo3-macros-backend",
|
|
@@ -290,13 +263,12 @@ dependencies = [
|
|
|
290
263
|
|
|
291
264
|
[[package]]
|
|
292
265
|
name = "pyo3-macros-backend"
|
|
293
|
-
version = "0.
|
|
266
|
+
version = "0.29.0"
|
|
294
267
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
295
|
-
checksum = "
|
|
268
|
+
checksum = "4ca3a1557399783172dc5bf39cfca835157732532cba56b71d2292161e53b362"
|
|
296
269
|
dependencies = [
|
|
297
270
|
"heck",
|
|
298
271
|
"proc-macro2",
|
|
299
|
-
"pyo3-build-config",
|
|
300
272
|
"quote",
|
|
301
273
|
"syn 2.0.119",
|
|
302
274
|
]
|
|
@@ -345,12 +317,6 @@ dependencies = [
|
|
|
345
317
|
"getrandom 0.3.4",
|
|
346
318
|
]
|
|
347
319
|
|
|
348
|
-
[[package]]
|
|
349
|
-
name = "rustversion"
|
|
350
|
-
version = "1.0.23"
|
|
351
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
352
|
-
checksum = "cf54715a573b99ac80df0bc206da022bcd442c974952c7b9720069370852e21f"
|
|
353
|
-
|
|
354
320
|
[[package]]
|
|
355
321
|
name = "serde"
|
|
356
322
|
version = "1.0.229"
|
|
@@ -429,12 +395,6 @@ version = "1.0.24"
|
|
|
429
395
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
430
396
|
checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75"
|
|
431
397
|
|
|
432
|
-
[[package]]
|
|
433
|
-
name = "unindent"
|
|
434
|
-
version = "0.2.4"
|
|
435
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
436
|
-
checksum = "7264e107f553ccae879d21fbea1d6724ac785e8c3bfc762137959b5802826ef3"
|
|
437
|
-
|
|
438
398
|
[[package]]
|
|
439
399
|
name = "version_check"
|
|
440
400
|
version = "0.9.5"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[package]
|
|
2
2
|
name = "crc-framework-rs"
|
|
3
|
-
version = "0.2.
|
|
3
|
+
version = "0.2.4"
|
|
4
4
|
edition = "2024"
|
|
5
5
|
rust-version = "1.85"
|
|
6
6
|
description = "Rust-powered Python bindings for the Climate Risk Commons Framework"
|
|
@@ -18,4 +18,4 @@ crate-type = ["cdylib"]
|
|
|
18
18
|
[dependencies]
|
|
19
19
|
crc-framework-core = { path = "crates/core" }
|
|
20
20
|
h3o = "=0.9.3"
|
|
21
|
-
pyo3 = { version = "0.
|
|
21
|
+
pyo3 = { version = "0.29", features = ["extension-module"] }
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: crc-framework
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.4
|
|
4
4
|
Classifier: Development Status :: 3 - Alpha
|
|
5
5
|
Classifier: License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)
|
|
6
6
|
Classifier: Operating System :: OS Independent
|
|
@@ -20,6 +20,9 @@ Author: Riskthinking.AI
|
|
|
20
20
|
License-Expression: AGPL-3.0-or-later
|
|
21
21
|
Requires-Python: >=3.9
|
|
22
22
|
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
|
|
23
|
+
Project-URL: Homepage, https://github.com/RiskThinking/crc-framework-rs
|
|
24
|
+
Project-URL: Issues, https://github.com/RiskThinking/crc-framework-rs/issues
|
|
25
|
+
Project-URL: Repository, https://github.com/RiskThinking/crc-framework-rs
|
|
23
26
|
|
|
24
27
|
# Climate Risk Commons Framework
|
|
25
28
|
|
|
@@ -469,6 +469,17 @@ where
|
|
|
469
469
|
let mut values: Vec<f64> = simplex.iter().map(|point| objective(point)).collect();
|
|
470
470
|
let mut evaluations = values.len();
|
|
471
471
|
|
|
472
|
+
// Multi-start callers (e.g. GenExtreme's 5 shape starts) run this to
|
|
473
|
+
// completion for every start even when a start is clearly not
|
|
474
|
+
// converging. Nelder-Mead's improvement curve is front-loaded, so a
|
|
475
|
+
// start that hasn't beaten its best objective in STALL_LIMIT iterations
|
|
476
|
+
// is treated the same as one that exhausted max_iterations: it returns
|
|
477
|
+
// early as not-converged, which the caller already ranks below any
|
|
478
|
+
// converged candidate.
|
|
479
|
+
const STALL_LIMIT: usize = 300;
|
|
480
|
+
let mut best_seen = f64::INFINITY;
|
|
481
|
+
let mut stall_count = 0usize;
|
|
482
|
+
|
|
472
483
|
for iteration in 0..max_iterations {
|
|
473
484
|
let mut order: Vec<usize> = (0..simplex.len()).collect();
|
|
474
485
|
order.sort_by(|&left, &right| values[left].total_cmp(&values[right]));
|
|
@@ -498,6 +509,22 @@ where
|
|
|
498
509
|
};
|
|
499
510
|
}
|
|
500
511
|
|
|
512
|
+
if values[best] < best_seen - objective_tolerance {
|
|
513
|
+
best_seen = values[best];
|
|
514
|
+
stall_count = 0;
|
|
515
|
+
} else {
|
|
516
|
+
stall_count += 1;
|
|
517
|
+
if stall_count >= STALL_LIMIT {
|
|
518
|
+
return SimplexResult {
|
|
519
|
+
parameters: simplex[best].clone(),
|
|
520
|
+
objective: values[best],
|
|
521
|
+
converged: false,
|
|
522
|
+
iterations: iteration,
|
|
523
|
+
evaluations,
|
|
524
|
+
};
|
|
525
|
+
}
|
|
526
|
+
}
|
|
527
|
+
|
|
501
528
|
let mut centroid = vec![0.0; dimensions];
|
|
502
529
|
for &index in &order[..dimensions] {
|
|
503
530
|
for (dimension, value) in centroid.iter_mut().enumerate() {
|
|
@@ -28,6 +28,11 @@ classifiers = [
|
|
|
28
28
|
]
|
|
29
29
|
dynamic = ["version"]
|
|
30
30
|
|
|
31
|
+
[project.urls]
|
|
32
|
+
Homepage = "https://github.com/RiskThinking/crc-framework-rs"
|
|
33
|
+
Repository = "https://github.com/RiskThinking/crc-framework-rs"
|
|
34
|
+
Issues = "https://github.com/RiskThinking/crc-framework-rs/issues"
|
|
35
|
+
|
|
31
36
|
[project.optional-dependencies]
|
|
32
37
|
test = ["mypy", "pytest"]
|
|
33
38
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{crc_framework-0.2.1 → crc_framework-0.2.4}/crates/core/src/reference/climate/energy_params.rs
RENAMED
|
File without changes
|
{crc_framework-0.2.1 → crc_framework-0.2.4}/crates/core/src/reference/climate/flood_params.rs
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{crc_framework-0.2.1 → crc_framework-0.2.4}/crates/core/src/reference/climate/spei_params.rs
RENAMED
|
File without changes
|
{crc_framework-0.2.1 → crc_framework-0.2.4}/crates/core/src/reference/climate/wind_params.rs
RENAMED
|
File without changes
|
|
File without changes
|
{crc_framework-0.2.1 → crc_framework-0.2.4}/crates/core/src/reference/spatial/continent_r4.rs
RENAMED
|
File without changes
|
{crc_framework-0.2.1 → crc_framework-0.2.4}/crates/core/src/reference/spatial/geography_r5.rs
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{crc_framework-0.2.1 → crc_framework-0.2.4}/python/crc_framework/distributions/point_mass.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|