diff --git a/Cargo.lock b/Cargo.lock index 77c291e5..5192b752 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3,10 +3,10 @@ version = 3 [[package]] -name = "adler" -version = "1.0.2" +name = "adler2" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" +checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" [[package]] name = "aho-corasick" @@ -71,6 +71,15 @@ version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca" +[[package]] +name = "arbitrary" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3d036a3c4ab069c7b410a2ce876bd74808d2d0888a82667669f8e783a898bf1" +dependencies = [ + "derive_arbitrary", +] + [[package]] name = "arrayvec" version = "0.7.4" @@ -107,6 +116,24 @@ dependencies = [ "tempfile", ] +[[package]] +name = "async-compression" +version = "0.4.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d10e4f991a553474232bc0a31799f6d24b034a84c0971d80d2e2f78b2e576e40" +dependencies = [ + "compression-codecs", + "compression-core", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "atomic-waker" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" + [[package]] name = "autocfg" version = "1.1.0" @@ -163,12 +190,24 @@ dependencies = [ "serde", ] +[[package]] +name = "bumpalo" +version = "3.19.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5dd9dc738b7a8311c7ade152424974d8115f2cdad61e8dab8dac9f2362298510" + [[package]] name = "byteorder" version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" +[[package]] +name = "bytes" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b35204fbdc0b3f4446b89fc1ac2cf84a8a68971995d0bf2e925ec7cd960f9cb3" + [[package]] name = "cc" version = "1.2.16" @@ -184,6 +223,12 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "cfg_aliases" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" + [[package]] name = "clap" version = "4.5.38" @@ -241,7 +286,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e" dependencies = [ "termcolor", - "unicode-width", + "unicode-width 0.1.11", ] [[package]] @@ -250,6 +295,36 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" +[[package]] +name = "compression-codecs" +version = "0.4.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00828ba6fd27b45a448e57dbfe84f1029d4c9f26b368157e9a448a5f49a2ec2a" +dependencies = [ + "compression-core", + "flate2", + "memchr", +] + +[[package]] +name = "compression-core" +version = "0.4.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75984efb6ed102a0d42db99afb6c1948f0380d1d91808d5529916e6c08b49d8d" + +[[package]] +name = "console" +version = "0.15.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "054ccb5b10f9f2cbf51eb355ca1d05c2d279ce1804688d0db74b4733a5aeafd8" +dependencies = [ + "encode_unicode", + "libc", + "once_cell", + "unicode-width 0.2.2", + "windows-sys 0.59.0", +] + [[package]] name = "cpufeatures" version = "0.2.12" @@ -261,9 +336,9 @@ dependencies = [ [[package]] name = "crc32fast" -version = "1.3.2" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" +checksum = "9481c1c90cbf2ac953f07c8d4a58aa3945c425b7185c9154d67a65e4230da511" dependencies = [ "cfg-if", ] @@ -289,9 +364,9 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.19" +version = "0.8.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" +checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" [[package]] name = "crypto-common" @@ -347,6 +422,17 @@ dependencies = [ "syn", ] +[[package]] +name = "derive_arbitrary" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e567bd82dcff979e4b03460c307b3cdc9e96fde3d73bed1496d2bc75d9dd62a" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "difflib" version = "0.4.0" @@ -405,12 +491,29 @@ dependencies = [ "winapi", ] +[[package]] +name = "displaydoc" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "doc-comment" version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10" +[[package]] +name = "dyn-clone" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0881ea181b1df73ff77ffaaf9c7544ecc11e82fba9b5f27b262a3c73a332555" + [[package]] name = "either" version = "1.9.0" @@ -446,19 +549,19 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.8" +version = "0.3.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" +checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys 0.61.2", ] [[package]] name = "fastrand" -version = "2.0.1" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" +checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" [[package]] name = "filetime" @@ -474,9 +577,9 @@ dependencies = [ [[package]] name = "flate2" -version = "1.0.28" +version = "1.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" +checksum = "b375d6465b98090a5f25b1c7703f3859783755aa9a80433b36e0379a3ec2f369" dependencies = [ "crc32fast", "miniz_oxide", @@ -510,6 +613,68 @@ dependencies = [ "winapi", ] +[[package]] +name = "futures-channel" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" + +[[package]] +name = "futures-io" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" + +[[package]] +name = "futures-macro" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "futures-sink" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" + +[[package]] +name = "futures-task" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" + +[[package]] +name = "futures-util" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" +dependencies = [ + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "pin-utils", + "slab", +] + [[package]] name = "generic-array" version = "0.14.7" @@ -527,8 +692,24 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" dependencies = [ "cfg-if", + "js-sys", "libc", "wasi", + "wasm-bindgen", +] + +[[package]] +name = "getrandom" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd" +dependencies = [ + "cfg-if", + "js-sys", + "libc", + "r-efi", + "wasip2", + "wasm-bindgen", ] [[package]] @@ -593,6 +774,107 @@ version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5d3d0e0f38255e7fa3cf31335b3a56f05febd18025f4db5ef7a0cfb4f8da651f" +[[package]] +name = "http" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3ba2a386d7f85a81f119ad7498ebe444d2e22c2af0b86b069416ace48b3311a" +dependencies = [ + "bytes", + "itoa", +] + +[[package]] +name = "http-body" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" +dependencies = [ + "bytes", + "http", +] + +[[package]] +name = "http-body-util" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b021d93e26becf5dc7e1b75b1bed1fd93124b374ceb73f43d4d4eafec896a64a" +dependencies = [ + "bytes", + "futures-core", + "http", + "http-body", + "pin-project-lite", +] + +[[package]] +name = "httparse" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" + +[[package]] +name = "hyper" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ab2d4f250c3d7b1c9fcdff1cece94ea4e2dfbec68614f7b87cb205f24ca9d11" +dependencies = [ + "atomic-waker", + "bytes", + "futures-channel", + "futures-core", + "http", + "http-body", + "httparse", + "itoa", + "pin-project-lite", + "pin-utils", + "smallvec", + "tokio", + "want", +] + +[[package]] +name = "hyper-rustls" +version = "0.27.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3c93eb611681b207e1fe55d5a71ecf91572ec8a6705cdb6857f7d8d5242cf58" +dependencies = [ + "http", + "hyper", + "hyper-util", + "rustls", + "rustls-pki-types", + "tokio", + "tokio-rustls", + "tower-service", + "webpki-roots 1.0.5", +] + +[[package]] +name = "hyper-util" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "727805d60e7938b76b826a6ef209eb70eaa1812794f9424d4a4e2d740662df5f" +dependencies = [ + "base64", + "bytes", + "futures-channel", + "futures-core", + "futures-util", + "http", + "http-body", + "hyper", + "ipnet", + "libc", + "percent-encoding", + "pin-project-lite", + "socket2", + "tokio", + "tower-service", + "tracing", +] + [[package]] name = "idna" version = "1.0.3" @@ -636,12 +918,41 @@ dependencies = [ "hashbrown", ] +[[package]] +name = "indicatif" +version = "0.17.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "183b3088984b400f4cfac3620d5e076c84da5364016b4f49473de574b2586235" +dependencies = [ + "console", + "number_prefix", + "portable-atomic", + "unicode-width 0.2.2", + "web-time", +] + [[package]] name = "indoc" version = "2.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e186cfbae8084e513daff4240b4797e342f988cecda4fb6c939150f96315fd8" +[[package]] +name = "ipnet" +version = "2.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "469fb0b9cefa57e3ef31275ee7cacb78f2fdca44e4765491884a2b119d4eb130" + +[[package]] +name = "iri-string" +version = "0.7.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c91338f0783edbd6195decb37bae672fd3b165faffb89bf7b9e6942f8b1a731a" +dependencies = [ + "memchr", + "serde", +] + [[package]] name = "is-terminal" version = "0.4.10" @@ -649,7 +960,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0bad00257d07be169d870ab665980b06cdb366d792ad690bf2e76876dc503455" dependencies = [ "hermit-abi", - "rustix", + "rustix 0.38.30", "windows-sys 0.52.0", ] @@ -662,12 +973,31 @@ dependencies = [ "either", ] +[[package]] +name = "itertools" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" +dependencies = [ + "either", +] + [[package]] name = "itoa" version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" +[[package]] +name = "js-sys" +version = "0.3.85" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c942ebf8e95485ca0d52d97da7c5a2c387d0e7f0ba4c35e93bfcaee045955b3" +dependencies = [ + "once_cell", + "wasm-bindgen", +] + [[package]] name = "lazy_static" version = "1.4.0" @@ -676,9 +1006,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.170" +version = "0.2.180" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "875b3680cb2f8f71bdcf9a30f38d48282f5d3c95cbf9b3fa57269bb5d5c06828" +checksum = "bcc35a38544a891a5f7c865aca548a982ccb3b8650a5b06d0fd33a10283c56fc" [[package]] name = "libredox" @@ -706,19 +1036,40 @@ version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" +[[package]] +name = "linux-raw-sys" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df1d3c3b53da64cf5760482273a98e575c651a67eec7f77df96b5b642de8f039" + [[package]] name = "log" version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" +[[package]] +name = "lru-slab" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "112b39cec0b298b6c1999fee3e31427f74f676e4cb9879ed1a121b43661a4154" + [[package]] name = "lz4_flex" version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1a8cbbb2831780bc3b9c15a41f5b49222ef756b6730a95f3decfdd15903eb5a3" dependencies = [ - "twox-hash", + "twox-hash 1.6.3", +] + +[[package]] +name = "lz4_flex" +version = "0.11.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08ab2867e3eeeca90e844d1940eab391c9dc5228783db2ed999acbc0a9ed375a" +dependencies = [ + "twox-hash 2.1.2", ] [[package]] @@ -736,7 +1087,7 @@ dependencies = [ "pkg-config", "serde", "tar", - "thiserror", + "thiserror 1.0.69", "toml", "ureq", ] @@ -768,11 +1119,23 @@ dependencies = [ [[package]] name = "miniz_oxide" -version = "0.7.1" +version = "0.8.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316" +dependencies = [ + "adler2", + "simd-adler32", +] + +[[package]] +name = "mio" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +checksum = "a69bcab0ad47271a0234d9422b131806bf3968021e5dc9328caf2d4cd58557fc" dependencies = [ - "adler", + "libc", + "wasi", + "windows-sys 0.61.2", ] [[package]] @@ -789,19 +1152,97 @@ dependencies = [ "serde", ] +[[package]] +name = "ndarray" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "882ed72dce9365842bf196bdeedf5055305f11fc8c03dee7bb0194a6cad34841" +dependencies = [ + "matrixmultiply", + "num-complex", + "num-integer", + "num-traits", + "portable-atomic", + "portable-atomic-util", + "rawpointer", + "serde", +] + [[package]] name = "ndarray-npy" -version = "0.8.1" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f85776816e34becd8bd9540818d7dc77bf28307f3b3dcc51cc82403c6931680c" +checksum = "7b313788c468c49141a9d9b6131fc15f403e6ef4e8446a0b2e18f664ddb278a9" dependencies = [ "byteorder", - "ndarray", + "ndarray 0.16.1", "num-traits", "py_literal", "zip", ] +[[package]] +name = "neopdf" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61b0aaca320ec52a7b70f90e14b5046b194db82fcdf59d0692e539aff111e816" +dependencies = [ + "bincode", + "flate2", + "git-version", + "indicatif", + "itertools 0.13.0", + "lz4_flex 0.11.5", + "ndarray 0.16.1", + "ninterp", + "rayon", + "regex", + "reqwest", + "serde", + "serde_yaml", + "tar", + "tempfile", + "thiserror 1.0.69", +] + +[[package]] +name = "neopdf" +version = "0.3.0-alpha2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c94df70e35a6e075fb87f8838d1c0810f8a55e6a4e76f72dab8feebd062350b" +dependencies = [ + "bincode", + "flate2", + "git-version", + "indicatif", + "itertools 0.13.0", + "lz4_flex 0.11.5", + "ndarray 0.16.1", + "neopdf 0.2.0", + "ninterp", + "rayon", + "regex", + "reqwest", + "serde", + "serde_yaml", + "tar", + "tempfile", + "thiserror 1.0.69", +] + +[[package]] +name = "ninterp" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b9a8917fb3e2ae0574a15c14f29d1855cb53f483edfde819bc218238830ca11" +dependencies = [ + "dyn-clone", + "itertools 0.13.0", + "ndarray 0.16.1", + "num-traits", + "thiserror 1.0.69", +] + [[package]] name = "num-bigint" version = "0.4.4" @@ -841,6 +1282,12 @@ dependencies = [ "autocfg", ] +[[package]] +name = "number_prefix" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3" + [[package]] name = "numpy" version = "0.26.0" @@ -848,7 +1295,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b2dba356160b54f5371b550575b78130a54718b4c6e46b3f33a6da74a27e78b" dependencies = [ "libc", - "ndarray", + "ndarray 0.16.1", "num-complex", "num-integer", "num-traits", @@ -882,7 +1329,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1f200d8d83c44a45b21764d1916299752ca035d15ecd46faca3e9a2a2bf6ad06" dependencies = [ "memchr", - "thiserror", + "thiserror 1.0.69", "ucd-trie", ] @@ -921,7 +1368,19 @@ dependencies = [ ] [[package]] -name = "pineappl" +name = "pin-project-lite" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "pineappl" version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5041fcf611eb0c41f1f6562b498fabdd1319c8d4572fd137ac244ca4e73d999c" @@ -933,12 +1392,12 @@ dependencies = [ "enum_dispatch", "float-cmp", "git-version", - "itertools", - "lz4_flex", - "ndarray", + "itertools 0.10.5", + "lz4_flex 0.9.5", + "ndarray 0.15.6", "rustc-hash 1.1.0", "serde", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -952,18 +1411,18 @@ dependencies = [ "enum_dispatch", "float-cmp", "git-version", - "itertools", - "lz4_flex", + "itertools 0.10.5", + "lz4_flex 0.9.5", "managed-lhapdf", - "ndarray", + "ndarray 0.16.1", "num-complex", "pineappl 0.8.3", - "rand", + "rand 0.8.5", "rand_pcg", "rayon", "rustc-hash 1.1.0", "serde", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -981,8 +1440,8 @@ dependencies = [ name = "pineappl_capi" version = "1.3.0" dependencies = [ - "itertools", - "ndarray", + "itertools 0.10.5", + "ndarray 0.16.1", "pineappl 1.3.0", ] @@ -1001,11 +1460,12 @@ dependencies = [ "flate2", "float-cmp", "git-version", - "itertools", - "lz4_flex", + "itertools 0.10.5", + "lz4_flex 0.9.5", "managed-lhapdf", - "ndarray", + "ndarray 0.16.1", "ndarray-npy", + "neopdf 0.3.0-alpha2", "pineappl 1.3.0", "pineappl_applgrid", "pineappl_fastnlo", @@ -1024,15 +1484,15 @@ dependencies = [ "cxx", "cxx-build", "pkg-config", - "thiserror", + "thiserror 1.0.69", ] [[package]] name = "pineappl_py" version = "1.3.0" dependencies = [ - "itertools", - "ndarray", + "itertools 0.10.5", + "ndarray 0.16.1", "numpy", "pineappl 1.3.0", "pyo3", @@ -1050,6 +1510,24 @@ version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7170ef9988bc169ba16dd36a7fa041e5c4cbeb6a35b76d4c03daded371eae7c0" +[[package]] +name = "portable-atomic-util" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8a2f0d8d040d7848a709caf78912debcc3f33ee4b3cac47d73d1e1069e83507" +dependencies = [ + "portable-atomic", +] + +[[package]] +name = "ppv-lite86" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" +dependencies = [ + "zerocopy", +] + [[package]] name = "predicates" version = "3.1.0" @@ -1087,14 +1565,14 @@ dependencies = [ "is-terminal", "lazy_static", "term", - "unicode-width", + "unicode-width 0.1.11", ] [[package]] name = "proc-macro2" -version = "1.0.88" +version = "1.0.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c3a7fc5db1e57d5a779a352c8cdb57b29aa4c40cc69c3a68a7fedc815fbf2f9" +checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934" dependencies = [ "unicode-ident", ] @@ -1173,6 +1651,61 @@ dependencies = [ "syn", ] +[[package]] +name = "quinn" +version = "0.11.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e20a958963c291dc322d98411f541009df2ced7b5a4f2bd52337638cfccf20" +dependencies = [ + "bytes", + "cfg_aliases", + "pin-project-lite", + "quinn-proto", + "quinn-udp", + "rustc-hash 2.1.1", + "rustls", + "socket2", + "thiserror 2.0.18", + "tokio", + "tracing", + "web-time", +] + +[[package]] +name = "quinn-proto" +version = "0.11.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1906b49b0c3bc04b5fe5d86a77925ae6524a19b816ae38ce1e426255f1d8a31" +dependencies = [ + "bytes", + "getrandom 0.3.4", + "lru-slab", + "rand 0.9.2", + "ring", + "rustc-hash 2.1.1", + "rustls", + "rustls-pki-types", + "slab", + "thiserror 2.0.18", + "tinyvec", + "tracing", + "web-time", +] + +[[package]] +name = "quinn-udp" +version = "0.5.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "addec6a0dcad8a8d96a771f815f0eaf55f9d1805756410b39f5fa81332574cbd" +dependencies = [ + "cfg_aliases", + "libc", + "once_cell", + "socket2", + "tracing", + "windows-sys 0.60.2", +] + [[package]] name = "quote" version = "1.0.35" @@ -1182,13 +1715,39 @@ dependencies = [ "proc-macro2", ] +[[package]] +name = "r-efi" +version = "5.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" + [[package]] name = "rand" version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ - "rand_core", + "rand_core 0.6.4", +] + +[[package]] +name = "rand" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6db2770f06117d490610c7488547d543617b21bfa07796d7a12f6f1bd53850d1" +dependencies = [ + "rand_chacha", + "rand_core 0.9.5", +] + +[[package]] +name = "rand_chacha" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" +dependencies = [ + "ppv-lite86", + "rand_core 0.9.5", ] [[package]] @@ -1197,13 +1756,22 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +[[package]] +name = "rand_core" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76afc826de14238e6e8c374ddcc1fa19e374fd8dd986b0d2af0d02377261d83c" +dependencies = [ + "getrandom 0.3.4", +] + [[package]] name = "rand_pcg" version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "59cad018caf63deb318e5a4586d99a24424a364f40f1e5778c29aca23f4fc73e" dependencies = [ - "rand_core", + "rand_core 0.6.4", ] [[package]] @@ -1247,16 +1815,28 @@ version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a18479200779601e498ada4e8c1e1f50e3ee19deb0259c25825a98b5603b2cb4" dependencies = [ - "getrandom", + "getrandom 0.2.12", "libredox", - "thiserror", + "thiserror 1.0.69", +] + +[[package]] +name = "regex" +version = "1.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "843bc0191f75f3e22651ae5f1e72939ab2f72a4bc30fa80a066bd66edefc24d4" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", ] [[package]] name = "regex-automata" -version = "0.4.5" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bb987efffd3c6d0d8f5f89510bb458559eab11e4f869acb20bf845e016259cd" +checksum = "5276caf25ac86c8d810222b3dbb938e512c55c6831a10f3e6ed1c93b84041f1c" dependencies = [ "aho-corasick", "memchr", @@ -1265,9 +1845,51 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.8.2" +version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" +checksum = "7a2d987857b319362043e95f5353c0535c1f58eec5336fdfcf626430af7def58" + +[[package]] +name = "reqwest" +version = "0.12.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eddd3ca559203180a307f12d114c268abf583f59b03cb906fd0b3ff8646c1147" +dependencies = [ + "base64", + "bytes", + "futures-channel", + "futures-core", + "futures-util", + "http", + "http-body", + "http-body-util", + "hyper", + "hyper-rustls", + "hyper-util", + "js-sys", + "log", + "percent-encoding", + "pin-project-lite", + "quinn", + "rustls", + "rustls-pki-types", + "serde", + "serde_json", + "serde_urlencoded", + "sync_wrapper", + "tokio", + "tokio-rustls", + "tokio-util", + "tower", + "tower-http", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "wasm-streams", + "web-sys", + "webpki-roots 1.0.5", +] [[package]] name = "ring" @@ -1277,7 +1899,7 @@ checksum = "70ac5d832aa16abd7d1def883a8545280c20a60f523a370aa3a9617c2b8550ee" dependencies = [ "cc", "cfg-if", - "getrandom", + "getrandom 0.2.12", "libc", "untrusted", "windows-sys 0.52.0", @@ -1310,15 +1932,28 @@ dependencies = [ "bitflags 2.4.2", "errno", "libc", - "linux-raw-sys", + "linux-raw-sys 0.4.13", "windows-sys 0.52.0", ] +[[package]] +name = "rustix" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "146c9e247ccc180c1f61615433868c99f3de3ae256a30a43b49f67c2d9171f34" +dependencies = [ + "bitflags 2.4.2", + "errno", + "libc", + "linux-raw-sys 0.11.0", + "windows-sys 0.61.2", +] + [[package]] name = "rustls" -version = "0.23.12" +version = "0.23.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c58f8c84392efc0a126acce10fa59ff7b3d2ac06ab451a33f2741989b806b044" +checksum = "c665f33d38cea657d9614f766881e4d510e0eda4239891eea56b4cadcf01801b" dependencies = [ "log", "once_cell", @@ -1331,15 +1966,19 @@ dependencies = [ [[package]] name = "rustls-pki-types" -version = "1.8.0" +version = "1.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc0a2ce646f8655401bb81e7927b812614bd5d91dbc968696be50603510fcaf0" +checksum = "be040f8b0a225e40375822a563fa9524378b9d63112f53e19ffff34df5d33fdd" +dependencies = [ + "web-time", + "zeroize", +] [[package]] name = "rustls-webpki" -version = "0.102.6" +version = "0.103.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e6b52d4fda176fd835fdc55a835d4a89b8499cad995885a21149d5ad62f852e" +checksum = "d7df23109aa6c1567d1c575b9952556388da57401e4ace1d15f79eedad0d8f53" dependencies = [ "ring", "rustls-pki-types", @@ -1393,6 +2032,18 @@ dependencies = [ "syn", ] +[[package]] +name = "serde_json" +version = "1.0.143" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d401abef1d108fbd9cbaebc3e46611f4b1021f714a0597a71f41ee463f5f4a5a" +dependencies = [ + "itoa", + "memchr", + "ryu", + "serde", +] + [[package]] name = "serde_spanned" version = "0.6.5" @@ -1402,6 +2053,18 @@ dependencies = [ "serde", ] +[[package]] +name = "serde_urlencoded" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +dependencies = [ + "form_urlencoded", + "itoa", + "ryu", + "serde", +] + [[package]] name = "serde_yaml" version = "0.9.30" @@ -1432,12 +2095,34 @@ version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" +[[package]] +name = "simd-adler32" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e320a6c5ad31d271ad523dcf3ad13e2767ad8b1cb8f047f75a8aeaf8da139da2" + +[[package]] +name = "slab" +version = "0.4.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a2ae44ef20feb57a68b23d846850f861394c2e02dc425a50098ae8c90267589" + [[package]] name = "smallvec" version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" +[[package]] +name = "socket2" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86f4aa3ad99f2088c990dfa82d367e19cb29268ed67c574d10d0a4bfe71f07e0" +dependencies = [ + "libc", + "windows-sys 0.60.2", +] + [[package]] name = "static_assertions" version = "1.1.0" @@ -1458,20 +2143,29 @@ checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" [[package]] name = "syn" -version = "2.0.82" +version = "2.0.114" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83540f837a8afc019423a8edb95b52a8effe46957ee402287f4292fae35be021" +checksum = "d4d107df263a3013ef9b1879b0df87d706ff80f65a86ea879bd9c31f9b307c2a" dependencies = [ "proc-macro2", "quote", "unicode-ident", ] +[[package]] +name = "sync_wrapper" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" +dependencies = [ + "futures-core", +] + [[package]] name = "tar" -version = "0.4.40" +version = "0.4.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b16afcea1f22891c49a00c751c7b63b2233284064f11a200fc624137c51e2ddb" +checksum = "1d863878d212c87a19c1a610eb53bb01fe12951c0501cf5a0d65f724914a667a" dependencies = [ "filetime", "libc", @@ -1486,15 +2180,15 @@ checksum = "e502f78cdbb8ba4718f566c418c52bc729126ffd16baee5baa718cf25dd5a69a" [[package]] name = "tempfile" -version = "3.9.0" +version = "3.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01ce4141aa927a6d1bd34a041795abd0db1cccba5d5f24b009f694bdf3a1f3fa" +checksum = "655da9c7eb6305c55742045d5a8d2037996d61d8de95806335c7c86ce0f82e9c" dependencies = [ - "cfg-if", "fastrand", - "redox_syscall", - "rustix", - "windows-sys 0.52.0", + "getrandom 0.3.4", + "once_cell", + "rustix 1.1.3", + "windows-sys 0.61.2", ] [[package]] @@ -1525,24 +2219,96 @@ checksum = "3369f5ac52d5eb6ab48c6b4ffdc8efbcad6b89c765749064ba298f2c68a16a76" [[package]] name = "thiserror" -version = "1.0.56" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" +dependencies = [ + "thiserror-impl 1.0.69", +] + +[[package]] +name = "thiserror" +version = "2.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4288b5bcbc7920c07a1149a35cf9590a2aa808e0bc1eafaade0b80947865fbc4" +dependencies = [ + "thiserror-impl 2.0.18", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d54378c645627613241d077a3a79db965db602882668f9136ac42af9ecb730ad" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ - "thiserror-impl", + "proc-macro2", + "quote", + "syn", ] [[package]] name = "thiserror-impl" -version = "1.0.56" +version = "2.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471" +checksum = "ebc4ee7f67670e9b64d05fa4253e753e016c6c95ff35b89b7941d6b856dec1d5" dependencies = [ "proc-macro2", "quote", "syn", ] +[[package]] +name = "tinyvec" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa5fdc3bce6191a1dbc8c02d5c8bffcf557bafa17c124c5264a458f1b0613fa" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "tokio" +version = "1.49.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72a2903cd7736441aac9df9d7688bd0ce48edccaadf181c3b90be801e81d3d86" +dependencies = [ + "bytes", + "libc", + "mio", + "pin-project-lite", + "socket2", + "windows-sys 0.61.2", +] + +[[package]] +name = "tokio-rustls" +version = "0.26.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1729aa945f29d91ba541258c8df89027d5792d85a8841fb65e8bf0f4ede4ef61" +dependencies = [ + "rustls", + "tokio", +] + +[[package]] +name = "tokio-util" +version = "0.7.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ae9cec805b01e8fc3fd2fe289f89149a9b66dd16786abd8b19cfa7b48cb0098" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", +] + [[package]] name = "toml" version = "0.8.12" @@ -1577,6 +2343,81 @@ dependencies = [ "winnow", ] +[[package]] +name = "tower" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebe5ef63511595f1344e2d5cfa636d973292adc0eec1f0ad45fae9f0851ab1d4" +dependencies = [ + "futures-core", + "futures-util", + "pin-project-lite", + "sync_wrapper", + "tokio", + "tower-layer", + "tower-service", +] + +[[package]] +name = "tower-http" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4e6559d53cc268e5031cd8429d05415bc4cb4aefc4aa5d6cc35fbf5b924a1f8" +dependencies = [ + "async-compression", + "bitflags 2.4.2", + "bytes", + "futures-core", + "futures-util", + "http", + "http-body", + "http-body-util", + "iri-string", + "pin-project-lite", + "tokio", + "tokio-util", + "tower", + "tower-layer", + "tower-service", +] + +[[package]] +name = "tower-layer" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" + +[[package]] +name = "tower-service" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" + +[[package]] +name = "tracing" +version = "0.1.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100" +dependencies = [ + "pin-project-lite", + "tracing-core", +] + +[[package]] +name = "tracing-core" +version = "0.1.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db97caf9d906fbde555dd62fa95ddba9eecfd14cb388e4f491a66d74cd5fb79a" +dependencies = [ + "once_cell", +] + +[[package]] +name = "try-lock" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" + [[package]] name = "twox-hash" version = "1.6.3" @@ -1587,6 +2428,12 @@ dependencies = [ "static_assertions", ] +[[package]] +name = "twox-hash" +version = "2.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ea3136b675547379c4bd395ca6b938e5ad3c3d20fad76e7fe85f9e0d011419c" + [[package]] name = "typenum" version = "1.17.0" @@ -1611,6 +2458,12 @@ version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" +[[package]] +name = "unicode-width" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4ac048d71ede7ee76d585517add45da530660ef4390e49b098733c6e897f254" + [[package]] name = "unindent" version = "0.2.3" @@ -1642,7 +2495,7 @@ dependencies = [ "rustls", "rustls-pki-types", "url", - "webpki-roots", + "webpki-roots 0.26.1", ] [[package]] @@ -1693,12 +2546,122 @@ dependencies = [ "winapi-util", ] +[[package]] +name = "want" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" +dependencies = [ + "try-lock", +] + [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" +[[package]] +name = "wasip2" +version = "1.0.2+wasi-0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9517f9239f02c069db75e65f174b3da828fe5f5b945c4dd26bd25d89c03ebcf5" +dependencies = [ + "wit-bindgen", +] + +[[package]] +name = "wasm-bindgen" +version = "0.2.108" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64024a30ec1e37399cf85a7ffefebdb72205ca1c972291c51512360d90bd8566" +dependencies = [ + "cfg-if", + "once_cell", + "rustversion", + "wasm-bindgen-macro", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.58" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70a6e77fd0ae8029c9ea0063f87c46fde723e7d887703d74ad2616d792e51e6f" +dependencies = [ + "cfg-if", + "futures-util", + "js-sys", + "once_cell", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.108" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "008b239d9c740232e71bd39e8ef6429d27097518b6b30bdf9086833bd5b6d608" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.108" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5256bae2d58f54820e6490f9839c49780dff84c65aeab9e772f15d5f0e913a55" +dependencies = [ + "bumpalo", + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.108" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f01b580c9ac74c8d8f0c0e4afb04eeef2acf145458e52c03845ee9cd23e3d12" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "wasm-streams" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15053d8d85c7eccdbefef60f06769760a563c7f0a9d6902a13d35c7800b0ad65" +dependencies = [ + "futures-util", + "js-sys", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + +[[package]] +name = "web-sys" +version = "0.3.85" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "312e32e551d92129218ea9a2452120f4aabc03529ef03e4d0d82fb2780608598" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "web-time" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + [[package]] name = "webpki-roots" version = "0.26.1" @@ -1708,6 +2671,15 @@ dependencies = [ "rustls-pki-types", ] +[[package]] +name = "webpki-roots" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12bed680863276c63889429bfd6cab3b99943659923822de1c8a39c49e4d722c" +dependencies = [ + "rustls-pki-types", +] + [[package]] name = "winapi" version = "0.3.9" @@ -1739,6 +2711,12 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "windows-link" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" + [[package]] name = "windows-sys" version = "0.48.0" @@ -1754,7 +2732,34 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.0", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" +dependencies = [ + "windows-targets 0.53.5", +] + +[[package]] +name = "windows-sys" +version = "0.61.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" +dependencies = [ + "windows-link", ] [[package]] @@ -1774,17 +2779,35 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.0" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm 0.52.6", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", +] + +[[package]] +name = "windows-targets" +version = "0.53.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" +checksum = "4945f9f551b88e0d65f3db0bc25c33b8acea4d9e41163edf90dcd0b19f9069f3" dependencies = [ - "windows_aarch64_gnullvm 0.52.0", - "windows_aarch64_msvc 0.52.0", - "windows_i686_gnu 0.52.0", - "windows_i686_msvc 0.52.0", - "windows_x86_64_gnu 0.52.0", - "windows_x86_64_gnullvm 0.52.0", - "windows_x86_64_msvc 0.52.0", + "windows-link", + "windows_aarch64_gnullvm 0.53.1", + "windows_aarch64_msvc 0.53.1", + "windows_i686_gnu 0.53.1", + "windows_i686_gnullvm 0.53.1", + "windows_i686_msvc 0.53.1", + "windows_x86_64_gnu 0.53.1", + "windows_x86_64_gnullvm 0.53.1", + "windows_x86_64_msvc 0.53.1", ] [[package]] @@ -1795,9 +2818,15 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9d8416fa8b42f5c947f8482c43e7d89e73a173cead56d044f6a56104a6d1b53" [[package]] name = "windows_aarch64_msvc" @@ -1807,9 +2836,15 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.0" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" +checksum = "b9d782e804c2f632e395708e99a94275910eb9100b2114651e04744e9b125006" [[package]] name = "windows_i686_gnu" @@ -1819,9 +2854,27 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.0" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnu" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" +checksum = "960e6da069d81e09becb0ca57a65220ddff016ff2d6af6a223cf372a506593a3" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa7359d10048f68ab8b09fa71c3daccfb0e9b559aed648a8f95469c27057180c" [[package]] name = "windows_i686_msvc" @@ -1831,9 +2884,15 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.0" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_i686_msvc" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" +checksum = "1e7ac75179f18232fe9c285163565a57ef8d3c89254a30685b57d83a38d326c2" [[package]] name = "windows_x86_64_gnu" @@ -1843,9 +2902,15 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c3842cdd74a865a8066ab39c8a7a473c0778a3f29370b5fd6b4b9aa7df4a499" [[package]] name = "windows_x86_64_gnullvm" @@ -1855,9 +2920,15 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.0" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" +checksum = "0ffa179e2d07eee8ad8f57493436566c7cc30ac536a3379fdf008f47f6bb7ae1" [[package]] name = "windows_x86_64_msvc" @@ -1867,9 +2938,15 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650" [[package]] name = "winnow" @@ -1880,6 +2957,12 @@ dependencies = [ "memchr", ] +[[package]] +name = "wit-bindgen" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7249219f66ced02969388cf2bb044a09756a083d0fab1e566056b04d9fbcaa5" + [[package]] name = "xattr" version = "1.3.1" @@ -1887,8 +2970,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8da84f1a25939b27f6820d92aed108f83ff920fdf11a7b19366c27c4cda81d4f" dependencies = [ "libc", - "linux-raw-sys", - "rustix", + "linux-raw-sys 0.4.13", + "rustix 0.38.30", ] [[package]] @@ -1902,19 +2985,43 @@ dependencies = [ "pineappl_cli", ] +[[package]] +name = "zerocopy" +version = "0.8.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0894878a5fa3edfd6da3f88c4805f4c8558e2b996227a3d864f47fe11e38282c" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.8.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88d2b8d9c68ad2b9e4340d7832716a4d21a22a1154777ad56ea55c51a9cf3831" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "zeroize" -version = "1.7.0" +version = "1.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" +checksum = "b97154e67e32c85465826e8bcc1c59429aaaf107c1e4a9e53c8d8ccd5eff88d0" [[package]] name = "zip" -version = "0.5.13" +version = "2.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93ab48844d61251bb3835145c521d88aa4031d7139e8485990f60ca911fa0815" +checksum = "fabe6324e908f85a1c52063ce7aa26b68dcb7eb6dbc83a2d148403c9bc3eba50" dependencies = [ - "byteorder", + "arbitrary", "crc32fast", - "thiserror", + "crossbeam-utils", + "displaydoc", + "indexmap", + "memchr", + "thiserror 2.0.18", ] diff --git a/pineappl/Cargo.toml b/pineappl/Cargo.toml index 6d262264..a2317e41 100644 --- a/pineappl/Cargo.toml +++ b/pineappl/Cargo.toml @@ -25,7 +25,7 @@ float-cmp = { default-features = false, version = "0.9.0" } git-version = "0.3.5" itertools = "0.10.1" lz4_flex = "0.9.2" -ndarray = { features = ["serde"], version = "0.15.4" } +ndarray = { features = ["serde"], version = "0.16.1" } # TODO: opt out of default features in this crate to match line above pineappl-v0 = { package = "pineappl", version = "0.8.2" } rayon = "1.5.1" diff --git a/pineappl/src/evolution.rs b/pineappl/src/evolution.rs index f7d03dbe..b252ff65 100644 --- a/pineappl/src/evolution.rs +++ b/pineappl/src/evolution.rs @@ -489,7 +489,7 @@ pub(crate) fn evolve_slice( Ok(( Array1::from_iter(sub_fk_tables) - .into_shape((1, grid.bwfl().len(), channels0.len())) + .into_shape_with_order((1, grid.bwfl().len(), channels0.len())) .unwrap(), channels0 .into_iter() diff --git a/pineappl_capi/Cargo.toml b/pineappl_capi/Cargo.toml index d87aac41..0fab881c 100644 --- a/pineappl_capi/Cargo.toml +++ b/pineappl_capi/Cargo.toml @@ -21,7 +21,7 @@ workspace = true [dependencies] pineappl = { path = "../pineappl", version = "=1.3.0" } itertools = "0.10.1" -ndarray = "0.15.4" +ndarray = "0.16.1" [features] capi = [] diff --git a/pineappl_cli/Cargo.toml b/pineappl_cli/Cargo.toml index ce1ae688..3df7efb3 100644 --- a/pineappl_cli/Cargo.toml +++ b/pineappl_cli/Cargo.toml @@ -28,8 +28,9 @@ git-version = "0.3.5" itertools = "0.10.1" lhapdf = { package = "managed-lhapdf", version = "0.3.4" } lz4_flex = { optional = true, version = "0.9.2" } -ndarray = "0.15.4" -ndarray-npy = { default-features = false, features = ["npz"], optional = true, version = "0.8.1" } +neopdf = "=0.3.0-alpha2" +ndarray = "0.16.1" +ndarray-npy = { default-features = false, features = ["npz"], optional = true, version = "0.9.0" } pineappl = { path = "../pineappl", version = "=1.3.0" } pineappl_applgrid = { optional = true, path = "../pineappl_applgrid", version = "=1.3.0" } pineappl_fastnlo = { optional = true, path = "../pineappl_fastnlo", version = "=1.3.0" } diff --git a/pineappl_cli/src/convolve.rs b/pineappl_cli/src/convolve.rs index facee52f..7bf56e29 100644 --- a/pineappl_cli/src/convolve.rs +++ b/pineappl_cli/src/convolve.rs @@ -58,10 +58,11 @@ pub struct Opts { impl Subcommand for Opts { fn run(&self, cfg: &GlobalConfiguration) -> Result { let grid = helpers::read_grid(&self.input)?; - let mut conv_funs_0 = helpers::create_conv_funs(&self.conv_funs[0])?; + let mut conv_funs_0 = + helpers::create_conv_funs_with_backend(&self.conv_funs[0], cfg.pdf_backend)?; let bins: Vec<_> = self.bins.iter().cloned().flatten().collect(); - let results = helpers::convolve_scales( + let results = helpers::convolve_scales_with_backend( &grid, &mut conv_funs_0, &self.conv_funs[0].conv_types, @@ -91,8 +92,9 @@ impl Subcommand for Opts { .iter() .flat_map(|conv_funs| { let conv_types = &conv_funs.conv_types; - let mut conv_funs = helpers::create_conv_funs(conv_funs).unwrap(); - helpers::convolve( + let mut conv_funs = + helpers::create_conv_funs_with_backend(conv_funs, cfg.pdf_backend).unwrap(); + helpers::convolve_with_backend( &grid, &mut conv_funs, conv_types, diff --git a/pineappl_cli/src/helpers.rs b/pineappl_cli/src/helpers.rs index b3569358..20232c54 100644 --- a/pineappl_cli/src/helpers.rs +++ b/pineappl_cli/src/helpers.rs @@ -1,3 +1,4 @@ +use super::pdf_backend::{self, Backend, ForcePositive, PdfBackend, PdfSetBackend}; use super::GlobalConfiguration; use anyhow::{anyhow, bail, Context, Error, Result}; use itertools::Itertools; @@ -64,6 +65,7 @@ impl FromStr for ConvFuns { } } +/// Creates convolution functions using LHAPDF backend (legacy). pub fn create_conv_funs(funs: &ConvFuns) -> Result> { Ok(funs .lhapdf_names @@ -82,6 +84,22 @@ pub fn create_conv_funs(funs: &ConvFuns) -> Result> { .collect::>()?) } +/// Creates convolution functions using the specified backend. +pub fn create_conv_funs_with_backend( + funs: &ConvFuns, + backend: Backend, +) -> Result>> { + funs.lhapdf_names + .iter() + .zip(&funs.members) + .map(|(name, member)| { + let member = member.unwrap_or(0); + pdf_backend::create_pdf(name, member, backend) + }) + .collect() +} + +/// Creates convolution functions for a PDF set using LHAPDF backend (legacy). pub fn create_conv_funs_for_set( funs: &ConvFuns, index_of_set: usize, @@ -115,6 +133,30 @@ pub fn create_conv_funs_for_set( Ok((set, conv_funs)) } +/// Creates convolution functions for a PDF set using the specified backend. +/// +/// Returns a tuple of (`PdfSetBackend`, Vec>>). +pub fn create_conv_funs_for_set_with_backend( + funs: &ConvFuns, + index_of_set: usize, + backend: Backend, +) -> Result<(Box, Vec>>)> { + let setname = &funs.lhapdf_names[index_of_set]; + let set = pdf_backend::create_pdf_set(setname, backend)?; + + let set_members = set.mk_pdfs()?; + let conv_funs = set_members + .into_iter() + .map(|member_pdf| { + let mut conv_funs = create_conv_funs_with_backend(funs, backend)?; + conv_funs[index_of_set] = member_pdf; + Ok::<_, Error>(conv_funs) + }) + .collect::>()?; + + Ok((set, conv_funs)) +} + pub fn read_grid(input: &Path) -> Result { Grid::read(File::open(input).context(format!("unable to open '{}'", input.display()))?) .context(format!("unable to read '{}'", input.display())) @@ -238,6 +280,7 @@ pub enum ConvoluteMode { Normal, } +/// Performs convolution with scale variations using LHAPDF backend (legacy). pub fn convolve_scales( grid: &Grid, conv_funs: &mut [Pdf], @@ -321,8 +364,125 @@ pub fn convolve_scales( match mode { ConvoluteMode::Asymmetry => { let bin_count = grid.bwfl().len(); + assert!((bins.is_empty() || (bins.len() == bin_count)) && (bin_count % 2 == 0)); - // calculating the asymmetry for a subset of bins doesn't work + results + .iter() + .skip((bin_count / 2) * scales.len()) + .zip( + results + .chunks_exact(scales.len()) + .take(bin_count / 2) + .rev() + .flatten(), + ) + .map(|(pos, neg)| (pos - neg) / (pos + neg)) + .collect() + } + ConvoluteMode::Integrated => { + results + .iter_mut() + .zip( + grid.bwfl() + .normalizations() + .into_iter() + .enumerate() + .filter(|(index, _)| bins.is_empty() || bins.contains(index)) + .flat_map(|(_, norm)| iter::repeat(norm).take(scales.len())), + ) + .for_each(|(value, norm)| *value *= norm); + + results + } + ConvoluteMode::Normal => results, + } +} + +/// Performs convolution with scale variations using the backend abstraction. +#[allow(clippy::too_many_arguments)] +pub fn convolve_scales_with_backend( + grid: &Grid, + conv_funs: &mut [Box], + conv_types: &[ConvType], + orders: &[(u8, u8)], + bins: &[usize], + channels: &[bool], + scales: &[(f64, f64, f64)], + mode: ConvoluteMode, + cfg: &GlobalConfiguration, +) -> Vec { + let orders: Vec<_> = grid + .orders() + .iter() + .map(|order| { + orders.is_empty() + || orders + .iter() + .any(|other| (order.alphas == other.0) && (order.alpha == other.1)) + }) + .collect(); + + if cfg.force_positive { + for fun in conv_funs.iter_mut() { + fun.set_force_positive(ForcePositive::ClipNegative); + } + } + + // TODO: promote this to an error + assert!( + cfg.use_alphas_from < conv_funs.len(), + "expected `use_alphas_from` to be an integer within `[0, {})`, but got `{}`", + conv_funs.len(), + cfg.use_alphas_from + ); + + let x_min_max: Vec<_> = conv_funs + .iter_mut() + .map(|fun| (fun.x_min(), fun.x_max())) + .collect(); + + let mut funs: Vec<_> = conv_funs + .iter() + .zip(&x_min_max) + .map(|(fun, &(x_min, x_max))| { + move |id: i32, x: f64, q2: f64| { + if !cfg.allow_extrapolation && (x < x_min || x > x_max) { + 0.0 + } else { + fun.xfx_q2(id, x, q2) + } + } + }) + .collect(); + + let xfx: Vec<_> = funs + .iter_mut() + .map(|fun| fun as &mut dyn FnMut(i32, f64, f64) -> f64) + .collect(); + + let mut alphas_funs: Vec<_> = conv_funs + .iter() + .map(|fun| { + let fun_ref = fun.as_ref(); + move |q2: f64| fun_ref.alphas_q2(q2) + }) + .collect(); + + let convolutions: Vec<_> = conv_funs + .iter() + .zip(conv_types) + .map(|(fun, &conv_type)| { + let pid = fun.particle_id(); + Conv::new(conv_type, pid) + }) + .collect(); + + let mut cache = ConvolutionCache::new(convolutions, xfx, &mut alphas_funs[cfg.use_alphas_from]); + let mut results = grid.convolve(&mut cache, &orders, bins, channels, scales); + + match mode { + ConvoluteMode::Asymmetry => { + let bin_count = grid.bwfl().len(); assert!((bins.is_empty() || (bins.len() == bin_count)) && (bin_count % 2 == 0)); results @@ -373,6 +533,7 @@ pub fn scales_vector(grid: &Grid, scales: usize) -> &[(f64, f64, f64)] { } } +/// Performs convolution using LHAPDF backend (legacy). pub fn convolve( grid: &Grid, conv_funs: &mut [Pdf], @@ -397,6 +558,32 @@ pub fn convolve( ) } +/// Performs convolution using the backend abstraction. +#[allow(clippy::too_many_arguments)] +pub fn convolve_with_backend( + grid: &Grid, + conv_funs: &mut [Box], + conv_types: &[ConvType], + orders: &[(u8, u8)], + bins: &[usize], + lumis: &[bool], + scales: usize, + mode: ConvoluteMode, + cfg: &GlobalConfiguration, +) -> Vec { + convolve_scales_with_backend( + grid, + conv_funs, + conv_types, + orders, + bins, + lumis, + scales_vector(grid, scales), + mode, + cfg, + ) +} + pub fn convolve_limits(grid: &Grid, bins: &[usize], mode: ConvoluteMode) -> Vec> { let limits: Vec<_> = grid .bwfl() diff --git a/pineappl_cli/src/lib.rs b/pineappl_cli/src/lib.rs index 04ee204b..166e3ee7 100644 --- a/pineappl_cli/src/lib.rs +++ b/pineappl_cli/src/lib.rs @@ -14,6 +14,7 @@ mod helpers; mod import; mod merge; mod orders; +pub mod pdf_backend; mod plot; mod pull; mod read; @@ -41,6 +42,9 @@ pub struct GlobalConfiguration { /// Choose the PDF/FF set for the strong coupling. #[arg(default_value = "0", long, value_name = "IDX")] pub use_alphas_from: usize, + /// Select the PDF interpolation backend: 'lhapdf' or 'neopdf'. + #[arg(default_value = "lhapdf", long, value_name = "BACKEND")] + pub pdf_backend: pdf_backend::Backend, } #[enum_dispatch] diff --git a/pineappl_cli/src/pdf_backend.rs b/pineappl_cli/src/pdf_backend.rs new file mode 100644 index 00000000..814ff31e --- /dev/null +++ b/pineappl_cli/src/pdf_backend.rs @@ -0,0 +1,460 @@ +//! PDF backend abstraction layer. +//! +//! This module provides a unified interface for different PDF interpolation backends, +//! currently supporting `LHAPDF` and `NeoPDF`. It allows runtime selection of the backend +//! and provides type-safe access to PDF metadata. + +use anyhow::{anyhow, Context, Result}; +use std::fmt; +use std::str::FromStr; + +/// Constant for 1-sigma confidence level (for compatibility with `lhapdf::CL_1_SIGMA`). +pub const CL_1_SIGMA: f64 = 68.268_949_213_708_58; + +/// The type of PDF set (space-like for PDFs, time-like for FFs). +#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)] +pub enum SetType { + /// Space-like PDF (standard parton distribution function). + #[default] + SpaceLike, + /// Time-like PDF (fragmentation function). + TimeLike, +} + +impl fmt::Display for SetType { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + match self { + Self::SpaceLike => write!(f, "SpaceLike"), + Self::TimeLike => write!(f, "TimeLike"), + } + } +} + +/// Method for handling negative PDF values. +#[derive(Clone, Copy, Debug, Default)] +pub enum ForcePositive { + /// No clipping - return values as-is. + #[default] + None, + /// Clip negative values to zero. + ClipNegative, +} + +/// Available PDF backends. +#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)] +pub enum Backend { + /// `LHAPDF` backend (C++ library with Rust bindings). + #[default] + Lhapdf, + /// `NeoPDF` backend (pure Rust implementation). + Neopdf, +} + +impl FromStr for Backend { + type Err = anyhow::Error; + + fn from_str(s: &str) -> Result { + match s.to_lowercase().as_str() { + "lhapdf" => Ok(Self::Lhapdf), + "neopdf" => Ok(Self::Neopdf), + _ => Err(anyhow!( + "unknown PDF backend '{}'; must be 'lhapdf' or 'neopdf'", + s + )), + } + } +} + +impl fmt::Display for Backend { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + match self { + Self::Lhapdf => write!(f, "lhapdf"), + Self::Neopdf => write!(f, "neopdf"), + } + } +} + +/// Unified PDF backend interface. +/// +/// This trait provides a common interface for PDF interpolation backends, +/// allowing the CLI to work with different implementations transparently. +pub trait PdfBackend: Send { + /// Evaluates xf(x, Q^2) for a given flavor. + /// + /// # Arguments + /// * `id` - The Monte Carlo PDG flavor ID. + /// * `x` - The momentum fraction. + /// * `q2` - The squared energy scale. + /// + /// # Returns + /// The PDF value xf(x, Q^2). + /// + /// # TODO + /// Extend to support `NeoPDF` multi-parameters interpolation. + fn xfx_q2(&self, id: i32, x: f64, q2: f64) -> f64; + + /// Evaluates the strong coupling constant `alpha_s(Q^2)`. + fn alphas_q2(&self, q2: f64) -> f64; + + /// Returns the minimum valid x value. + fn x_min(&mut self) -> f64; + + /// Returns the maximum valid x value. + fn x_max(&mut self) -> f64; + + /// Returns the hadron particle ID (PDG code). + fn particle_id(&self) -> i32; + + /// Returns whether this is a polarized PDF. + fn is_polarized(&self) -> bool; + + /// Returns the PDF set type (space-like or time-like). + fn set_type(&self) -> SetType; + + /// Sets the method for handling negative PDF values. + fn set_force_positive(&mut self, method: ForcePositive); + + /// Returns the error type of the PDF set (e.g., "replicas", "hessian"). + fn error_type(&self) -> String; +} + +/// Unified PDF set interface for uncertainty calculations. +pub trait PdfSetBackend { + /// Returns the number of members in this set. + fn num_members(&self) -> usize; + + /// Creates all PDF members in the set. + fn mk_pdfs(&self) -> Result>>; + + /// Calculates the uncertainty for a set of values. + fn uncertainty(&self, values: &[f64], cl: f64, alternative: bool) -> Result; +} + +/// Uncertainty information from a PDF set. +#[derive(Clone, Debug)] +pub struct Uncertainty { + /// Central value. + pub central: f64, + /// Negative error (absolute value). + pub errminus: f64, + /// Positive error (absolute value). + pub errplus: f64, +} + +// ============================================================================ +// LHAPDF Backend Implementation +// ============================================================================ + +/// LHAPDF backend wrapper. +pub struct LhapdfPdf { + pdf: lhapdf::Pdf, +} + +impl LhapdfPdf { + /// Creates a new LHAPDF PDF by set name and member index. + pub fn with_setname_and_member(setname: &str, member: i32) -> Result { + Ok(Self { + pdf: lhapdf::Pdf::with_setname_and_member(setname, member).with_context(|| { + format!("failed to load LHAPDF set '{setname}' member {member}") + })?, + }) + } + + /// Creates a new LHAPDF PDF by LHAID. + pub fn with_lhaid(lhaid: i32) -> Result { + Ok(Self { + pdf: lhapdf::Pdf::with_lhaid(lhaid) + .with_context(|| format!("failed to load LHAPDF with LHAID {lhaid}"))?, + }) + } +} + +impl PdfBackend for LhapdfPdf { + fn xfx_q2(&self, id: i32, x: f64, q2: f64) -> f64 { + self.pdf.xfx_q2(id, x, q2) + } + + fn alphas_q2(&self, q2: f64) -> f64 { + self.pdf.alphas_q2(q2) + } + + fn x_min(&mut self) -> f64 { + self.pdf.x_min() + } + + fn x_max(&mut self) -> f64 { + self.pdf.x_max() + } + + fn particle_id(&self) -> i32 { + self.pdf + .set() + .entry("Particle") + .map_or(Ok(2212), |s| s.parse()) + .unwrap_or(2212) + } + + fn is_polarized(&self) -> bool { + self.pdf + .set() + .entry("Polarized") + .is_some_and(|s| s.eq_ignore_ascii_case("true")) + } + + fn set_type(&self) -> SetType { + self.pdf + .set() + .entry("SetType") + .map_or(SetType::SpaceLike, |s| { + if s.eq_ignore_ascii_case("timelike") { + SetType::TimeLike + } else { + SetType::SpaceLike + } + }) + } + + fn set_force_positive(&mut self, method: ForcePositive) { + match method { + ForcePositive::None => self.pdf.set_force_positive(0), + ForcePositive::ClipNegative => self.pdf.set_force_positive(1), + } + } + + fn error_type(&self) -> String { + self.pdf + .set() + .entry("ErrorType") + .map(|s| s.to_owned()) + .unwrap_or_default() + } +} + +/// LHAPDF set wrapper. +pub struct LhapdfSet { + set: lhapdf::PdfSet, +} + +impl LhapdfSet { + /// Creates a new LHAPDF set by name. + pub fn new(setname: &str) -> Result { + Ok(Self { + set: lhapdf::PdfSet::new(setname) + .with_context(|| format!("failed to load LHAPDF set '{setname}'"))?, + }) + } +} + +impl PdfSetBackend for LhapdfSet { + fn num_members(&self) -> usize { + self.set + .entry("NumMembers") + .and_then(|s| s.parse().ok()) + .unwrap_or(1) + } + + fn mk_pdfs(&self) -> Result>> { + let pdfs = self.set.mk_pdfs()?; + Ok(pdfs + .into_iter() + .map(|pdf| Box::new(LhapdfPdf { pdf }) as Box) + .collect()) + } + + fn uncertainty(&self, values: &[f64], cl: f64, alternative: bool) -> Result { + let unc = self.set.uncertainty(values, cl, alternative)?; + Ok(Uncertainty { + central: unc.central, + errminus: unc.errminus, + errplus: unc.errplus, + }) + } +} + +// ============================================================================ +// NeoPDF Backend Implementation +// ============================================================================ + +/// `NeoPDF` backend wrapper. +pub struct NeopdfPdf { + pdf: neopdf::pdf::PDF, +} + +impl NeopdfPdf { + /// Loads a NeoPDF member by set name and member index. + pub fn load(pdf_name: &str, member: usize) -> Self { + Self { + pdf: neopdf::pdf::PDF::load(pdf_name, member), + } + } +} + +impl PdfBackend for NeopdfPdf { + fn xfx_q2(&self, id: i32, x: f64, q2: f64) -> f64 { + self.pdf.xfxq2(id, &[x, q2]) + } + + fn alphas_q2(&self, q2: f64) -> f64 { + self.pdf.alphas_q2(q2) + } + + fn x_min(&mut self) -> f64 { + self.pdf.metadata().x_min + } + + fn x_max(&mut self) -> f64 { + self.pdf.metadata().x_max + } + + fn particle_id(&self) -> i32 { + self.pdf.metadata().hadron_pid + } + + fn is_polarized(&self) -> bool { + self.pdf.metadata().polarised + } + + fn set_type(&self) -> SetType { + match self.pdf.metadata().set_type { + neopdf::metadata::SetType::SpaceLike => SetType::SpaceLike, + neopdf::metadata::SetType::TimeLike => SetType::TimeLike, + } + } + + fn set_force_positive(&mut self, method: ForcePositive) { + match method { + ForcePositive::None => { + self.pdf + .set_force_positive(neopdf::gridpdf::ForcePositive::NoClipping); + } + ForcePositive::ClipNegative => { + self.pdf + .set_force_positive(neopdf::gridpdf::ForcePositive::ClipNegative); + } + } + } + + fn error_type(&self) -> String { + self.pdf.metadata().error_type.clone() + } +} + +/// `NeoPDF` set wrapper. +pub struct NeopdfSet { + pdf_name: String, + num_members: usize, + error_type: String, +} + +impl NeopdfSet { + /// Creates a new NeoPDF set by name. + pub fn new(pdf_name: &str) -> Self { + // Load member 0 to get metadata + let pdf0 = neopdf::pdf::PDF::load(pdf_name, 0); + let metadata = pdf0.metadata(); + + Self { + pdf_name: pdf_name.to_owned(), + num_members: metadata.num_members as usize, + error_type: metadata.error_type.clone(), + } + } +} + +impl PdfSetBackend for NeopdfSet { + fn num_members(&self) -> usize { + self.num_members + } + + fn mk_pdfs(&self) -> Result>> { + let pdfs = neopdf::pdf::PDF::load_pdfs(&self.pdf_name); + Ok(pdfs + .into_iter() + .map(|pdf| Box::new(NeopdfPdf { pdf }) as Box) + .collect()) + } + + fn uncertainty(&self, values: &[f64], cl: f64, _alternative: bool) -> Result { + let central = values[0]; + + let (errminus, errplus) = if self.error_type.to_lowercase().contains("replicas") + || self.error_type.to_lowercase().contains("monte carlo") + { + let n = values.len() as f64; + let mean: f64 = values.iter().skip(1).sum::() / (n - 1.0); + let variance: f64 = values + .iter() + .skip(1) + .map(|&v| (v - mean).powi(2)) + .sum::() + / (n - 1.0); + let std_dev = variance.sqrt(); + + let scale = if (cl - 68.27).abs() < 0.1 { + 1.0 + } else if (cl - 95.45).abs() < 0.1 { + 2.0 + } else { + cl / 100.0 * 1.645 // approximate + }; + + (std_dev * scale, std_dev * scale) + } else { + let mut sum_sq = 0.0; + for pair in values[1..].chunks(2) { + if pair.len() == 2 { + let diff = (pair[0] - pair[1]).abs() / 2.0; + sum_sq += diff.powi(2); + } + } + let err = sum_sq.sqrt(); + (err, err) + }; + + Ok(Uncertainty { + central, + errminus, + errplus, + }) + } +} + +// ============================================================================ +// Factory Functions +// ============================================================================ + +/// Creates a single PDF from a set name and member index. +pub fn create_pdf(name: &str, member: usize, backend: Backend) -> Result> { + match backend { + Backend::Lhapdf => { + if let Ok(lhaid) = name.parse::() { + Ok(Box::new(LhapdfPdf::with_lhaid(lhaid)?)) + } else { + Ok(Box::new(LhapdfPdf::with_setname_and_member( + name, + member.try_into().unwrap(), + )?)) + } + } + // NOTE: `NeoPDF` doesn't support reading LHAID yet. + Backend::Neopdf => Ok(Box::new(NeopdfPdf::load(name, member))), + } +} + +/// Creates a PDF set for uncertainty calculations. +pub fn create_pdf_set(name: &str, backend: Backend) -> Result> { + match backend { + Backend::Lhapdf => { + // Try parsing as LHAID first + let setname = if let Ok(lhaid) = name.parse::() { + lhapdf::lookup_pdf(lhaid) + .map(|(set, _)| set) + .ok_or_else(|| anyhow!("no PDF set found for LHAID = {lhaid}"))? + } else { + name.to_owned() + }; + Ok(Box::new(LhapdfSet::new(&setname)?)) + } + Backend::Neopdf => Ok(Box::new(NeopdfSet::new(name))), + } +} diff --git a/pineappl_cli/src/uncert.rs b/pineappl_cli/src/uncert.rs index 33b795a4..59bc8cef 100644 --- a/pineappl_cli/src/uncert.rs +++ b/pineappl_cli/src/uncert.rs @@ -66,7 +66,7 @@ pub struct Opts { #[command(flatten)] group: Group, /// Confidence level in per cent, for convolution function uncertainties. - #[arg(default_value_t = lhapdf::CL_1_SIGMA, long)] + #[arg(default_value_t = super::pdf_backend::CL_1_SIGMA, long)] cl: f64, /// Show integrated numbers (without bin widths) instead of differential ones. #[arg(long, short)] @@ -94,7 +94,8 @@ pub struct Opts { impl Subcommand for Opts { fn run(&self, cfg: &GlobalConfiguration) -> Result { let grid = helpers::read_grid(&self.input)?; - let mut conv_funs = helpers::create_conv_funs(&self.conv_funs)?; + let mut conv_funs = + helpers::create_conv_funs_with_backend(&self.conv_funs, cfg.pdf_backend)?; let limits = helpers::convolve_limits( &grid, @@ -116,11 +117,15 @@ impl Subcommand for Opts { .conv_fun .iter() .map(|&index| { - let (set, funs) = helpers::create_conv_funs_for_set(&self.conv_funs, index)?; + let (set, funs) = helpers::create_conv_funs_for_set_with_backend( + &self.conv_funs, + index, + cfg.pdf_backend, + )?; let results: Vec<_> = funs .into_par_iter() .map(|mut funs| { - Ok::<_, Error>(helpers::convolve( + Ok::<_, Error>(helpers::convolve_with_backend( &grid, &mut funs, &self.conv_funs.conv_types, @@ -159,7 +164,7 @@ impl Subcommand for Opts { .max() .unwrap_or(1); let scale_tuples = helpers::scales_vector(&grid, scales_max); - let scale_results = helpers::convolve_scales( + let scale_results = helpers::convolve_scales_with_backend( &grid, &mut conv_funs, &self.conv_funs.conv_types, diff --git a/pineappl_cli/tests/convolve.rs b/pineappl_cli/tests/convolve.rs index e20f894b..3be6f7cf 100644 --- a/pineappl_cli/tests/convolve.rs +++ b/pineappl_cli/tests/convolve.rs @@ -475,3 +475,18 @@ fn no_channels_grid() { .success() .stdout(NO_CHANNELS_GRID_STR); } + +#[test] +fn neopdf_backend() { + Command::cargo_bin("pineappl") + .unwrap() + .args([ + "--pdf-backend=neopdf", + "convolve", + "../test-data/LHCB_WP_7TEV_opt.pineappl.lz4", + "NNPDF31_nlo_as_0118_luxqed", + ]) + .assert() + .success() + .stdout(str::contains(DEFAULT_STR)); +} diff --git a/pineappl_cli/tests/main.rs b/pineappl_cli/tests/main.rs index 8f6b2e34..2074f377 100644 --- a/pineappl_cli/tests/main.rs +++ b/pineappl_cli/tests/main.rs @@ -29,6 +29,7 @@ Options: --force-positive Forces negative PDF values to zero --allow-extrapolation Allow extrapolation of PDFs outside their region of validity --use-alphas-from Choose the PDF/FF set for the strong coupling [default: 0] + --pdf-backend Select the PDF interpolation backend: 'lhapdf' or 'neopdf' [default: lhapdf] -h, --help Print help -V, --version Print version "; diff --git a/pineappl_py/Cargo.toml b/pineappl_py/Cargo.toml index fd08773a..b681be1c 100644 --- a/pineappl_py/Cargo.toml +++ b/pineappl_py/Cargo.toml @@ -29,7 +29,7 @@ crate-type = ["cdylib"] [dependencies] itertools = "0.10.1" -ndarray = "0.15.4" +ndarray = "0.16.1" numpy = "0.26.0" pineappl = { path = "../pineappl", version = "=1.3.0" } pyo3 = { features = ["extension-module"], version = "0.26.0" }