From 7756063d6ba99d199160cc372388475e1e16175d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20L=C3=B6schner?= Date: Sat, 7 Jun 2025 13:13:14 +0200 Subject: [PATCH 1/8] Update deps --- Cargo.lock | 204 +++++++++++++++++++++++++++-------------------------- 1 file changed, 105 insertions(+), 99 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3fcd2574..1a80393e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -40,9 +40,9 @@ checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299" [[package]] name = "anstream" -version = "0.6.18" +version = "0.6.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8acc5369981196006228e28809f761875c0327210a891e941f4c683b3a99529b" +checksum = "301af1932e46185686725e0fad2f8f2aa7da69dd70bf6ecc44d6b703844a3933" dependencies = [ "anstyle", "anstyle-parse", @@ -55,36 +55,36 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.10" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55cc3b69f167a1ef2e161439aa98aed94e6028e5f9a59be9a6ffb47aef1651f9" +checksum = "862ed96ca487e809f1c8e5a8447f6ee2cf102f846893800b20cebdf541fc6bbd" [[package]] name = "anstyle-parse" -version = "0.2.6" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b2d16507662817a6a20a9ea92df6652ee4f94f914589377d69f3b21bc5798a9" +checksum = "4e7644824f0aa2c7b9384579234ef10eb7efb6a0deb83f9630a49594dd9c15c2" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79947af37f4177cfead1110013d678905c37501914fba0efea834c3fe9a8d60c" +checksum = "6c8bdeb6047d8983be085bab0ba1472e6dc604e7041dbf6fcd5e71523014fae9" dependencies = [ "windows-sys", ] [[package]] name = "anstyle-wincon" -version = "3.0.7" +version = "3.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca3534e77181a9cc07539ad51f2141fe32f6c3ffd4df76db8ad92346b003ae4e" +checksum = "403f75924867bb1033c59fbf0797484329750cfbe3c4325cd33127941fabc882" dependencies = [ "anstyle", - "once_cell", + "once_cell_polyfill", "windows-sys", ] @@ -96,9 +96,9 @@ checksum = "70033777eb8b5124a81a1889416543dddef2de240019b674c81285a2635a7e1e" [[package]] name = "anyhow" -version = "1.0.97" +version = "1.0.98" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcfed56ad506cb2c684a14971b8861fdc3baaaae314b9e5f9bb532cbe3ba7a4f" +checksum = "e16d2d3311acee920a9eb8d33b8cbc1787ce4a264e85f964c2404b969bdcd487" [[package]] name = "approx" @@ -129,27 +129,27 @@ checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "bitflags" -version = "2.9.0" +version = "2.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c8214115b7bf84099f1309324e63141d4c5d7cc26862f97a0a857dbefe165bd" +checksum = "1b8e56985ec62d17e9c1001dc89c88ecd7dc08e47eba5ec7c29c7b5eeecde967" [[package]] name = "bumpalo" -version = "3.17.0" +version = "3.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1628fb46dfa0b37568d12e5edd512553eccf6a22a78e8bde00bb4aed84d5bdbf" +checksum = "793db76d6187cd04dff33004d8e6c9cc4e05cd330500379d2394209271b4aeee" [[package]] name = "bytecount" -version = "0.6.8" +version = "0.6.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ce89b21cab1437276d2650d57e971f9d548a2d9037cc231abdc0562b97498ce" +checksum = "175812e0be2bccb6abe50bb8d566126198344f707e304f45c648fd8f2cc0365e" [[package]] name = "bytemuck" -version = "1.22.0" +version = "1.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6b1fc10dbac614ebc03540c9dbd60e83887fda27794998c6528f1782047d540" +checksum = "9134a6ef01ce4b366b50689c94f82c14bc72bc5d0386829828a2e2752ef7958c" [[package]] name = "bytemuck_derive" @@ -159,7 +159,7 @@ checksum = "7ecc273b49b3205b83d648f0690daa588925572cc5063745bfe547fe7ec8e1a1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.100", + "syn 2.0.101", ] [[package]] @@ -170,9 +170,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "camino" -version = "1.1.9" +version = "1.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b96ec4966b5813e2c0507c1f86115c8c5abaadc3980879c3424042a02fd1ad3" +checksum = "0da45bc31171d8d6960122e222a67740df867c1dd53b4d51caa297084c185cab" dependencies = [ "serde", ] @@ -207,9 +207,9 @@ checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" [[package]] name = "cc" -version = "1.2.18" +version = "1.2.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "525046617d8376e3db1deffb079e91cef90a89fc3ca5c185bbf8c9ecdd15cd5c" +checksum = "956a5e21988b87f372569b66183b78babf23ebc2e744b733e4350a752c4dafac" dependencies = [ "shlex", ] @@ -222,9 +222,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.40" +version = "0.4.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a7964611d71df112cb1730f2ee67324fcf4d0fc6606acbbe9bfe06df124637c" +checksum = "c469d952047f47f91b68d1cba3f10d63c11d73e4636f24f08daf0278abf01c4d" dependencies = [ "android-tzdata", "iana-time-zone", @@ -263,9 +263,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.35" +version = "4.5.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8aa86934b44c19c50f87cc2790e19f54f7a67aedb64101c2e1a2e5ecfb73944" +checksum = "fd60e63e9be68e5fb56422e397cf9baddded06dae1d2e523401542383bc72a9f" dependencies = [ "clap_builder", "clap_derive", @@ -273,9 +273,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.35" +version = "4.5.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2414dbb2dd0695280da6ea9261e327479e9d37b0630f6b53ba2a11c60c679fd9" +checksum = "89cc6392a1f72bbeb820d71f32108f61fdaf18bc526e1d23954168a67759ef51" dependencies = [ "anstream", "anstyle", @@ -292,7 +292,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.100", + "syn 2.0.101", ] [[package]] @@ -303,9 +303,9 @@ checksum = "f46ad14479a25103f283c0f10005961cf086d8dc42205bb44c46ac563475dca6" [[package]] name = "colorchoice" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990" +checksum = "b05b61dc5112cbb17e4b6cd61790d9845d13888356391624cbe7e41efeac1e75" [[package]] name = "console" @@ -430,9 +430,9 @@ checksum = "34aa73646ffb006b8f5147f3dc182bd4bcb190227ce861fc4a4844bf8e3cb2c0" [[package]] name = "errno" -version = "0.3.11" +version = "0.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "976dd42dc7e85965fe702eb8164f21f450704bdde31faefd6471dba214cb594e" +checksum = "cea14ef9355e3beab063703aa9dab15afd25f0667c341310c1e5274bb1d0da18" dependencies = [ "libc", "windows-sys", @@ -464,9 +464,9 @@ dependencies = [ [[package]] name = "flate2" -version = "1.1.1" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ced92e76e966ca2fd84c8f7aa01a4aea65b0eb6648d72f7c8f3e2764a67fece" +checksum = "4a3d7db9596fecd151c5f638c0ee5d5bd487b6e0ea232e5dc96d5250f6f94b1d" dependencies = [ "crc32fast", "miniz_oxide", @@ -483,9 +483,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" +checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592" dependencies = [ "cfg-if", "libc", @@ -494,9 +494,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73fea8450eea4bac3940448fb7ae50d91f034f941199fcd9d909a5a07aa455f0" +checksum = "26145e563e54f2cadc477553f1ec5ee650b00862f0a58bcd12cbdc5f0ea2d2f4" dependencies = [ "cfg-if", "libc", @@ -512,9 +512,9 @@ checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" [[package]] name = "half" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7db2ff139bba50379da6aa0766b52fdcb62cb5b263009b09ed58ba604e14bbd1" +checksum = "459196ed295495a68f7d7fe1d84f6c4b7ff0e21fe3017b2f283c6fac3ad803c9" dependencies = [ "cfg-if", "crunchy", @@ -553,9 +553,9 @@ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "hermit-abi" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbd780fe5cc30f81464441920d82ac8740e2e46b29a6fad543ddd075229ce37e" +checksum = "f154ce46856750ed433c8649605bf7ed2de3bc35fd9d2a9f30cddd873c80cb08" [[package]] name = "iana-time-zone" @@ -656,15 +656,15 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.171" +version = "0.2.172" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c19937216e9d3aa9956d9bb8dfc0b0c8beb6058fc4f7a4dc4d850edf86a237d6" +checksum = "d750af042f7ef4f724306de029d18836c26c1765a54a6a3f094cbd23a7267ffa" [[package]] name = "libm" -version = "0.2.11" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8355be11b20d696c8f18f6cc018c4e372165b1fa8126cef092399c9951984ffa" +checksum = "f9fbbcab51052fe104eb5e5d351cf728d30a5be1fe14d9be8a3b097481fb97de" [[package]] name = "linked-hash-map" @@ -674,15 +674,15 @@ checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" [[package]] name = "linux-raw-sys" -version = "0.9.3" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe7db12097d22ec582439daf8618b8fdd1a7bef6270e9af3b1ebcd30893cf413" +checksum = "cd945864f07fe9f5371a27ad7b52a172b4b499999f1d97574c9fa68373937e12" [[package]] name = "lock_api" -version = "0.4.12" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" +checksum = "96936507f153605bddfcda068dd804796c84324ed2510809e5b2a624c81da765" dependencies = [ "autocfg", "scopeguard", @@ -713,9 +713,9 @@ dependencies = [ [[package]] name = "matrixmultiply" -version = "0.3.9" +version = "0.3.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9380b911e3e96d10c1f415da0876389aaf1b56759054eeb0de7df940c456ba1a" +checksum = "a06de3016e9fae57a36fd14dba131fccf49f74b40b7fbdb472f96e361ec71a08" dependencies = [ "autocfg", "rawpointer", @@ -738,9 +738,9 @@ checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "miniz_oxide" -version = "0.8.7" +version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff70ce3e48ae43fa075863cef62e8b43b71a4f2382229920e0df362592919430" +checksum = "3be647b768db090acb35d5ec5db2b0e1f1de11133ca123b9eacf5137868f892a" dependencies = [ "adler2", ] @@ -772,7 +772,7 @@ checksum = "254a5372af8fc138e36684761d3c0cdb758a4410e938babcff1c860ce14ddbfc" dependencies = [ "proc-macro2", "quote", - "syn 2.0.100", + "syn 2.0.101", ] [[package]] @@ -875,6 +875,12 @@ version = "1.21.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" +[[package]] +name = "once_cell_polyfill" +version = "1.70.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4895175b425cb1f87721b59f0f286c2092bd4af812243672510e1ac53e2e0ad" + [[package]] name = "oorandom" version = "11.1.5" @@ -883,9 +889,9 @@ checksum = "d6790f58c7ff633d8771f42965289203411a5e5c68388703c06e14f24770b41e" [[package]] name = "parking_lot" -version = "0.12.3" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" +checksum = "70d58bf43669b5795d1576d0641cfb6fbb2057bf629506267a92807158584a13" dependencies = [ "lock_api", "parking_lot_core", @@ -893,9 +899,9 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.10" +version = "0.9.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" +checksum = "bc838d2a56b5b1a6c25f55575dfc605fabb63bb2365f6c2353ef9159aa69e4a5" dependencies = [ "cfg-if", "libc", @@ -985,9 +991,9 @@ dependencies = [ [[package]] name = "portable-atomic" -version = "1.11.0" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "350e9b48cbc6b0e028b0473b114454c6316e57336ee184ceab6e53f72c178b3e" +checksum = "f84267b20a16ea918e43c6a88433c2d54fa145c92a811b5b047ccbe153674483" [[package]] name = "ppv-lite86" @@ -1000,9 +1006,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.94" +version = "1.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a31971752e70b8b2686d7e46ec17fb38dad4051d94024c88df49b667caea9c84" +checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778" dependencies = [ "unicode-ident", ] @@ -1070,7 +1076,7 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom 0.2.15", + "getrandom 0.2.16", ] [[package]] @@ -1111,9 +1117,9 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.5.11" +version = "0.5.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2f103c6d277498fbceb16e84d317e2a400f160f46904d5f5410848c829511a3" +checksum = "928fca9cf2aa042393a8325b9ead81d2f0df4cb12e1e24cef072922ccd99c5af" dependencies = [ "bitflags", ] @@ -1160,9 +1166,9 @@ dependencies = [ [[package]] name = "rustix" -version = "1.0.5" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d97817398dd4bb2e6da002002db259209759911da105da92bec29ccb12cf58bf" +checksum = "c71e83d6afe7ff64890ec6b71d6a69bb8a610ab78ce364b3352876bb4c801266" dependencies = [ "bitflags", "errno", @@ -1173,9 +1179,9 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.20" +version = "1.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eded382c5f5f786b989652c49544c4877d9f015cc22e145a5ea8ea66c2921cd2" +checksum = "8a0d197bd2c9dc6e53b84da9556a69ba4cdfab8619eb41a8bd1cc2027a0f6b1d" [[package]] name = "ryu" @@ -1241,7 +1247,7 @@ checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" dependencies = [ "proc-macro2", "quote", - "syn 2.0.100", + "syn 2.0.101", ] [[package]] @@ -1292,9 +1298,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.15.0" +version = "1.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8917285742e9f3e1683f0a9c4e6b57960b7314d0b08d30d1ecd426713ee2eee9" +checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" [[package]] name = "splashsurf" @@ -1373,9 +1379,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.100" +version = "2.0.101" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b09a44accad81e1ba1cd74a32461ba89dee89095ba17b32f5d03683b1b1fc2a0" +checksum = "8ce2b7fc941b3a24138a0a7cf8e858bfc6a992e7978a068a5c760deb0ed43caf" dependencies = [ "proc-macro2", "quote", @@ -1384,12 +1390,12 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.19.1" +version = "3.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7437ac7763b9b123ccf33c338a5cc1bac6f69b45a136c19bdd8a65e3916435bf" +checksum = "e8a64e3985349f2441a1a9ef0b853f869006c3855f2cda6862a94d26ebb9d6a1" dependencies = [ "fastrand", - "getrandom 0.3.2", + "getrandom 0.3.3", "once_cell", "rustix", "windows-sys", @@ -1412,7 +1418,7 @@ checksum = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.100", + "syn 2.0.101", ] [[package]] @@ -1546,7 +1552,7 @@ dependencies = [ "log", "proc-macro2", "quote", - "syn 2.0.100", + "syn 2.0.101", "wasm-bindgen-shared", ] @@ -1568,7 +1574,7 @@ checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" dependencies = [ "proc-macro2", "quote", - "syn 2.0.100", + "syn 2.0.101", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -1623,9 +1629,9 @@ dependencies = [ [[package]] name = "windows-core" -version = "0.61.0" +version = "0.61.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4763c1de310c86d75a878046489e2e5ba02c649d185f21c67d4cf8a56d098980" +checksum = "c0fdd3ddb90610c7638aa2b3a3ab2904fb9e5cdbecc643ddb3647212781c4ae3" dependencies = [ "windows-implement", "windows-interface", @@ -1642,7 +1648,7 @@ checksum = "a47fddd13af08290e67f4acabf4b459f647552718f683a7b415d290ac744a836" dependencies = [ "proc-macro2", "quote", - "syn 2.0.100", + "syn 2.0.101", ] [[package]] @@ -1653,7 +1659,7 @@ checksum = "bd9211b69f8dcdfa817bfd14bf1c97c9188afa36f4750130fcdf3f400eca9fa8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.100", + "syn 2.0.101", ] [[package]] @@ -1664,18 +1670,18 @@ checksum = "76840935b766e1b0a05c0066835fb9ec80071d4c09a16f6bd5f7e655e3c14c38" [[package]] name = "windows-result" -version = "0.3.2" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c64fd11a4fd95df68efcfee5f44a294fe71b8bc6a91993e2791938abcc712252" +checksum = "56f42bd332cc6c8eac5af113fc0c1fd6a8fd2aa08a0119358686e5160d0586c6" dependencies = [ "windows-link", ] [[package]] name = "windows-strings" -version = "0.4.0" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a2ba9642430ee452d5a7aa78d72907ebe8cfda358e8cb7918a2050581322f97" +checksum = "56e6c93f3a0c3b36176cb1327a4958a0353d5d166c2a35cb268ace15e91d3b57" dependencies = [ "windows-link", ] @@ -1773,20 +1779,20 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.8.24" +version = "0.8.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2586fea28e186957ef732a5f8b3be2da217d65c5969d4b1e17f973ebbe876879" +checksum = "a1702d9583232ddb9174e01bb7c15a2ab8fb1bc6f227aa1233858c351a3ba0cb" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.8.24" +version = "0.8.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a996a8f63c5c4448cd959ac1bab0aaa3306ccfd060472f85943ee0750f0169be" +checksum = "28a6e20d751156648aa063f3800b706ee209a32c0b4d9f24be3d980b01be55ef" dependencies = [ "proc-macro2", "quote", - "syn 2.0.100", + "syn 2.0.101", ] From b57ae645d60bcf1c2a9f8e22021c796504578bf5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20L=C3=B6schner?= Date: Sat, 7 Jun 2025 13:14:12 +0200 Subject: [PATCH 2/8] Add lib.rs to CLI package to call CLI from other binaries --- splashsurf/src/cli.rs | 127 +++++++++++++++++++++++++++++++++++ splashsurf/src/lib.rs | 11 +++ splashsurf/src/logging.rs | 10 ++- splashsurf/src/main.rs | 136 ++------------------------------------ 4 files changed, 152 insertions(+), 132 deletions(-) create mode 100644 splashsurf/src/cli.rs create mode 100644 splashsurf/src/lib.rs diff --git a/splashsurf/src/cli.rs b/splashsurf/src/cli.rs new file mode 100644 index 00000000..c71d26bd --- /dev/null +++ b/splashsurf/src/cli.rs @@ -0,0 +1,127 @@ +//! The `splashsurf` surface reconstruction CLI. +//! +//! For documentation of the CLI see the [README](https://github.com/InteractiveComputerGraphics/splashsurf) in the project repository. +//! The reconstruction procedure and other internals of the CLI are provided by the [`splashsurf_lib`] crate. + +use crate::allocator::GetPeakAllocatedMemory; +use crate::{convert, logging, reconstruction}; +use anyhow::Context; +use clap::Parser; +use log::info; + +// Register allocator to track memory usage, might decrease performance if enabled +crate::register_counting_allocator!(GLOBAL_ALLOCATOR, enable = false); + +// TODO: Use different logging approach when processing multiple files in parallel +// TODO: Does coarse_prof work with multiple threads? +// TODO: Check if all paths supplied using the cmd args are valid +// TODO: Clean up the parameter structs and conversions + +static HELP_TEMPLATE: &str = "{before-help}{name} (v{version}) - {author-with-newline}{about-with-newline}\n{usage-heading} {usage}\n\n{all-args}{after-help}"; + +#[derive(Clone, Debug, clap::Parser)] +#[command( + name = "splashsurf", + author = "Fabian Löschner ", + about = "Surface reconstruction for particle data from SPH simulations (https://github.com/InteractiveComputerGraphics/splashsurf)", + version, + propagate_version = true, + help_template = HELP_TEMPLATE, +)] +struct CommandlineArgs { + /// Enable quiet mode (no output except for severe panic messages), overrides verbosity level + #[arg(long, short = 'q', global = true)] + quiet: bool, + /// Print more verbose output, use multiple "v"s for even more verbose output (-v, -vv) + #[arg(short, action = clap::ArgAction::Count, global = true)] + verbosity: u8, + /// Subcommands + #[command(subcommand)] + subcommand: Subcommand, +} + +#[derive(Clone, Debug, clap::Parser)] +enum Subcommand { + /// Reconstruct a surface from particle data + #[command(help_template = HELP_TEMPLATE)] + Reconstruct(reconstruction::ReconstructSubcommandArgs), + /// Convert particle or mesh files between different file formats + #[command(help_template = HELP_TEMPLATE)] + Convert(convert::ConvertSubcommandArgs), +} + +pub fn run_splashsurf(args: &[std::ffi::OsString]) -> Result<(), anyhow::Error> { + run_splashsurf_impl(args).inspect_err(logging::log_error) +} + +fn run_splashsurf_impl(args: &[std::ffi::OsString]) -> Result<(), anyhow::Error> { + let cmd_args = CommandlineArgs::parse_from(args); + + let verbosity = VerbosityLevel::from(cmd_args.verbosity); + let is_quiet = cmd_args.quiet; + + logging::initialize_logging(verbosity, is_quiet).context("Failed to initialize logging")?; + logging::log_program_info(); + + // Delegate to subcommands + let result = match &cmd_args.subcommand { + Subcommand::Reconstruct(cmd_args) => reconstruction::reconstruct_subcommand(cmd_args), + Subcommand::Convert(cmd_args) => convert::convert_subcommand(cmd_args), + }; + + // Write coarse_prof stats using log::info + info!("Timings:"); + splashsurf_lib::profiling::write_to_string() + .unwrap() + .split("\n") + .filter(|l| !l.is_empty()) + .for_each(|l| info!("{}", l)); + + // Print memory stats if available + if let Some(peak_allocation_bytes) = GLOBAL_ALLOCATOR.get_peak_allocated_memory() { + info!( + "Peak memory usage: {} bytes ({:.2}MB)", + peak_allocation_bytes, + peak_allocation_bytes as f64 * 1e-6 + ); + } + + info!( + "Finished at {}.", + chrono::Local::now().to_rfc3339_opts(chrono::SecondsFormat::Micros, false) + ); + + result +} + +#[derive(Copy, Clone, Debug)] +pub(crate) enum VerbosityLevel { + None, + Verbose, + VeryVerbose, + VeryVeryVerbose, +} + +impl From for VerbosityLevel { + fn from(value: u8) -> Self { + match value { + 0 => VerbosityLevel::None, + 1 => VerbosityLevel::Verbose, + 2 => VerbosityLevel::VeryVerbose, + 3 => VerbosityLevel::VeryVeryVerbose, + _ => VerbosityLevel::VeryVeryVerbose, + } + } +} + +impl VerbosityLevel { + /// Maps this verbosity level to a log filter + pub fn into_filter(self) -> Option { + match self { + VerbosityLevel::None => None, + VerbosityLevel::Verbose => Some(log::LevelFilter::Info), + VerbosityLevel::VeryVerbose => Some(log::LevelFilter::Debug), + VerbosityLevel::VeryVeryVerbose => Some(log::LevelFilter::Trace), + } + } +} diff --git a/splashsurf/src/lib.rs b/splashsurf/src/lib.rs new file mode 100644 index 00000000..228a56b3 --- /dev/null +++ b/splashsurf/src/lib.rs @@ -0,0 +1,11 @@ +pub mod cli; +mod convert; +mod io; +mod reconstruction; +#[macro_use] +mod allocator; +mod logging; +#[cfg(test)] +mod tests; + +pub(crate) use register_counting_allocator; diff --git a/splashsurf/src/logging.rs b/splashsurf/src/logging.rs index 47aeabc0..89900fff 100644 --- a/splashsurf/src/logging.rs +++ b/splashsurf/src/logging.rs @@ -1,14 +1,15 @@ -use anyhow::anyhow; use std::env; use std::io::Write; -use crate::VerbosityLevel; +use anyhow::anyhow; use fern::Output; use indicatif::{ProgressBar, WeakProgressBar}; use log::{error, info}; use once_cell::sync::Lazy; use parking_lot::RwLock; +use crate::cli::VerbosityLevel; + #[derive(Debug)] pub struct ProgressHandler(T); @@ -152,7 +153,10 @@ where pub(crate) fn log_program_info() { info!( "{} v{} ({})", - env!("CARGO_BIN_NAME"), + //env!("CARGO_BIN_NAME"), + std::env::args() + .next() + .unwrap_or_else(|| "splashsurf".to_string()), env!("CARGO_PKG_VERSION"), env!("CARGO_PKG_NAME") ); diff --git a/splashsurf/src/main.rs b/splashsurf/src/main.rs index bd979164..73762427 100644 --- a/splashsurf/src/main.rs +++ b/splashsurf/src/main.rs @@ -1,8 +1,4 @@ -//! The `splashsurf` surface reconstruction CLI. -//! -//! For documentation of the CLI see the [README](https://github.com/InteractiveComputerGraphics/splashsurf) in the project repository. -//! The reconstruction procedure and other internals of the CLI are provided by the [`splashsurf_lib`] crate. - +pub mod cli; mod convert; mod io; mod reconstruction; @@ -12,52 +8,7 @@ mod logging; #[cfg(test)] mod tests; -use crate::allocator::GetPeakAllocatedMemory; -use anyhow::Context; -use clap::Parser; -use log::info; - -// Register allocator to track memory usage, might decrease performance if enabled -register_counting_allocator!(GLOBAL_ALLOCATOR, enable = false); - -// TODO: Use different logging approach when processing multiple files in parallel -// TODO: Add start and end index for input file sequences -// TODO: Does coarse_prof work with multiple threads? -// TODO: Check if all paths supplied using the cmd args are valid -// TODO: Clean up the parameter structs and conversions - -static HELP_TEMPLATE: &str = "{before-help}{name} (v{version}) - {author-with-newline}{about-with-newline}\n{usage-heading} {usage}\n\n{all-args}{after-help}"; - -#[derive(Clone, Debug, clap::Parser)] -#[command( - name = "splashsurf", - author = "Fabian Löschner ", - about = "Surface reconstruction for particle data from SPH simulations (https://github.com/InteractiveComputerGraphics/splashsurf)", - version, - propagate_version = true, - help_template = HELP_TEMPLATE, -)] -struct CommandlineArgs { - /// Enable quiet mode (no output except for severe panic messages), overrides verbosity level - #[arg(long, short = 'q', global = true)] - quiet: bool, - /// Print more verbose output, use multiple "v"s for even more verbose output (-v, -vv) - #[arg(short, action = clap::ArgAction::Count, global = true)] - verbosity: u8, - /// Subcommands - #[command(subcommand)] - subcommand: Subcommand, -} - -#[derive(Clone, Debug, clap::Parser)] -enum Subcommand { - /// Reconstruct a surface from particle data - #[command(help_template = HELP_TEMPLATE)] - Reconstruct(reconstruction::ReconstructSubcommandArgs), - /// Convert particle or mesh files between different file formats - #[command(help_template = HELP_TEMPLATE)] - Convert(convert::ConvertSubcommandArgs), -} +pub(crate) use register_counting_allocator; fn main() -> Result<(), anyhow::Error> { /* @@ -68,83 +19,10 @@ fn main() -> Result<(), anyhow::Error> { })); */ - std::process::exit(match run_splashsurf() { - Ok(_) => 0, - Err(err) => { - logging::log_error(&err); - 1 - } - }); -} - -fn run_splashsurf() -> Result<(), anyhow::Error> { - let cmd_args = CommandlineArgs::parse(); - - let verbosity = VerbosityLevel::from(cmd_args.verbosity); - let is_quiet = cmd_args.quiet; - - logging::initialize_logging(verbosity, is_quiet).context("Failed to initialize logging")?; - logging::log_program_info(); - - // Delegate to subcommands - let result = match &cmd_args.subcommand { - Subcommand::Reconstruct(cmd_args) => reconstruction::reconstruct_subcommand(cmd_args), - Subcommand::Convert(cmd_args) => convert::convert_subcommand(cmd_args), - }; - - // Write coarse_prof stats using log::info - info!("Timings:"); - splashsurf_lib::profiling::write_to_string() - .unwrap() - .split("\n") - .filter(|l| !l.is_empty()) - .for_each(|l| info!("{}", l)); - - // Print memory stats if available - if let Some(peak_allocation_bytes) = GLOBAL_ALLOCATOR.get_peak_allocated_memory() { - info!( - "Peak memory usage: {} bytes ({:.2}MB)", - peak_allocation_bytes, - peak_allocation_bytes as f64 * 1e-6 - ); - } - - info!( - "Finished at {}.", - chrono::Local::now().to_rfc3339_opts(chrono::SecondsFormat::Micros, false) + std::process::exit( + match cli::run_splashsurf(std::env::args_os().collect::>().as_slice()) { + Ok(_) => 0, + Err(_) => 1, + }, ); - - result -} - -#[derive(Copy, Clone, Debug)] -enum VerbosityLevel { - None, - Verbose, - VeryVerbose, - VeryVeryVerbose, -} - -impl From for VerbosityLevel { - fn from(value: u8) -> Self { - match value { - 0 => VerbosityLevel::None, - 1 => VerbosityLevel::Verbose, - 2 => VerbosityLevel::VeryVerbose, - 3 => VerbosityLevel::VeryVeryVerbose, - _ => VerbosityLevel::VeryVeryVerbose, - } - } -} - -impl VerbosityLevel { - /// Maps this verbosity level to a log filter - fn into_filter(self) -> Option { - match self { - VerbosityLevel::None => None, - VerbosityLevel::Verbose => Some(log::LevelFilter::Info), - VerbosityLevel::VeryVerbose => Some(log::LevelFilter::Debug), - VerbosityLevel::VeryVeryVerbose => Some(log::LevelFilter::Trace), - } - } } From 2d4aeb486ff003486415944cabed1a59c5cfa032 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20L=C3=B6schner?= Date: Sat, 7 Jun 2025 18:50:29 +0200 Subject: [PATCH 3/8] Register pysplashsurf script --- pysplashsurf/Cargo.lock | 708 ++++++++++++++++++++++++-- pysplashsurf/Cargo.toml | 3 +- pysplashsurf/pyproject.toml | 3 + pysplashsurf/pysplashsurf/__init__.py | 4 + pysplashsurf/src/lib.rs | 23 + 5 files changed, 701 insertions(+), 40 deletions(-) diff --git a/pysplashsurf/Cargo.lock b/pysplashsurf/Cargo.lock index e22f2f4b..e72e52cd 100644 --- a/pysplashsurf/Cargo.lock +++ b/pysplashsurf/Cargo.lock @@ -2,6 +2,21 @@ # It is not intended for manual editing. version = 4 +[[package]] +name = "adler2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" + +[[package]] +name = "aho-corasick" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" +dependencies = [ + "memchr 2.7.4", +] + [[package]] name = "android-tzdata" version = "0.1.1" @@ -17,6 +32,62 @@ dependencies = [ "libc", ] +[[package]] +name = "anstream" +version = "0.6.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "301af1932e46185686725e0fad2f8f2aa7da69dd70bf6ecc44d6b703844a3933" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is_terminal_polyfill", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "862ed96ca487e809f1c8e5a8447f6ee2cf102f846893800b20cebdf541fc6bbd" + +[[package]] +name = "anstyle-parse" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e7644824f0aa2c7b9384579234ef10eb7efb6a0deb83f9630a49594dd9c15c2" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c8bdeb6047d8983be085bab0ba1472e6dc604e7041dbf6fcd5e71523014fae9" +dependencies = [ + "windows-sys", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "403f75924867bb1033c59fbf0797484329750cfbe3c4325cd33127941fabc882" +dependencies = [ + "anstyle", + "once_cell_polyfill", + "windows-sys", +] + +[[package]] +name = "any_ascii" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70033777eb8b5124a81a1889416543dddef2de240019b674c81285a2635a7e1e" + [[package]] name = "anyhow" version = "1.0.98" @@ -44,6 +115,12 @@ version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" +[[package]] +name = "base64" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" + [[package]] name = "bitflags" version = "2.9.1" @@ -56,6 +133,12 @@ version = "3.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "793db76d6187cd04dff33004d8e6c9cc4e05cd330500379d2394209271b4aeee" +[[package]] +name = "bytecount" +version = "0.6.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "175812e0be2bccb6abe50bb8d566126198344f707e304f45c648fd8f2cc0365e" + [[package]] name = "bytemuck" version = "1.23.0" @@ -97,6 +180,19 @@ dependencies = [ "serde", ] +[[package]] +name = "cargo_metadata" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4acbb09d9ee8e23699b9634375c72795d095bf268439da88562cf9b501f181fa" +dependencies = [ + "camino", + "cargo-platform", + "semver", + "serde", + "serde_json", +] + [[package]] name = "cargo_metadata" version = "0.19.2" @@ -140,12 +236,80 @@ dependencies = [ "windows-link", ] +[[package]] +name = "clap" +version = "4.5.39" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd60e63e9be68e5fb56422e397cf9baddded06dae1d2e523401542383bc72a9f" +dependencies = [ + "clap_builder", + "clap_derive", +] + +[[package]] +name = "clap_builder" +version = "4.5.39" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89cc6392a1f72bbeb820d71f32108f61fdaf18bc526e1d23954168a67759ef51" +dependencies = [ + "anstream", + "anstyle", + "clap_lex", + "strsim", +] + +[[package]] +name = "clap_derive" +version = "4.5.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09176aae279615badda0765c0c0b3f6ed53f4709118af73cf4655d85d1530cd7" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn 2.0.101", +] + +[[package]] +name = "clap_lex" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f46ad14479a25103f283c0f10005961cf086d8dc42205bb44c46ac563475dca6" + +[[package]] +name = "colorchoice" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b05b61dc5112cbb17e4b6cd61790d9845d13888356391624cbe7e41efeac1e75" + +[[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", + "windows-sys", +] + [[package]] name = "core-foundation-sys" version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" +[[package]] +name = "crc32fast" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" +dependencies = [ + "cfg-if", +] + [[package]] name = "crossbeam-deque" version = "0.8.6" @@ -191,12 +355,62 @@ version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" +[[package]] +name = "encode_unicode" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34aa73646ffb006b8f5147f3dc182bd4bcb190227ce861fc4a4844bf8e3cb2c0" + [[package]] name = "equivalent" version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" +[[package]] +name = "errno" +version = "0.3.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cea14ef9355e3beab063703aa9dab15afd25f0667c341310c1e5274bb1d0da18" +dependencies = [ + "libc", + "windows-sys", +] + +[[package]] +name = "error-chain" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d2f06b9cac1506ece98fe3231e3cc9c4410ec3d5b1f24ae1c8946f0742cdefc" +dependencies = [ + "version_check", +] + +[[package]] +name = "fastrand" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" + +[[package]] +name = "fern" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4316185f709b23713e41e3195f90edef7fb00c3ed4adc79769cf09cc762a3b29" +dependencies = [ + "log", +] + +[[package]] +name = "flate2" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a3d7db9596fecd151c5f638c0ee5d5bd487b6e0ea232e5dc96d5250f6f94b1d" +dependencies = [ + "crc32fast", + "miniz_oxide", +] + [[package]] name = "fxhash" version = "0.2.1" @@ -214,9 +428,27 @@ checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592" dependencies = [ "cfg-if", "libc", - "wasi", + "wasi 0.11.0+wasi-snapshot-preview1", +] + +[[package]] +name = "getrandom" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26145e563e54f2cadc477553f1ec5ee650b00862f0a58bcd12cbdc5f0ea2d2f4" +dependencies = [ + "cfg-if", + "libc", + "r-efi", + "wasi 0.14.2+wasi-0.2.4", ] +[[package]] +name = "glob" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" + [[package]] name = "hash32" version = "0.3.1" @@ -234,9 +466,9 @@ checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" [[package]] name = "hashbrown" -version = "0.15.3" +version = "0.15.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84b26c544d002229e640969970a2e74021aadf6e2f96372b9c58eff97de08eb3" +checksum = "5971ac85611da7067dbfcabef3c70ebb5606018acd9e2a3903a0da507521e0d5" [[package]] name = "heapless" @@ -285,7 +517,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cea70ddb795996207ad57735b50c5982d8844f38ba9ee5f1aedcfb708a2aa11e" dependencies = [ "equivalent", - "hashbrown 0.15.3", + "hashbrown 0.15.4", +] + +[[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", + "web-time", ] [[package]] @@ -303,6 +548,12 @@ dependencies = [ "rustversion", ] +[[package]] +name = "is_terminal_polyfill" +version = "1.70.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" + [[package]] name = "itertools" version = "0.13.0" @@ -337,6 +588,15 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "lexical-sort" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c09e4591611e231daf4d4c685a66cb0410cc1e502027a20ae55f2bb9e997207a" +dependencies = [ + "any_ascii", +] + [[package]] name = "libc" version = "0.2.172" @@ -349,6 +609,18 @@ version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f9fbbcab51052fe104eb5e5d351cf728d30a5be1fe14d9be8a3b097481fb97de" +[[package]] +name = "linked-hash-map" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" + +[[package]] +name = "linux-raw-sys" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd945864f07fe9f5371a27ad7b52a172b4b499999f1d97574c9fa68373937e12" + [[package]] name = "lock_api" version = "0.4.13" @@ -365,6 +637,23 @@ version = "0.4.27" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" +[[package]] +name = "lz4_flex" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05304f8e67dfc93d1b4b990137fd1a7a4c6ad44b60a9c486c8c4486f9d2027ae" + +[[package]] +name = "lzma-sys" +version = "0.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5fda04ab3764e6cde78b9974eec4f779acaba7c4e84b36eca3cf77c581b85d27" +dependencies = [ + "cc", + "libc", + "pkg-config", +] + [[package]] name = "maplit" version = "1.0.2" @@ -381,6 +670,15 @@ dependencies = [ "rawpointer", ] +[[package]] +name = "memchr" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "148fab2e51b4f1cfc66da2a7c32981d1d3c083a803978268bb11fe4b86925e7a" +dependencies = [ + "libc", +] + [[package]] name = "memchr" version = "2.7.4" @@ -396,6 +694,15 @@ dependencies = [ "autocfg", ] +[[package]] +name = "miniz_oxide" +version = "0.8.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3be647b768db090acb35d5ec5db2b0e1f1de11133ca123b9eacf5137868f892a" +dependencies = [ + "adler2", +] + [[package]] name = "nalgebra" version = "0.33.2" @@ -441,6 +748,24 @@ dependencies = [ "rawpointer", ] +[[package]] +name = "nom" +version = "3.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05aec50c70fd288702bcd93284a8444607f3292dbdf2a30de5ea5dcdbe72287b" +dependencies = [ + "memchr 1.0.2", +] + +[[package]] +name = "nom" +version = "8.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df9761775871bdef83bee530e60050f7e54b1105350d6884eb0fb4f46c2f9405" +dependencies = [ + "memchr 2.7.4", +] + [[package]] name = "num-bigint" version = "0.4.6" @@ -460,6 +785,17 @@ dependencies = [ "num-traits", ] +[[package]] +name = "num-derive" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "876a53fff98e03a936a674b29568b0e605f06b29372c2489ff4de23f1949743d" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "num-integer" version = "0.1.46" @@ -490,6 +826,12 @@ dependencies = [ "libm", ] +[[package]] +name = "number_prefix" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3" + [[package]] name = "numeric_literals" version = "0.2.0" @@ -512,7 +854,7 @@ dependencies = [ "num-integer", "num-traits", "pyo3", - "pyo3-build-config 0.25.0", + "pyo3-build-config", "rustc-hash", ] @@ -522,6 +864,12 @@ version = "1.21.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" +[[package]] +name = "once_cell_polyfill" +version = "1.70.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4895175b425cb1f87721b59f0f286c2092bd4af812243672510e1ac53e2e0ad" + [[package]] name = "parking_lot" version = "0.12.4" @@ -551,6 +899,51 @@ version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" +[[package]] +name = "peg" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f76678828272f177ac33b7e2ac2e3e73cc6c1cd1e3e387928aa69562fa51367" +dependencies = [ + "peg-macros", + "peg-runtime", +] + +[[package]] +name = "peg-macros" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "636d60acf97633e48d266d7415a9355d4389cea327a193f87df395d88cd2b14d" +dependencies = [ + "peg-runtime", + "proc-macro2", + "quote", +] + +[[package]] +name = "peg-runtime" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9555b1514d2d99d78150d3c799d4c357a3e2c2a8062cd108e93a06d9057629c5" + +[[package]] +name = "pkg-config" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" + +[[package]] +name = "ply-rs" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbadf9cb4a79d516de4c64806fe64ffbd8161d1ac685d000be789fb628b88963" +dependencies = [ + "byteorder", + "linked-hash-map", + "peg", + "skeptic", +] + [[package]] name = "portable-atomic" version = "1.11.1" @@ -584,33 +977,35 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "pulldown-cmark" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57206b407293d2bcd3af849ce869d52068623f19e1b5ff8e8778e3309439682b" +dependencies = [ + "bitflags", + "memchr 2.7.4", + "unicase", +] + [[package]] name = "pyo3" version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f239d656363bcee73afef85277f1b281e8ac6212a1d42aa90e55b90ed43c47a4" dependencies = [ + "anyhow", "indoc", "libc", "memoffset", "once_cell", "portable-atomic", - "pyo3-build-config 0.25.0", + "pyo3-build-config", "pyo3-ffi", "pyo3-macros", "unindent", ] -[[package]] -name = "pyo3-build-config" -version = "0.24.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99636d423fa2ca130fa5acde3059308006d46f98caac629418e53f7ebb1e9999" -dependencies = [ - "once_cell", - "target-lexicon", -] - [[package]] name = "pyo3-build-config" version = "0.25.0" @@ -628,7 +1023,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc95a2e67091e44791d4ea300ff744be5293f394f1bafd9f78c080814d35956e" dependencies = [ "libc", - "pyo3-build-config 0.25.0", + "pyo3-build-config", ] [[package]] @@ -651,19 +1046,19 @@ checksum = "9dff85ebcaab8c441b0e3f7ae40a6963ecea8a9f5e74f647e33fcf5ec9a1e89e" dependencies = [ "heck", "proc-macro2", - "pyo3-build-config 0.25.0", + "pyo3-build-config", "quote", "syn 2.0.101", ] [[package]] name = "pyo3-stub-gen" -version = "0.9.0" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61ebbf208fc5d7af8f5365b74204202996c2ec4dca38ee811486561d0da5c260" +checksum = "2da99110990aded329ea6e5e6567bcab1577a2109253cebbd54d23cd61951752" dependencies = [ "anyhow", - "cargo_metadata", + "cargo_metadata 0.19.2", "chrono", "either", "indexmap", @@ -674,7 +1069,7 @@ dependencies = [ "num-complex", "numpy", "pyo3", - "pyo3-build-config 0.24.2", + "pyo3-build-config", "pyo3-stub-gen-derive", "semver", "serde", @@ -683,9 +1078,9 @@ dependencies = [ [[package]] name = "pyo3-stub-gen-derive" -version = "0.9.0" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23b582d0ff1c7c3bff13e8a04a1e41f783a6b8135531362c748ed655fbff14cb" +checksum = "d9a036cb01c21f3014989614036a69f1467bfbfde608a37f98eaefb016b1abfe" dependencies = [ "heck", "proc-macro2", @@ -706,9 +1101,20 @@ dependencies = [ "pyo3", "pyo3-stub-gen", "rayon", + "splashsurf", "splashsurf_lib", ] +[[package]] +name = "quick-xml" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8533f14c8382aaad0d592c812ac3b826162128b65662331e1127b45c3d18536b" +dependencies = [ + "memchr 2.7.4", + "serde", +] + [[package]] name = "quote" version = "1.0.40" @@ -718,6 +1124,12 @@ dependencies = [ "proc-macro2", ] +[[package]] +name = "r-efi" +version = "5.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74765f6d916ee2faa39bc8e68e4f3ed8949b48cccdac59983d287a7cb71ce9c5" + [[package]] name = "rand" version = "0.8.5" @@ -745,7 +1157,7 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom", + "getrandom 0.2.16", ] [[package]] @@ -793,6 +1205,35 @@ dependencies = [ "bitflags", ] +[[package]] +name = "regex" +version = "1.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" +dependencies = [ + "aho-corasick", + "memchr 2.7.4", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" +dependencies = [ + "aho-corasick", + "memchr 2.7.4", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" + [[package]] name = "rstar" version = "0.12.2" @@ -810,6 +1251,19 @@ version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d" +[[package]] +name = "rustix" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c71e83d6afe7ff64890ec6b71d6a69bb8a610ab78ce364b3352876bb4c801266" +dependencies = [ + "bitflags", + "errno", + "libc", + "linux-raw-sys", + "windows-sys", +] + [[package]] name = "rustversion" version = "1.0.21" @@ -831,6 +1285,15 @@ dependencies = [ "bytemuck", ] +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + [[package]] name = "scopeguard" version = "1.2.0" @@ -873,16 +1336,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" dependencies = [ "itoa", - "memchr", + "memchr 2.7.4", "ryu", "serde", ] [[package]] name = "serde_spanned" -version = "0.6.8" +version = "0.6.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87607cb1398ed59d48732e575a4c28a7a8ebf2454b964fe3f224f2afc07909e1" +checksum = "bf41e0cfaf7226dca15e8197172c295a782857fcb97fad1808a166870dee75a3" dependencies = [ "serde", ] @@ -906,11 +1369,46 @@ dependencies = [ "wide", ] +[[package]] +name = "skeptic" +version = "0.13.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16d23b015676c90a0f01c197bfdc786c20342c73a0afdda9025adb0bc42940a8" +dependencies = [ + "bytecount", + "cargo_metadata 0.14.2", + "error-chain", + "glob", + "pulldown-cmark", + "tempfile", + "walkdir", +] + [[package]] name = "smallvec" -version = "1.15.0" +version = "1.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8917285742e9f3e1683f0a9c4e6b57960b7314d0b08d30d1ecd426713ee2eee9" +checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" + +[[package]] +name = "splashsurf" +version = "0.11.0" +dependencies = [ + "anyhow", + "bytemuck", + "chrono", + "clap", + "fern", + "indicatif", + "lexical-sort", + "log", + "once_cell", + "parking_lot", + "rayon", + "regex", + "splashsurf_lib", + "walkdir", +] [[package]] name = "splashsurf_lib" @@ -922,18 +1420,23 @@ dependencies = [ "bytemuck", "bytemuck_derive", "dashmap", + "flate2", "fxhash", "itertools 0.14.0", "log", "nalgebra", + "nom 8.0.0", "num-integer", "num-traits", "numeric_literals", "parking_lot", + "ply-rs", "rayon", "rstar", + "serde_json", "thiserror", "thread_local", + "vtkio", ] [[package]] @@ -942,6 +1445,12 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + [[package]] name = "syn" version = "1.0.109" @@ -970,6 +1479,19 @@ version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e502f78cdbb8ba4718f566c418c52bc729126ffd16baee5baa718cf25dd5a69a" +[[package]] +name = "tempfile" +version = "3.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8a64e3985349f2441a1a9ef0b853f869006c3855f2cda6862a94d26ebb9d6a1" +dependencies = [ + "fastrand", + "getrandom 0.3.3", + "once_cell", + "rustix", + "windows-sys", +] + [[package]] name = "thiserror" version = "2.0.12" @@ -1002,9 +1524,9 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.22" +version = "0.8.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05ae329d1f08c4d17a59bed7ff5b5a769d062e64a62d34a3261b219e62cd5aae" +checksum = "dc1beb996b9d83529a9e75c17a1686767d148d70663143c7854d8b4a09ced362" dependencies = [ "serde", "serde_spanned", @@ -1014,18 +1536,18 @@ dependencies = [ [[package]] name = "toml_datetime" -version = "0.6.9" +version = "0.6.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3da5db5a963e24bc68be8b17b6fa82814bb22ee8660f192bb182771d498f09a3" +checksum = "22cddaf88f4fbc13c51aebbf5f8eceb5c7c5a9da2ac40a13519eb5b0a0e8f11c" dependencies = [ "serde", ] [[package]] name = "toml_edit" -version = "0.22.26" +version = "0.22.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "310068873db2c5b3e7659d2cc35d21855dbafa50d1ce336397c666e3cb08137e" +checksum = "41fe8c660ae4257887cf66394862d21dbca4a6ddd26f04a3560410406a2f819a" dependencies = [ "indexmap", "serde", @@ -1037,9 +1559,9 @@ dependencies = [ [[package]] name = "toml_write" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfb942dfe1d8e29a7ee7fcbde5bd2b9a25fb89aa70caea2eba3bee836ff41076" +checksum = "5d99f8c9a7727884afe522e9bd5edbfc91a3312b36a77b5fb8926e4c31a41801" [[package]] name = "typenum" @@ -1047,24 +1569,86 @@ version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f" +[[package]] +name = "unicase" +version = "2.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75b844d17643ee918803943289730bec8aac480150456169e647ed0b576ba539" + [[package]] name = "unicode-ident" version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" +[[package]] +name = "unicode-width" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fc81956842c57dac11422a97c3b8195a1ff727f06e85c84ed2e8aa277c9a0fd" + [[package]] name = "unindent" version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7264e107f553ccae879d21fbea1d6724ac785e8c3bfc762137959b5802826ef3" +[[package]] +name = "utf8parse" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" + +[[package]] +name = "version_check" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" + +[[package]] +name = "vtkio" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abbe89e5b97b472d57abeb02755a06d75b28d2df7d1fe3df5baf032281a65c16" +dependencies = [ + "base64", + "bytemuck", + "byteorder", + "flate2", + "lz4_flex", + "nom 3.2.1", + "num-derive", + "num-traits", + "quick-xml", + "serde", + "xz2", +] + +[[package]] +name = "walkdir" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" +dependencies = [ + "same-file", + "winapi-util", +] + [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" +[[package]] +name = "wasi" +version = "0.14.2+wasi-0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9683f9a5a998d873c0d21fcbe3c083009670149a8fab228644b8bd36b2c48cb3" +dependencies = [ + "wit-bindgen-rt", +] + [[package]] name = "wasm-bindgen" version = "0.2.100" @@ -1123,6 +1707,16 @@ dependencies = [ "unicode-ident", ] +[[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 = "wide" version = "0.7.32" @@ -1133,6 +1727,15 @@ dependencies = [ "safe_arch", ] +[[package]] +name = "winapi-util" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" +dependencies = [ + "windows-sys", +] + [[package]] name = "windows-core" version = "0.61.2" @@ -1192,6 +1795,15 @@ dependencies = [ "windows-link", ] +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets", +] + [[package]] name = "windows-targets" version = "0.52.6" @@ -1262,7 +1874,25 @@ version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c06928c8748d81b05c9be96aad92e1b6ff01833332f281e8cfca3be4b35fc9ec" dependencies = [ - "memchr", + "memchr 2.7.4", +] + +[[package]] +name = "wit-bindgen-rt" +version = "0.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f42320e61fe2cfd34354ecb597f86f413484a798ba44a8ca1165c58d42da6c1" +dependencies = [ + "bitflags", +] + +[[package]] +name = "xz2" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "388c44dc09d76f1536602ead6d325eb532f5c122f17782bd57fb47baeeb767e2" +dependencies = [ + "lzma-sys", ] [[package]] diff --git a/pysplashsurf/Cargo.toml b/pysplashsurf/Cargo.toml index 859c6274..96e69b92 100644 --- a/pysplashsurf/Cargo.toml +++ b/pysplashsurf/Cargo.toml @@ -6,9 +6,10 @@ edition = "2018" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -pyo3 = {version = "0.25.0"} +pyo3 = {version = "0.25.0", features = ["anyhow"]} numpy = "0.25.0" ndarray = "0.16.1" +splashsurf = { path = "../splashsurf" } splashsurf_lib = { path = "../splashsurf_lib" } fxhash = "0.2.1" bytemuck = { version = "1.23.0", features = ["extern_crate_alloc"] } diff --git a/pysplashsurf/pyproject.toml b/pysplashsurf/pyproject.toml index 7d057087..158b7243 100644 --- a/pysplashsurf/pyproject.toml +++ b/pysplashsurf/pyproject.toml @@ -31,6 +31,9 @@ dependencies = ["numpy"] [project.optional-dependencies] meshio = ["meshio"] +[project.scripts] +pysplashsurf = "pysplashsurf:run_pysplashsurf" + [project.urls] homepage = "https://splashsurf.physics-simulation.org/" repository = "https://github.com/InteractiveComputerGraphics/splashsurf.git" diff --git a/pysplashsurf/pysplashsurf/__init__.py b/pysplashsurf/pysplashsurf/__init__.py index 3ec613fa..07a8ca93 100644 --- a/pysplashsurf/pysplashsurf/__init__.py +++ b/pysplashsurf/pysplashsurf/__init__.py @@ -1,6 +1,10 @@ from .pysplashsurf import * from . import bgeo import numpy as np +import sys + +def run_pysplashsurf(): + run_splashsurf(sys.argv) def push_point_attribute(self, name: str, data: np.ndarray, real_type): """Add a point attribute to the mesh""" diff --git a/pysplashsurf/src/lib.rs b/pysplashsurf/src/lib.rs index 1754694d..bbe74e74 100644 --- a/pysplashsurf/src/lib.rs +++ b/pysplashsurf/src/lib.rs @@ -1,6 +1,9 @@ use pyo3::prelude::*; +use pyo3::types::{PyList, PyString}; use pyo3_stub_gen::define_stub_info_gatherer; +use splashsurf::cli; + mod aabb; mod mesh; mod sph_interpolation; @@ -113,6 +116,26 @@ fn pysplashsurf(m: &Bound<'_, PyModule>) -> PyResult<()> { m )?); + let _ = m.add_function(wrap_pyfunction!(run_splashsurf_py, m)?); + + Ok(()) +} + +#[pyfunction] +#[pyo3(name = "run_splashsurf")] +fn run_splashsurf_py<'py>(args: Bound<'py, PyList>) -> PyResult<()> { + let args = args + .iter() + .map(|arg| { + arg.downcast::() + .expect("Argument wasn't a string") + .extract() + .unwrap() + }) + .map(|s: String| s.into()) + .collect::>(); + // TODO: Change interface such that OsString is not needed + cli::run_splashsurf(&args)?; Ok(()) } From 36b90d9957891b23611a5ea15e1cbb5a87dcde59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20L=C3=B6schner?= Date: Sun, 8 Jun 2025 12:12:18 +0200 Subject: [PATCH 4/8] Fix tests --- pysplashsurf/src/lib.rs | 18 +-- splashsurf/src/cli.rs | 203 ++++++++++++++++++++++++++++++- splashsurf/src/lib.rs | 2 - splashsurf/src/main.rs | 2 - splashsurf/src/reconstruction.rs | 16 +-- splashsurf/src/tests/cli.rs | 144 ---------------------- splashsurf/src/tests/mod.rs | 1 - 7 files changed, 208 insertions(+), 178 deletions(-) delete mode 100644 splashsurf/src/tests/cli.rs delete mode 100644 splashsurf/src/tests/mod.rs diff --git a/pysplashsurf/src/lib.rs b/pysplashsurf/src/lib.rs index bbe74e74..6ab5589e 100644 --- a/pysplashsurf/src/lib.rs +++ b/pysplashsurf/src/lib.rs @@ -124,18 +124,12 @@ fn pysplashsurf(m: &Bound<'_, PyModule>) -> PyResult<()> { #[pyfunction] #[pyo3(name = "run_splashsurf")] fn run_splashsurf_py<'py>(args: Bound<'py, PyList>) -> PyResult<()> { - let args = args - .iter() - .map(|arg| { - arg.downcast::() - .expect("Argument wasn't a string") - .extract() - .unwrap() - }) - .map(|s: String| s.into()) - .collect::>(); - // TODO: Change interface such that OsString is not needed - cli::run_splashsurf(&args)?; + cli::run_splashsurf(args.iter().map(|arg| { + arg.downcast::() + .expect("Argument wasn't a string") + .extract::() + .unwrap() + }))?; Ok(()) } diff --git a/splashsurf/src/cli.rs b/splashsurf/src/cli.rs index c71d26bd..02853f92 100644 --- a/splashsurf/src/cli.rs +++ b/splashsurf/src/cli.rs @@ -50,11 +50,61 @@ enum Subcommand { Convert(convert::ConvertSubcommandArgs), } -pub fn run_splashsurf(args: &[std::ffi::OsString]) -> Result<(), anyhow::Error> { +/// A simple on/off switch for command line arguments. +/// +/// For example an argument defined as: +/// ```rust ignore +/// /// Enable the use of double precision for all computations +/// #[arg( +/// long, +/// default_value = "off", +/// value_name = "off|on", +/// ignore_case = true, +/// require_equals = true +/// )] +/// pub double_precision: Switch, +/// ``` +/// can be used in the CLI as `--double-precision=on` or `--double-precision=off`. +#[derive(Copy, Clone, Debug, PartialEq, Eq, clap::ValueEnum)] +pub(crate) enum Switch { + Off, + On, +} + +impl Switch { + pub(crate) fn into_bool(self) -> bool { + match self { + Switch::Off => false, + Switch::On => true, + } + } +} + +/// Runs the splashsurf CLI with the provided command line arguments. +/// +/// This function behaves like the binary `splashsurf` command line tool including output to stdout and stderr. +/// Note that the first argument is always ignored as it is the binary name when called using `std::env::args()` +/// from the command line: +/// ``` +/// splashsurf::cli::run_splashsurf([".", "--version"]); +/// ``` +/// If no placeholder for the binary name is provided it will return an error (and print a help message): +/// ```should_panic +/// splashsurf::cli::run_splashsurf(["--version"]); +/// ``` +pub fn run_splashsurf(args: I) -> Result<(), anyhow::Error> +where + I: IntoIterator, + T: Into + Clone, +{ run_splashsurf_impl(args).inspect_err(logging::log_error) } -fn run_splashsurf_impl(args: &[std::ffi::OsString]) -> Result<(), anyhow::Error> { +fn run_splashsurf_impl(args: I) -> Result<(), anyhow::Error> +where + I: IntoIterator, + T: Into + Clone, +{ let cmd_args = CommandlineArgs::parse_from(args); let verbosity = VerbosityLevel::from(cmd_args.verbosity); @@ -125,3 +175,152 @@ impl VerbosityLevel { } } } + +#[cfg(test)] +mod cli_args_tests { + use super::*; + + #[test] + fn verify_main_cli() { + use clap::CommandFactory; + CommandlineArgs::command().debug_assert() + } + + #[test] + fn verify_reconstruct_cli() { + use clap::CommandFactory; + crate::reconstruction::ReconstructSubcommandArgs::command().debug_assert() + } + + #[test] + fn verify_convert_cli() { + use clap::CommandFactory; + crate::convert::ConvertSubcommandArgs::command().debug_assert() + } + + #[test] + fn test_main_cli() { + use clap::Parser; + + // Display help + assert_eq!( + CommandlineArgs::try_parse_from(["splashsurf", "--help",]) + .expect_err("this command is supposed to fail") + .kind(), + clap::error::ErrorKind::DisplayHelp + ); + + // Display help, reconstruct + assert_eq!( + CommandlineArgs::try_parse_from(["splashsurf", "reconstruct", "--help",]) + .expect_err("this command is supposed to fail") + .kind(), + clap::error::ErrorKind::DisplayHelp + ); + + // Display help, convert + assert_eq!( + CommandlineArgs::try_parse_from(["splashsurf", "convert", "--help",]) + .expect_err("this command is supposed to fail") + .kind(), + clap::error::ErrorKind::DisplayHelp + ); + + // Minimum arguments: input file + if let Subcommand::Reconstruct(rec_args) = CommandlineArgs::try_parse_from([ + "splashsurf", + "reconstruct", + "test.vtk", + "--particle-radius=0.05", + "--smoothing-length=3.0", + "--cube-size=0.75", + ]) + .expect("this command is supposed to work") + .subcommand + { + assert_eq!( + rec_args.input_file_or_sequence, + std::path::PathBuf::from("test.vtk") + ); + }; + + // Test on/off switch + if let Subcommand::Reconstruct(rec_args) = CommandlineArgs::try_parse_from([ + "splashsurf", + "reconstruct", + "test.vtk", + "--particle-radius=0.05", + "--smoothing-length=3.0", + "--cube-size=0.75", + "--normals=on", + ]) + .expect("this command is supposed to work") + .subcommand + { + assert_eq!(rec_args.normals, Switch::On); + }; + + if let Subcommand::Reconstruct(rec_args) = CommandlineArgs::try_parse_from([ + "splashsurf", + "reconstruct", + "test.vtk", + "--particle-radius=0.05", + "--smoothing-length=3.0", + "--cube-size=0.75", + "--normals=off", + ]) + .expect("this command is supposed to work") + .subcommand + { + assert_eq!(rec_args.normals, Switch::Off); + }; + + // Test domain min/max: correct values + if let Subcommand::Reconstruct(rec_args) = CommandlineArgs::try_parse_from([ + "splashsurf", + "reconstruct", + "test.vtk", + "--particle-radius=0.05", + "--smoothing-length=3.0", + "--cube-size=0.75", + "--particle-aabb-min", + "-1.0", + "1.0", + "-1.0", + "--particle-aabb-max", + "-2.0", + "2.0", + "-2.0", + ]) + .expect("this command is supposed to work") + .subcommand + { + assert_eq!(rec_args.particle_aabb_min, Some(vec![-1.0, 1.0, -1.0])); + assert_eq!(rec_args.particle_aabb_max, Some(vec![-2.0, 2.0, -2.0])); + }; + + // Test domain min/max: too many values + assert_eq!( + CommandlineArgs::try_parse_from([ + "splashsurf", + "reconstruct", + "test.vtk", + "--particle-radius=0.05", + "--smoothing-length=3.0", + "--cube-size=0.75", + "--particle-aabb-min", + "-1.0", + "1.0", + "-1.0", + "2.0", + "--particle-aabb-max", + "-2.0", + "2.0", + "-2.0", + ]) + .expect_err("this command is supposed to fail") + .kind(), + clap::error::ErrorKind::UnknownArgument + ); + } +} diff --git a/splashsurf/src/lib.rs b/splashsurf/src/lib.rs index 228a56b3..05a5b34f 100644 --- a/splashsurf/src/lib.rs +++ b/splashsurf/src/lib.rs @@ -5,7 +5,5 @@ mod reconstruction; #[macro_use] mod allocator; mod logging; -#[cfg(test)] -mod tests; pub(crate) use register_counting_allocator; diff --git a/splashsurf/src/main.rs b/splashsurf/src/main.rs index 73762427..66b5152d 100644 --- a/splashsurf/src/main.rs +++ b/splashsurf/src/main.rs @@ -5,8 +5,6 @@ mod reconstruction; #[macro_use] mod allocator; mod logging; -#[cfg(test)] -mod tests; pub(crate) use register_counting_allocator; diff --git a/splashsurf/src/reconstruction.rs b/splashsurf/src/reconstruction.rs index 8e83380c..01a1143d 100644 --- a/splashsurf/src/reconstruction.rs +++ b/splashsurf/src/reconstruction.rs @@ -1,3 +1,4 @@ +use crate::cli::Switch; use crate::reconstruction::arguments::*; use crate::{io, logging}; use anyhow::{Context, anyhow}; @@ -340,21 +341,6 @@ pub struct ReconstructSubcommandArgs { pub check_mesh_debug: Switch, } -#[derive(Copy, Clone, Debug, PartialEq, Eq, clap::ValueEnum)] -pub enum Switch { - Off, - On, -} - -impl Switch { - fn into_bool(self) -> bool { - match self { - Switch::Off => false, - Switch::On => true, - } - } -} - /// Executes the `reconstruct` subcommand pub fn reconstruct_subcommand(cmd_args: &ReconstructSubcommandArgs) -> Result<(), anyhow::Error> { profile!("reconstruct subcommand"); diff --git a/splashsurf/src/tests/cli.rs b/splashsurf/src/tests/cli.rs deleted file mode 100644 index 3aa0ccff..00000000 --- a/splashsurf/src/tests/cli.rs +++ /dev/null @@ -1,144 +0,0 @@ -use crate::Subcommand; -use crate::reconstruction::Switch; -use std::path::PathBuf; - -#[test] -fn verify_main_cli() { - use clap::CommandFactory; - crate::CommandlineArgs::command().debug_assert() -} - -#[test] -fn verify_reconstruct_cli() { - use clap::CommandFactory; - crate::reconstruction::ReconstructSubcommandArgs::command().debug_assert() -} - -#[test] -fn verify_convert_cli() { - use clap::CommandFactory; - crate::convert::ConvertSubcommandArgs::command().debug_assert() -} - -#[test] -fn test_main_cli() { - use clap::Parser; - - // Display help - assert_eq!( - crate::CommandlineArgs::try_parse_from(["splashsurf", "--help",]) - .expect_err("this command is supposed to fail") - .kind(), - clap::error::ErrorKind::DisplayHelp - ); - - // Display help, reconstruct - assert_eq!( - crate::CommandlineArgs::try_parse_from(["splashsurf", "reconstruct", "--help",]) - .expect_err("this command is supposed to fail") - .kind(), - clap::error::ErrorKind::DisplayHelp - ); - - // Display help, convert - assert_eq!( - crate::CommandlineArgs::try_parse_from(["splashsurf", "convert", "--help",]) - .expect_err("this command is supposed to fail") - .kind(), - clap::error::ErrorKind::DisplayHelp - ); - - // Minimum arguments: input file - if let Subcommand::Reconstruct(rec_args) = crate::CommandlineArgs::try_parse_from([ - "splashsurf", - "reconstruct", - "test.vtk", - "--particle-radius=0.05", - "--smoothing-length=3.0", - "--cube-size=0.75", - ]) - .expect("this command is supposed to work") - .subcommand - { - assert_eq!(rec_args.input_file_or_sequence, PathBuf::from("test.vtk")); - }; - - // Test on/off switch - if let Subcommand::Reconstruct(rec_args) = crate::CommandlineArgs::try_parse_from([ - "splashsurf", - "reconstruct", - "test.vtk", - "--particle-radius=0.05", - "--smoothing-length=3.0", - "--cube-size=0.75", - "--normals=on", - ]) - .expect("this command is supposed to work") - .subcommand - { - assert_eq!(rec_args.normals, Switch::On); - }; - - if let Subcommand::Reconstruct(rec_args) = crate::CommandlineArgs::try_parse_from([ - "splashsurf", - "reconstruct", - "test.vtk", - "--particle-radius=0.05", - "--smoothing-length=3.0", - "--cube-size=0.75", - "--normals=off", - ]) - .expect("this command is supposed to work") - .subcommand - { - assert_eq!(rec_args.normals, Switch::Off); - }; - - // Test domain min/max: correct values - if let Subcommand::Reconstruct(rec_args) = crate::CommandlineArgs::try_parse_from([ - "splashsurf", - "reconstruct", - "test.vtk", - "--particle-radius=0.05", - "--smoothing-length=3.0", - "--cube-size=0.75", - "--particle-aabb-min", - "-1.0", - "1.0", - "-1.0", - "--particle-aabb-max", - "-2.0", - "2.0", - "-2.0", - ]) - .expect("this command is supposed to work") - .subcommand - { - assert_eq!(rec_args.particle_aabb_min, Some(vec![-1.0, 1.0, -1.0])); - assert_eq!(rec_args.particle_aabb_max, Some(vec![-2.0, 2.0, -2.0])); - }; - - // Test domain min/max: too many values - assert_eq!( - crate::CommandlineArgs::try_parse_from([ - "splashsurf", - "reconstruct", - "test.vtk", - "--particle-radius=0.05", - "--smoothing-length=3.0", - "--cube-size=0.75", - "--particle-aabb-min", - "-1.0", - "1.0", - "-1.0", - "2.0", - "--particle-aabb-max", - "-2.0", - "2.0", - "-2.0", - ]) - .expect_err("this command is supposed to fail") - .kind(), - clap::error::ErrorKind::UnknownArgument - ); -} diff --git a/splashsurf/src/tests/mod.rs b/splashsurf/src/tests/mod.rs deleted file mode 100644 index 26710c10..00000000 --- a/splashsurf/src/tests/mod.rs +++ /dev/null @@ -1 +0,0 @@ -mod cli; From 2918618439bbf5fc738d456ad972f5bd33c2d515 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20L=C3=B6schner?= Date: Sun, 8 Jun 2025 17:11:20 +0200 Subject: [PATCH 5/8] Delete devcontainer config --- .devcontainer/Dockerfile | 5 - .devcontainer/base.Dockerfile | 23 -- .devcontainer/devcontainer.json | 34 -- .devcontainer/library-scripts/README.md | 5 - .../library-scripts/common-debian.sh | 336 ------------------ .devcontainer/library-scripts/rust-debian.sh | 84 ----- 6 files changed, 487 deletions(-) delete mode 100644 .devcontainer/Dockerfile delete mode 100644 .devcontainer/base.Dockerfile delete mode 100644 .devcontainer/devcontainer.json delete mode 100644 .devcontainer/library-scripts/README.md delete mode 100644 .devcontainer/library-scripts/common-debian.sh delete mode 100644 .devcontainer/library-scripts/rust-debian.sh diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile deleted file mode 100644 index af438752..00000000 --- a/.devcontainer/Dockerfile +++ /dev/null @@ -1,5 +0,0 @@ -FROM mcr.microsoft.com/vscode/devcontainers/rust:1 - -# [Optional] Uncomment this section to install additional packages. -# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ -# && apt-get -y install --no-install-recommends diff --git a/.devcontainer/base.Dockerfile b/.devcontainer/base.Dockerfile deleted file mode 100644 index 4231dc71..00000000 --- a/.devcontainer/base.Dockerfile +++ /dev/null @@ -1,23 +0,0 @@ -FROM rust:1 - -# [Option] Install zsh -ARG INSTALL_ZSH="true" -# [Option] Upgrade OS packages to their latest versions -ARG UPGRADE_PACKAGES="false" - -# Install needed packages and setup non-root user. Use a separate RUN statement to add your own dependencies. -ARG USERNAME=vscode -ARG USER_UID=1000 -ARG USER_GID=$USER_UID -COPY library-scripts/*.sh /tmp/library-scripts/ -RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ - # Remove imagemagick due to https://security-tracker.debian.org/tracker/CVE-2019-10131 - && apt-get purge -y imagemagick imagemagick-6-common \ - # Install common packages, non-root user, updated lldb, dependencies - && bash /tmp/library-scripts/common-debian.sh "${INSTALL_ZSH}" "${USERNAME}" "${USER_UID}" "${USER_GID}" "${UPGRADE_PACKAGES}" \ - && bash /tmp/library-scripts/rust-debian.sh "${CARGO_HOME}" "${RUSTUP_HOME}" "${USERNAME}" "true" "true" \ - && apt-get clean -y && rm -rf /var/lib/apt/lists/* /tmp/library-scripts - -# [Optional] Uncomment this section to install additional OS packages. -# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ -# && apt-get -y install --no-install-recommends diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json deleted file mode 100644 index 8d5a02a3..00000000 --- a/.devcontainer/devcontainer.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "name": "Rust", - "build": { - "dockerfile": "Dockerfile" - }, - "runArgs": [ "--cap-add=SYS_PTRACE", "--security-opt", "seccomp=unconfined" ], - - // Set *default* container specific settings.json values on container create. - "settings": { - "terminal.integrated.shell.linux": "/bin/bash", - "lldb.executable": "/usr/bin/lldb", - // VS Code don't watch files under ./target - "files.watcherExclude": { - "**/target/**": true - } - }, - - // Add the IDs of extensions you want installed when the container is created. - "extensions": [ - "rust-lang.rust", - "bungcip.better-toml", - "vadimcn.vscode-lldb", - "mutantdino.resourcemonitor" - ], - - // Use 'forwardPorts' to make a list of ports inside the container available locally. - // "forwardPorts": [], - - // Use 'postCreateCommand' to run commands after the container is created. - // "postCreateCommand": "rustc --version", - - // Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. - "remoteUser": "vscode" -} diff --git a/.devcontainer/library-scripts/README.md b/.devcontainer/library-scripts/README.md deleted file mode 100644 index d06dfd1a..00000000 --- a/.devcontainer/library-scripts/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# Warning: Folder contents may be replaced - -The contents of this folder will be automatically replaced with a file of the same name in the [vscode-dev-containers](https://github.com/microsoft/vscode-dev-containers) repository's [script-library folder](https://github.com/microsoft/vscode-dev-containers/tree/master/script-library) whenever the repository is packaged. - -To retain your edits, move the file to a different location. You may also delete the files if they are not needed. \ No newline at end of file diff --git a/.devcontainer/library-scripts/common-debian.sh b/.devcontainer/library-scripts/common-debian.sh deleted file mode 100644 index e99d29ab..00000000 --- a/.devcontainer/library-scripts/common-debian.sh +++ /dev/null @@ -1,336 +0,0 @@ -#!/usr/bin/env bash -#------------------------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information. -#------------------------------------------------------------------------------------------------------------- -# -# Docs: https://github.com/microsoft/vscode-dev-containers/blob/master/script-library/docs/common.md -# -# Syntax: ./common-debian.sh [install zsh flag] [username] [user UID] [user GID] [upgrade packages flag] [install Oh My *! flag] - -INSTALL_ZSH=${1:-"true"} -USERNAME=${2:-"automatic"} -USER_UID=${3:-"automatic"} -USER_GID=${4:-"automatic"} -UPGRADE_PACKAGES=${5:-"true"} -INSTALL_OH_MYS=${6:-"true"} - -set -e - -if [ "$(id -u)" -ne 0 ]; then - echo -e 'Script must be run as root. Use sudo, su, or add "USER root" to your Dockerfile before running this script.' - exit 1 -fi - -# If in automatic mode, determine if a user already exists, if not use vscode -if [ "${USERNAME}" = "auto" ] || [ "${USERNAME}" = "automatic" ]; then - USERNAME="" - POSSIBLE_USERS=("vscode" "node" "codespace" "$(awk -v val=1000 -F ":" '$3==val{print $1}' /etc/passwd)") - for CURRENT_USER in ${POSSIBLE_USERS[@]}; do - if id -u ${CURRENT_USER} > /dev/null 2>&1; then - USERNAME=${CURRENT_USER} - break - fi - done - if [ "${USERNAME}" = "" ]; then - USERNAME=vscode - fi -elif [ "${USERNAME}" = "none" ]; then - USERNAME=root - USER_UID=0 - USER_GID=0 -fi - -# Load markers to see which steps have already run -MARKER_FILE="/usr/local/etc/vscode-dev-containers/common" -if [ -f "${MARKER_FILE}" ]; then - echo "Marker file found:" - cat "${MARKER_FILE}" - source "${MARKER_FILE}" -fi - -# Ensure apt is in non-interactive to avoid prompts -export DEBIAN_FRONTEND=noninteractive - -# Function to call apt-get if needed -apt-get-update-if-needed() -{ - if [ ! -d "/var/lib/apt/lists" ] || [ "$(ls /var/lib/apt/lists/ | wc -l)" = "0" ]; then - echo "Running apt-get update..." - apt-get update - else - echo "Skipping apt-get update." - fi -} - -# Run install apt-utils to avoid debconf warning then verify presence of other common developer tools and dependencies -if [ "${PACKAGES_ALREADY_INSTALLED}" != "true" ]; then - apt-get-update-if-needed - - PACKAGE_LIST="apt-utils \ - git \ - openssh-client \ - gnupg2 \ - iproute2 \ - procps \ - lsof \ - htop \ - net-tools \ - psmisc \ - curl \ - wget \ - rsync \ - ca-certificates \ - unzip \ - zip \ - nano \ - vim-tiny \ - less \ - jq \ - lsb-release \ - apt-transport-https \ - dialog \ - libc6 \ - libgcc1 \ - libkrb5-3 \ - libgssapi-krb5-2 \ - libicu[0-9][0-9] \ - liblttng-ust0 \ - libstdc++6 \ - zlib1g \ - locales \ - sudo \ - ncdu \ - man-db \ - strace" - - # Install libssl1.1 if available - if [[ ! -z $(apt-cache --names-only search ^libssl1.1$) ]]; then - PACKAGE_LIST="${PACKAGE_LIST} libssl1.1" - fi - - # Install appropriate version of libssl1.0.x if available - LIBSSL=$(dpkg-query -f '${db:Status-Abbrev}\t${binary:Package}\n' -W 'libssl1\.0\.?' 2>&1 || echo '') - if [ "$(echo "$LIBSSL" | grep -o 'libssl1\.0\.[0-9]:' | uniq | sort | wc -l)" -eq 0 ]; then - if [[ ! -z $(apt-cache --names-only search ^libssl1.0.2$) ]]; then - # Debian 9 - PACKAGE_LIST="${PACKAGE_LIST} libssl1.0.2" - elif [[ ! -z $(apt-cache --names-only search ^libssl1.0.0$) ]]; then - # Ubuntu 18.04, 16.04, earlier - PACKAGE_LIST="${PACKAGE_LIST} libssl1.0.0" - fi - fi - - echo "Packages to verify are installed: ${PACKAGE_LIST}" - apt-get -y install --no-install-recommends ${PACKAGE_LIST} 2> >( grep -v 'debconf: delaying package configuration, since apt-utils is not installed' >&2 ) - - PACKAGES_ALREADY_INSTALLED="true" -fi - -# Get to latest versions of all packages -if [ "${UPGRADE_PACKAGES}" = "true" ]; then - apt-get-update-if-needed - apt-get -y upgrade --no-install-recommends - apt-get autoremove -y -fi - -# Ensure at least the en_US.UTF-8 UTF-8 locale is available. -# Common need for both applications and things like the agnoster ZSH theme. -if [ "${LOCALE_ALREADY_SET}" != "true" ] && ! grep -o -E '^\s*en_US.UTF-8\s+UTF-8' /etc/locale.gen > /dev/null; then - echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen - locale-gen - LOCALE_ALREADY_SET="true" -fi - -# Create or update a non-root user to match UID/GID. -if id -u ${USERNAME} > /dev/null 2>&1; then - # User exists, update if needed - if [ "${USER_GID}" != "automatic" ] && [ "$USER_GID" != "$(id -G $USERNAME)" ]; then - groupmod --gid $USER_GID $USERNAME - usermod --gid $USER_GID $USERNAME - fi - if [ "${USER_UID}" != "automatic" ] && [ "$USER_UID" != "$(id -u $USERNAME)" ]; then - usermod --uid $USER_UID $USERNAME - fi -else - # Create user - if [ "${USER_GID}" = "automatic" ]; then - groupadd $USERNAME - else - groupadd --gid $USER_GID $USERNAME - fi - if [ "${USER_UID}" = "automatic" ]; then - useradd -s /bin/bash --gid $USERNAME -m $USERNAME - else - useradd -s /bin/bash --uid $USER_UID --gid $USERNAME -m $USERNAME - fi -fi - -# Add add sudo support for non-root user -if [ "${USERNAME}" != "root" ] && [ "${EXISTING_NON_ROOT_USER}" != "${USERNAME}" ]; then - echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME - chmod 0440 /etc/sudoers.d/$USERNAME - EXISTING_NON_ROOT_USER="${USERNAME}" -fi - -# ** Shell customization section ** -if [ "${USERNAME}" = "root" ]; then - USER_RC_PATH="/root" -else - USER_RC_PATH="/home/${USERNAME}" -fi - -# .bashrc/.zshrc snippet -RC_SNIPPET="$(cat << EOF -export USER=\$(whoami) - -export PATH=\$PATH:\$HOME/.local/bin -EOF -)" - -# code shim, it fallbacks to code-insiders if code is not available -cat << 'EOF' > /usr/local/bin/code -#!/bin/sh - -get_in_path_except_current() { - which -a "$1" | grep -v "$0" | head -1 -} - -code="$(get_in_path_except_current code)" - -if [ -n "$code" ]; then - exec "$code" "$@" -elif [ "$(command -v code-insiders)" ]; then - exec code-insiders "$@" -else - echo "code or code-insiders is not installed" >&2 - exit 127 -fi -EOF -chmod +x /usr/local/bin/code - -# Codespaces themes - partly inspired by https://github.com/ohmyzsh/ohmyzsh/blob/master/themes/robbyrussell.zsh-theme -CODESPACES_BASH="$(cat \ -<&1 - echo -e "$(cat "${TEMPLATE}")\nDISABLE_AUTO_UPDATE=true\nDISABLE_UPDATE_PROMPT=true" > ${USER_RC_FILE} - if [ "${OH_MY}" = "bash" ]; then - sed -i -e 's/OSH_THEME=.*/OSH_THEME="codespaces"/g' ${USER_RC_FILE} - mkdir -p ${OH_MY_INSTALL_DIR}/custom/themes/codespaces - echo "${CODESPACES_BASH}" > ${OH_MY_INSTALL_DIR}/custom/themes/codespaces/codespaces.theme.sh - else - sed -i -e 's/ZSH_THEME=.*/ZSH_THEME="codespaces"/g' ${USER_RC_FILE} - mkdir -p ${OH_MY_INSTALL_DIR}/custom/themes - echo "${CODESPACES_ZSH}" > ${OH_MY_INSTALL_DIR}/custom/themes/codespaces.zsh-theme - fi - # Shrink git while still enabling updates - cd ${OH_MY_INSTALL_DIR} - git repack -a -d -f --depth=1 --window=1 - - if [ "${USERNAME}" != "root" ]; then - cp -rf ${USER_RC_FILE} ${OH_MY_INSTALL_DIR} /root - chown -R ${USERNAME}:${USERNAME} ${USER_RC_PATH} - fi -} - -if [ "${RC_SNIPPET_ALREADY_ADDED}" != "true" ]; then - echo "${RC_SNIPPET}" >> /etc/bash.bashrc - RC_SNIPPET_ALREADY_ADDED="true" -fi -install-oh-my bash bashrc.osh-template https://github.com/ohmybash/oh-my-bash - -# Optionally install and configure zsh and Oh My Zsh! -if [ "${INSTALL_ZSH}" = "true" ]; then - if ! type zsh > /dev/null 2>&1; then - apt-get-update-if-needed - apt-get install -y zsh - fi - if [ "${ZSH_ALREADY_INSTALLED}" != "true" ]; then - echo "${RC_SNIPPET}" >> /etc/zsh/zshrc - ZSH_ALREADY_INSTALLED="true" - fi - install-oh-my zsh zshrc.zsh-template https://github.com/ohmyzsh/ohmyzsh -fi - -# Write marker file -mkdir -p "$(dirname "${MARKER_FILE}")" -echo -e "\ - PACKAGES_ALREADY_INSTALLED=${PACKAGES_ALREADY_INSTALLED}\n\ - LOCALE_ALREADY_SET=${LOCALE_ALREADY_SET}\n\ - EXISTING_NON_ROOT_USER=${EXISTING_NON_ROOT_USER}\n\ - RC_SNIPPET_ALREADY_ADDED=${RC_SNIPPET_ALREADY_ADDED}\n\ - ZSH_ALREADY_INSTALLED=${ZSH_ALREADY_INSTALLED}" > "${MARKER_FILE}" - -echo "Done!" diff --git a/.devcontainer/library-scripts/rust-debian.sh b/.devcontainer/library-scripts/rust-debian.sh deleted file mode 100644 index 3b87264e..00000000 --- a/.devcontainer/library-scripts/rust-debian.sh +++ /dev/null @@ -1,84 +0,0 @@ -#!/usr/bin/env bash -#------------------------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information. -#------------------------------------------------------------------------------------------------------------- -# -# Docs: https://github.com/microsoft/vscode-dev-containers/blob/master/script-library/docs/rust.md -# -# Syntax: ./rust-debian.sh [CARGO_HOME] [RUSTUP_HOME] [non-root user] [add CARGO/RUSTUP_HOME to rc files flag] [whether to update rust] - -export CARGO_HOME=${1:-"/usr/local/cargo"} -export RUSTUP_HOME=${2:-"/usr/local/rustup"} -USERNAME=${3:-"automatic"} -UPDATE_RC=${4:-"true"} -UPDATE_RUST=${5:-"true"} - -set -e - -if [ "$(id -u)" -ne 0 ]; then - echo -e 'Script must be run as root. Use sudo, su, or add "USER root" to your Dockerfile before running this script.' - exit 1 -fi - -# Determine the appropriate non-root user -if [ "${USERNAME}" = "auto" ] || [ "${USERNAME}" = "automatic" ]; then - USERNAME="" - POSSIBLE_USERS=("vscode" "node" "codespace" "$(awk -v val=1000 -F ":" '$3==val{print $1}' /etc/passwd)") - for CURRENT_USER in ${POSSIBLE_USERS[@]}; do - if id -u ${CURRENT_USER} > /dev/null 2>&1; then - USERNAME=${CURRENT_USER} - break - fi - done - if [ "${USERNAME}" = "" ]; then - USERNAME=root - fi -elif [ "${USERNAME}" = "none" ] || ! id -u ${USERNAME} > /dev/null 2>&1; then - USERNAME=root -fi - -function updaterc() { - if [ "${UPDATE_RC}" = "true" ]; then - echo "Updating /etc/bash.bashrc and /etc/zsh/zshrc..." - echo -e "$1" | tee -a /etc/bash.bashrc >> /etc/zsh/zshrc - fi -} - -export DEBIAN_FRONTEND=noninteractive - -# Install curl, lldb, python3-minimal,and rust dependencies if missing -if ! dpkg -s curl ca-certificates lldb python3-minimal gcc libc6-dev > /dev/null 2>&1; then - if [ ! -d "/var/lib/apt/lists" ] || [ "$(ls /var/lib/apt/lists/ | wc -l)" = "0" ]; then - apt-get update - fi - apt-get -y install --no-install-recommends curl ca-certificates gcc libc6-dev - apt-get -y install lldb python3-minimal libpython3.? -fi - -# Install Rust -if ! type rustup > /dev/null 2>&1; then - echo "Installing Rust..." - mkdir -p "${CARGO_HOME}" "${RUSTUP_HOME}" - chown ${USERNAME} "${CARGO_HOME}" "${RUSTUP_HOME}" - su ${USERNAME} -c "curl --tlsv1.2 https://sh.rustup.rs -sSf | bash -s -- -y --no-modify-path --profile minimal 2>&1" -else - echo "Rust already installed. Skipping." -fi - -su ${USERNAME} -c "$(cat << EOF - set -e - export PATH=${PATH}:${CARGO_HOME}/bin - if [ "${UPDATE_RUST}" = "true" ]; then - echo "Updating Rust..." - rustup update 2>&1 - fi - echo "Installing common Rust dependencies..." - rustup component add rls rust-analysis rust-src rustfmt clippy 2>&1 -EOF -)" - -# Add CARGO_HOME, RUSTUP_HOME and bin directory into bashrc/zshrc files (unless disabled) -updaterc "export CARGO_HOME=\"${CARGO_HOME}\"\nexport RUSTUP_HOME=\"${RUSTUP_HOME}\"\nexport PATH=\"\${CARGO_HOME}/bin:\${PATH}\"" -echo "Done!" - From fb9e62b27698aeece0da17aa060ceeb4b86825ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20L=C3=B6schner?= Date: Tue, 10 Jun 2025 09:21:19 +0200 Subject: [PATCH 6/8] Update comments --- splashsurf/src/cli.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/splashsurf/src/cli.rs b/splashsurf/src/cli.rs index 02853f92..551b5799 100644 --- a/splashsurf/src/cli.rs +++ b/splashsurf/src/cli.rs @@ -83,10 +83,10 @@ impl Switch { /// Runs the splashsurf CLI with the provided command line arguments. /// /// This function behaves like the binary `splashsurf` command line tool including output to stdout and stderr. -/// Note that the first argument is always ignored as it is the binary name when called using `std::env::args()` -/// from the command line: +/// Note that the first argument is always ignored - this is typically the binary name when called using +/// `std::env::args()` from the terminal: /// ``` -/// splashsurf::cli::run_splashsurf([".", "--version"]); +/// splashsurf::cli::run_splashsurf(["splashsurf", "--version"]); /// ``` /// If no placeholder for the binary name is provided it will return an error (and print a help message): /// ```should_panic From e4d36c27eb71d9206971d1847c8499b6b3bee645 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20L=C3=B6schner?= Date: Tue, 10 Jun 2025 09:21:40 +0200 Subject: [PATCH 7/8] Bump version --- pysplashsurf/pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pysplashsurf/pyproject.toml b/pysplashsurf/pyproject.toml index 158b7243..2997aea1 100644 --- a/pysplashsurf/pyproject.toml +++ b/pysplashsurf/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "maturin" [project] name = "pysplashsurf" -version = "0.11.0.0rc1" +version = "0.11.0.0rc2" description = "Python bindings for splashsurf, a surface reconstruction library for SPH simulations." keywords = ["surface reconstruction", "marching cubes", "sph", "fluid", "particles", "mesh", "splashsurf", "splishsplash"] readme = "README.md" From 28018eb57ccbcd1e2ba55db2d1d5e5564fb14dad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20L=C3=B6schner?= Date: Tue, 10 Jun 2025 11:07:07 +0200 Subject: [PATCH 8/8] cargo fmt --- splashsurf/src/cli.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/splashsurf/src/cli.rs b/splashsurf/src/cli.rs index 551b5799..f0404bc6 100644 --- a/splashsurf/src/cli.rs +++ b/splashsurf/src/cli.rs @@ -83,7 +83,7 @@ impl Switch { /// Runs the splashsurf CLI with the provided command line arguments. /// /// This function behaves like the binary `splashsurf` command line tool including output to stdout and stderr. -/// Note that the first argument is always ignored - this is typically the binary name when called using +/// Note that the first argument is always ignored - this is typically the binary name when called using /// `std::env::args()` from the terminal: /// ``` /// splashsurf::cli::run_splashsurf(["splashsurf", "--version"]);