cpm-approx 0.1.0__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.
@@ -0,0 +1,12 @@
1
+ name: ci
2
+ on: [push, pull_request]
3
+ jobs:
4
+ test:
5
+ runs-on: ubuntu-latest
6
+ steps:
7
+ - uses: actions/checkout@v4
8
+ - uses: dtolnay/rust-toolchain@stable
9
+ with:
10
+ components: clippy
11
+ - run: cargo clippy --all-targets -- -D warnings
12
+ - run: cargo test --release
@@ -0,0 +1,43 @@
1
+ name: wheels
2
+ on:
3
+ workflow_dispatch:
4
+ push:
5
+ tags: ["v*"]
6
+ jobs:
7
+ build:
8
+ strategy:
9
+ fail-fast: false
10
+ matrix:
11
+ os: [ubuntu-latest, macos-latest, windows-latest]
12
+ runs-on: ${{ matrix.os }}
13
+ steps:
14
+ - uses: actions/checkout@v4
15
+ - uses: PyO3/maturin-action@v1
16
+ with:
17
+ command: build
18
+ args: --release --out dist
19
+ manylinux: auto
20
+ - uses: actions/setup-python@v5
21
+ with:
22
+ python-version: "3.12"
23
+ - name: Test the wheel
24
+ shell: bash
25
+ run: |
26
+ pip install pytest numpy dist/*.whl
27
+ pytest tests/python -q
28
+ - uses: actions/upload-artifact@v4
29
+ with:
30
+ name: wheels-${{ matrix.os }}
31
+ path: dist
32
+ sdist:
33
+ runs-on: ubuntu-latest
34
+ steps:
35
+ - uses: actions/checkout@v4
36
+ - uses: PyO3/maturin-action@v1
37
+ with:
38
+ command: sdist
39
+ args: --out dist
40
+ - uses: actions/upload-artifact@v4
41
+ with:
42
+ name: sdist
43
+ path: dist
@@ -0,0 +1,7 @@
1
+ /target/
2
+ Cargo.lock.bak
3
+ .venv/
4
+ __pycache__/
5
+ *.so
6
+ dist/
7
+ bindings/target/
@@ -0,0 +1,432 @@
1
+ # This file is automatically @generated by Cargo.
2
+ # It is not intended for manual editing.
3
+ version = 4
4
+
5
+ [[package]]
6
+ name = "approx"
7
+ version = "0.5.1"
8
+ source = "registry+https://github.com/rust-lang/crates.io-index"
9
+ checksum = "cab112f0a86d568ea0e627cc1d6be74a1e9cd55214684db5561995f6dad897c6"
10
+ dependencies = [
11
+ "num-traits",
12
+ ]
13
+
14
+ [[package]]
15
+ name = "autocfg"
16
+ version = "1.5.1"
17
+ source = "registry+https://github.com/rust-lang/crates.io-index"
18
+ checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53"
19
+
20
+ [[package]]
21
+ name = "bytemuck"
22
+ version = "1.25.2"
23
+ source = "registry+https://github.com/rust-lang/crates.io-index"
24
+ checksum = "95832e849adfb21180ccb6826a99da14e5d266ae5c2e668e1602cf234f153797"
25
+
26
+ [[package]]
27
+ name = "cfg-if"
28
+ version = "1.0.5"
29
+ source = "registry+https://github.com/rust-lang/crates.io-index"
30
+ checksum = "4e7648175b45a9a48536d676f68d918270699102aa8dab5496df06904c914600"
31
+
32
+ [[package]]
33
+ name = "chacha20"
34
+ version = "0.10.2"
35
+ source = "registry+https://github.com/rust-lang/crates.io-index"
36
+ checksum = "65c35e4b699c7e15ccbe7ee35c005e4fc0a278d22238a2857e6ce2dadeda1b06"
37
+ dependencies = [
38
+ "cfg-if",
39
+ "cpufeatures",
40
+ "rand_core",
41
+ ]
42
+
43
+ [[package]]
44
+ name = "cpufeatures"
45
+ version = "0.3.1"
46
+ source = "registry+https://github.com/rust-lang/crates.io-index"
47
+ checksum = "5ca28b0ae3115b884660db4118d803791fd6756b6e88f39c0f3f7859060d7566"
48
+ dependencies = [
49
+ "libc",
50
+ ]
51
+
52
+ [[package]]
53
+ name = "crossbeam-deque"
54
+ version = "0.8.8"
55
+ source = "registry+https://github.com/rust-lang/crates.io-index"
56
+ checksum = "622f3fc73690be383c7214310406f28a90e6edeadc3cea882f9d71e495b9711a"
57
+ dependencies = [
58
+ "crossbeam-epoch",
59
+ "crossbeam-utils",
60
+ ]
61
+
62
+ [[package]]
63
+ name = "crossbeam-epoch"
64
+ version = "0.9.21"
65
+ source = "registry+https://github.com/rust-lang/crates.io-index"
66
+ checksum = "dc74980687109a3b14c72fd458107bf0baa1da1a1a805e178d15501ba9b86d9d"
67
+ dependencies = [
68
+ "crossbeam-utils",
69
+ ]
70
+
71
+ [[package]]
72
+ name = "crossbeam-utils"
73
+ version = "0.8.23"
74
+ source = "registry+https://github.com/rust-lang/crates.io-index"
75
+ checksum = "a31eee39dddec8330830986fcd7625edb5a24ec90ea038215273bbc3adb08ac6"
76
+
77
+ [[package]]
78
+ name = "either"
79
+ version = "1.19.0"
80
+ source = "registry+https://github.com/rust-lang/crates.io-index"
81
+ checksum = "0e9c71c2167ca323c882b99918929403426e2373ea17242ff5653e0d5e1058be"
82
+
83
+ [[package]]
84
+ name = "getrandom"
85
+ version = "0.4.3"
86
+ source = "registry+https://github.com/rust-lang/crates.io-index"
87
+ checksum = "300e883d756b2e4ec94e02791f39b04b522276138852cfc41d9fb7e904106099"
88
+ dependencies = [
89
+ "cfg-if",
90
+ "libc",
91
+ "r-efi",
92
+ ]
93
+
94
+ [[package]]
95
+ name = "glam"
96
+ version = "0.30.10"
97
+ source = "registry+https://github.com/rust-lang/crates.io-index"
98
+ checksum = "19fc433e8437a212d1b6f1e68c7824af3aed907da60afa994e7f542d18d12aa9"
99
+
100
+ [[package]]
101
+ name = "glam"
102
+ version = "0.31.1"
103
+ source = "registry+https://github.com/rust-lang/crates.io-index"
104
+ checksum = "556f6b2ea90b8d15a74e0e7bb41671c9bdf38cd9f78c284d750b9ce58a2b5be7"
105
+
106
+ [[package]]
107
+ name = "glam"
108
+ version = "0.32.1"
109
+ source = "registry+https://github.com/rust-lang/crates.io-index"
110
+ checksum = "f70749695b063ecbf6b62949ccccde2e733ec3ecbbd71d467dca4e5c6c97cca0"
111
+
112
+ [[package]]
113
+ name = "glam"
114
+ version = "0.33.12"
115
+ source = "registry+https://github.com/rust-lang/crates.io-index"
116
+ checksum = "37bfe73dc8ec21f54d181e5a60554327ec3f1c600c455a75ccbfc65d2106a6c4"
117
+
118
+ [[package]]
119
+ name = "itoa"
120
+ version = "1.0.19"
121
+ source = "registry+https://github.com/rust-lang/crates.io-index"
122
+ checksum = "3bd1574e617a9a6c1f8f8181bd7e841e1f20e4277607ef28945765188d6284d4"
123
+
124
+ [[package]]
125
+ name = "libc"
126
+ version = "0.2.191"
127
+ source = "registry+https://github.com/rust-lang/crates.io-index"
128
+ checksum = "65cd87c9a6d60536580b316ad985726104730a5151c99845f2490428ef91240a"
129
+
130
+ [[package]]
131
+ name = "libm"
132
+ version = "0.2.16"
133
+ source = "registry+https://github.com/rust-lang/crates.io-index"
134
+ checksum = "b6d2cec3eae94f9f509c767b45932f1ada8350c4bdb85af2fcab4a3c14807981"
135
+
136
+ [[package]]
137
+ name = "matrixmultiply"
138
+ version = "0.3.11"
139
+ source = "registry+https://github.com/rust-lang/crates.io-index"
140
+ checksum = "3f607c237553f086e7043417a51df26b2eb899d3caff94e6a67592ff992fedc7"
141
+ dependencies = [
142
+ "autocfg",
143
+ "rawpointer",
144
+ ]
145
+
146
+ [[package]]
147
+ name = "memchr"
148
+ version = "2.8.3"
149
+ source = "registry+https://github.com/rust-lang/crates.io-index"
150
+ checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98"
151
+
152
+ [[package]]
153
+ name = "nalgebra"
154
+ version = "0.35.0"
155
+ source = "registry+https://github.com/rust-lang/crates.io-index"
156
+ checksum = "adc43a60c217b0c6ff46e47f26911015ad8d2e5a8be1af668c67e370d99a4346"
157
+ dependencies = [
158
+ "approx",
159
+ "glam 0.30.10",
160
+ "glam 0.31.1",
161
+ "glam 0.32.1",
162
+ "glam 0.33.12",
163
+ "matrixmultiply",
164
+ "num-complex",
165
+ "num-rational",
166
+ "num-traits",
167
+ "rand",
168
+ "simba",
169
+ "typenum",
170
+ ]
171
+
172
+ [[package]]
173
+ name = "num-bigint"
174
+ version = "0.4.8"
175
+ source = "registry+https://github.com/rust-lang/crates.io-index"
176
+ checksum = "c89e69e7e0f03bea5ef08013795c25018e101932225a656383bd384495ecc367"
177
+ dependencies = [
178
+ "num-integer",
179
+ "num-traits",
180
+ ]
181
+
182
+ [[package]]
183
+ name = "num-complex"
184
+ version = "0.4.6"
185
+ source = "registry+https://github.com/rust-lang/crates.io-index"
186
+ checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495"
187
+ dependencies = [
188
+ "num-traits",
189
+ ]
190
+
191
+ [[package]]
192
+ name = "num-integer"
193
+ version = "0.1.47"
194
+ source = "registry+https://github.com/rust-lang/crates.io-index"
195
+ checksum = "7ce2d95d4b3734dc35aa2f45e1aa22cd416814592a4f9d9205e11affd5b8e10b"
196
+ dependencies = [
197
+ "num-traits",
198
+ ]
199
+
200
+ [[package]]
201
+ name = "num-rational"
202
+ version = "0.4.2"
203
+ source = "registry+https://github.com/rust-lang/crates.io-index"
204
+ checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824"
205
+ dependencies = [
206
+ "num-bigint",
207
+ "num-integer",
208
+ "num-traits",
209
+ ]
210
+
211
+ [[package]]
212
+ name = "num-traits"
213
+ version = "0.2.19"
214
+ source = "registry+https://github.com/rust-lang/crates.io-index"
215
+ checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841"
216
+ dependencies = [
217
+ "autocfg",
218
+ "libm",
219
+ ]
220
+
221
+ [[package]]
222
+ name = "proc-macro2"
223
+ version = "1.0.107"
224
+ source = "registry+https://github.com/rust-lang/crates.io-index"
225
+ checksum = "985e7ec9bb745e6ce6535b544d84d6cd6f7ad8bd711c398938ae983b91a766d9"
226
+ dependencies = [
227
+ "unicode-ident",
228
+ ]
229
+
230
+ [[package]]
231
+ name = "cpm-approx"
232
+ version = "0.1.0"
233
+ dependencies = [
234
+ "rayon",
235
+ "serde",
236
+ "serde_json",
237
+ "statrs",
238
+ ]
239
+
240
+ [[package]]
241
+ name = "quote"
242
+ version = "1.0.47"
243
+ source = "registry+https://github.com/rust-lang/crates.io-index"
244
+ checksum = "1fbf4db142a473a8d80c26bbf18454ed458bf8d26c8219c331daecfdbd079001"
245
+ dependencies = [
246
+ "proc-macro2",
247
+ ]
248
+
249
+ [[package]]
250
+ name = "r-efi"
251
+ version = "6.0.0"
252
+ source = "registry+https://github.com/rust-lang/crates.io-index"
253
+ checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf"
254
+
255
+ [[package]]
256
+ name = "rand"
257
+ version = "0.10.3"
258
+ source = "registry+https://github.com/rust-lang/crates.io-index"
259
+ checksum = "65c9fb96cbc91e3478eaae79a69fcd3f1ae4ad052e471fe6732fff548984b4af"
260
+ dependencies = [
261
+ "chacha20",
262
+ "getrandom",
263
+ "rand_core",
264
+ ]
265
+
266
+ [[package]]
267
+ name = "rand_core"
268
+ version = "0.10.1"
269
+ source = "registry+https://github.com/rust-lang/crates.io-index"
270
+ checksum = "63b8176103e19a2643978565ca18b50549f6101881c443590420e4dc998a3c69"
271
+
272
+ [[package]]
273
+ name = "rawpointer"
274
+ version = "0.2.1"
275
+ source = "registry+https://github.com/rust-lang/crates.io-index"
276
+ checksum = "60a357793950651c4ed0f3f52338f53b2f809f32d83a07f72909fa13e4c6c1e3"
277
+
278
+ [[package]]
279
+ name = "rayon"
280
+ version = "1.12.0"
281
+ source = "registry+https://github.com/rust-lang/crates.io-index"
282
+ checksum = "fb39b166781f92d482534ef4b4b1b2568f42613b53e5b6c160e24cfbfa30926d"
283
+ dependencies = [
284
+ "either",
285
+ "rayon-core",
286
+ ]
287
+
288
+ [[package]]
289
+ name = "rayon-core"
290
+ version = "1.13.0"
291
+ source = "registry+https://github.com/rust-lang/crates.io-index"
292
+ checksum = "22e18b0f0062d30d4230b2e85ff77fdfe4326feb054b9783a3460d8435c8ab91"
293
+ dependencies = [
294
+ "crossbeam-deque",
295
+ "crossbeam-utils",
296
+ ]
297
+
298
+ [[package]]
299
+ name = "safe_arch"
300
+ version = "1.2.0"
301
+ source = "registry+https://github.com/rust-lang/crates.io-index"
302
+ checksum = "42c6efa15875e6ecb39ca61fb0b0c1a40b84fac5a5ffe71eef7d1000c8eb3f5f"
303
+ dependencies = [
304
+ "bytemuck",
305
+ ]
306
+
307
+ [[package]]
308
+ name = "serde"
309
+ version = "1.0.229"
310
+ source = "registry+https://github.com/rust-lang/crates.io-index"
311
+ checksum = "4148590afebada386688f18773da617792bf2ef03ffc1e4cbd2b1d45b023e0ba"
312
+ dependencies = [
313
+ "serde_core",
314
+ "serde_derive",
315
+ ]
316
+
317
+ [[package]]
318
+ name = "serde_core"
319
+ version = "1.0.229"
320
+ source = "registry+https://github.com/rust-lang/crates.io-index"
321
+ checksum = "67dca2c9c51e58a4791a4b1ed58308b39c64224d349a935ab5039aa360942a48"
322
+ dependencies = [
323
+ "serde_derive",
324
+ ]
325
+
326
+ [[package]]
327
+ name = "serde_derive"
328
+ version = "1.0.229"
329
+ source = "registry+https://github.com/rust-lang/crates.io-index"
330
+ checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348"
331
+ dependencies = [
332
+ "proc-macro2",
333
+ "quote",
334
+ "syn",
335
+ ]
336
+
337
+ [[package]]
338
+ name = "serde_json"
339
+ version = "1.0.154"
340
+ source = "registry+https://github.com/rust-lang/crates.io-index"
341
+ checksum = "e7e9cc8b1b85264074fbcc02a88680c4096b1e47df8f739dceb03bf482f04bd6"
342
+ dependencies = [
343
+ "itoa",
344
+ "memchr",
345
+ "serde",
346
+ "serde_core",
347
+ "zmij",
348
+ ]
349
+
350
+ [[package]]
351
+ name = "simba"
352
+ version = "0.10.2"
353
+ source = "registry+https://github.com/rust-lang/crates.io-index"
354
+ checksum = "f1a7200d82ff1c7b4235efd12f11e2537a402c91cf83a5cb97ce80eef787fde7"
355
+ dependencies = [
356
+ "approx",
357
+ "num-complex",
358
+ "num-traits",
359
+ "wide",
360
+ ]
361
+
362
+ [[package]]
363
+ name = "statrs"
364
+ version = "0.19.1"
365
+ source = "registry+https://github.com/rust-lang/crates.io-index"
366
+ checksum = "c1837f9a1bd13dabbdbb04489c39451482d3cdd35a6e1a0d0f3570dea2b8c8be"
367
+ dependencies = [
368
+ "approx",
369
+ "nalgebra",
370
+ "num-traits",
371
+ "rand",
372
+ "thiserror",
373
+ ]
374
+
375
+ [[package]]
376
+ name = "syn"
377
+ version = "3.0.10"
378
+ source = "registry+https://github.com/rust-lang/crates.io-index"
379
+ checksum = "4ae9ccbea3a7b0b09443036490c8f34a8b1b760fd345e5c0dae0aac718faea79"
380
+ dependencies = [
381
+ "proc-macro2",
382
+ "quote",
383
+ "unicode-ident",
384
+ ]
385
+
386
+ [[package]]
387
+ name = "thiserror"
388
+ version = "2.0.21"
389
+ source = "registry+https://github.com/rust-lang/crates.io-index"
390
+ checksum = "09e52cb86a36cede5cb101bf8908837b3e4c6e5e59fe7fd85c23fb56200d189e"
391
+ dependencies = [
392
+ "thiserror-impl",
393
+ ]
394
+
395
+ [[package]]
396
+ name = "thiserror-impl"
397
+ version = "2.0.21"
398
+ source = "registry+https://github.com/rust-lang/crates.io-index"
399
+ checksum = "fe5197923287db20a58125f0bc85c062f7f2c892de97b18c356f9efb14b28524"
400
+ dependencies = [
401
+ "proc-macro2",
402
+ "quote",
403
+ "syn",
404
+ ]
405
+
406
+ [[package]]
407
+ name = "typenum"
408
+ version = "1.20.1"
409
+ source = "registry+https://github.com/rust-lang/crates.io-index"
410
+ checksum = "b6f5e870be6c3b371b77fe0ee0bafb859fa4964b4404c27de1d380043c4dda20"
411
+
412
+ [[package]]
413
+ name = "unicode-ident"
414
+ version = "1.0.27"
415
+ source = "registry+https://github.com/rust-lang/crates.io-index"
416
+ checksum = "a2c754d6c33795a1c324727428e5a7dedb5b06195f9890bdbcba760d3e246563"
417
+
418
+ [[package]]
419
+ name = "wide"
420
+ version = "1.7.1"
421
+ source = "registry+https://github.com/rust-lang/crates.io-index"
422
+ checksum = "d920ac99c3c8edce110cb8d07dbb324d6d026011dce85b1e9355b70f0adacc4f"
423
+ dependencies = [
424
+ "bytemuck",
425
+ "safe_arch",
426
+ ]
427
+
428
+ [[package]]
429
+ name = "zmij"
430
+ version = "1.0.23"
431
+ source = "registry+https://github.com/rust-lang/crates.io-index"
432
+ checksum = "29666d0abbfad1e3dc4dcf6144730dd3a3ab225bbbdac83319345b1b44ccfc1b"
@@ -0,0 +1,24 @@
1
+ [package]
2
+ name = "cpm-approx"
3
+ version = "0.1.0"
4
+ edition = "2021"
5
+ description = "Analytical VaR and expected shortfall of credit portfolios in the multi-factor Merton model (multi-factor adjustment, Risk 2004)"
6
+ license = "MIT"
7
+ repository = "https://github.com/Dronakurl/cpm-approx"
8
+ readme = "README.md"
9
+ keywords = ["credit-risk", "value-at-risk", "expected-shortfall", "merton", "portfolio"]
10
+ categories = ["mathematics", "finance"]
11
+
12
+ [lib]
13
+ name = "cpm_approx"
14
+ path = "src/lib.rs"
15
+
16
+ [[bin]]
17
+ name = "cpm-approx"
18
+ path = "src/main.rs"
19
+
20
+ [dependencies]
21
+ rayon = "1"
22
+ serde = { version = "1", features = ["derive"] }
23
+ serde_json = "1"
24
+ statrs = "0.19"
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Dronakurl
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.