From a9c3c444dd5e9c55858e62fc43ef67bdb1c77252 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 14 Jun 2024 02:35:42 +0000 Subject: [PATCH 01/35] Bump git2 from 0.18.3 to 0.19.0 Bumps [git2](https://github.com/rust-lang/git2-rs) from 0.18.3 to 0.19.0. - [Changelog](https://github.com/rust-lang/git2-rs/blob/master/CHANGELOG.md) - [Commits](https://github.com/rust-lang/git2-rs/compare/git2-0.18.3...git2-0.19.0) --- updated-dependencies: - dependency-name: git2 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Cargo.lock | 8 ++++---- Cargo.toml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6332078..a148ad5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -289,9 +289,9 @@ dependencies = [ [[package]] name = "git2" -version = "0.18.3" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "232e6a7bfe35766bf715e55a88b39a700596c0ccfd88cd3680b4cdb40d66ef70" +checksum = "b903b73e45dc0c6c596f2d37eccece7c1c8bb6e4407b001096387c63d0d93724" dependencies = [ "bitflags", "libc", @@ -535,9 +535,9 @@ checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" [[package]] name = "libgit2-sys" -version = "0.16.2+1.7.2" +version = "0.17.0+1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee4126d8b4ee5c9d9ea891dd875cfdc1e9d0950437179104b183d7d8a74d24e8" +checksum = "10472326a8a6477c3c20a64547b0059e4b0d086869eee31e6d7da728a8eb7224" dependencies = [ "cc", "libc", diff --git a/Cargo.toml b/Cargo.toml index 5da2693..20c62a2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -30,7 +30,7 @@ name = "cart" path = "src/bin/cart.rs" [build-dependencies] -git2 = { version = "0.18.2", optional = true } +git2 = { version = "0.19.0", optional = true } [features] vers = ["dep:git2"] From 15dbd782c2bf9ffb5eb650153e5e05f3c0af593e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 9 Oct 2024 02:39:25 +0000 Subject: [PATCH 02/35] Bump clap from 4.5.12 to 4.5.20 Bumps [clap](https://github.com/clap-rs/clap) from 4.5.12 to 4.5.20. - [Release notes](https://github.com/clap-rs/clap/releases) - [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md) - [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.5.12...clap_complete-v4.5.20) --- updated-dependencies: - dependency-name: clap dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Cargo.lock | 12 ++++++------ Cargo.toml | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 92d2386..fad1c98 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -140,9 +140,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.12" +version = "4.5.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c53aa12ec67affac065e7c7dd20a42fa2a4094921b655711d5d3107bb3d52bed" +checksum = "b97f376d85a664d5837dbae44bf546e6477a679ff6610010f17276f686d867e8" dependencies = [ "clap_builder", "clap_derive", @@ -150,9 +150,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.12" +version = "4.5.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efbdf2dd5fe10889e0c61942ff5d948aaf12fd0b4504408ab0cbb1916c2cffa9" +checksum = "19bc80abd44e4bed93ca373a0704ccbd1b710dc5749406201bb018272808dc54" dependencies = [ "anstream", "anstyle", @@ -162,9 +162,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.11" +version = "4.5.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d029b67f89d30bbb547c89fd5161293c0aec155fc691d7924b64550662db93e" +checksum = "4ac6a0c7b1a9e9a5186361f67dfa1b88213572f427fb9ab038efb2bd8c582dab" dependencies = [ "heck", "proc-macro2", diff --git a/Cargo.toml b/Cargo.toml index ecad2c7..adb311f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,7 +18,7 @@ symm = { git = "https://github.com/ntBre/symm" } taylor = { git = "https://github.com/ntBre/taylor" } toml = "0.8.10" rustc-hash = "2.0.0" -clap = { version = "4.5.7", features = ["derive"] } +clap = { version = "4.5.20", features = ["derive"] } env_logger = "0.11.3" log = "0.4.22" From 6486708f38ac2e4aca02dcdbf129d1402b12f56e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 21 Oct 2024 02:40:46 +0000 Subject: [PATCH 03/35] Bump serde_json from 1.0.121 to 1.0.132 Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.121 to 1.0.132. - [Release notes](https://github.com/serde-rs/json/releases) - [Commits](https://github.com/serde-rs/json/compare/v1.0.121...1.0.132) --- updated-dependencies: - dependency-name: serde_json dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 92d2386..3803342 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -779,9 +779,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.121" +version = "1.0.132" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ab380d7d9f22ef3f21ad3e6c1ebe8e4fc7a2000ccba2e4d71fc96f15b2cb609" +checksum = "d726bfaff4b320266d395898905d0eba0345aae23b54aee3a737e260fd46db03" dependencies = [ "itoa", "memchr", From 1c476c5c9053a8b4792d1c27bc193b94498d317e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 30 Oct 2024 02:51:41 +0000 Subject: [PATCH 04/35] Bump nalgebra from 0.33.0 to 0.33.2 Bumps [nalgebra](https://github.com/dimforge/nalgebra) from 0.33.0 to 0.33.2. - [Changelog](https://github.com/dimforge/nalgebra/blob/main/CHANGELOG.md) - [Commits](https://github.com/dimforge/nalgebra/commits/v0.33.2) --- updated-dependencies: - dependency-name: nalgebra dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Cargo.lock | 4 ++-- Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 92d2386..a6544f3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -471,9 +471,9 @@ checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "nalgebra" -version = "0.33.0" +version = "0.33.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c4b5f057b303842cf3262c27e465f4c303572e7f6b0648f60e16248ac3397f4" +checksum = "26aecdf64b707efd1310e3544d709c5c0ac61c13756046aaaba41be5c4f66a3b" dependencies = [ "approx", "matrixmultiply", diff --git a/Cargo.toml b/Cargo.toml index ecad2c7..c4de59d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,7 +8,7 @@ edition = "2021" [dependencies] intder = { git = "https://github.com/ntBre/intder" } libc = "0.2.155" -nalgebra = "0.33.0" +nalgebra = "0.33.2" psqs = { git = "https://github.com/ntBre/psqs" } rust-anpass = { git = "https://github.com/ntBre/rust-anpass" } serde_json = "1.0" From 1baa424e322eb58ae054e04b0f8c731bced70832 Mon Sep 17 00:00:00 2001 From: Brent Westbrook Date: Sat, 30 Nov 2024 15:38:36 -0500 Subject: [PATCH 05/35] bump spectro --- Cargo.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 92d2386..9387cda 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -814,7 +814,7 @@ dependencies = [ [[package]] name = "spectro" version = "0.1.0" -source = "git+https://github.com/ntBre/spectro#afc966226d7eb42710865650cf986823646735af" +source = "git+https://github.com/ntBre/spectro#6294c673587cfcb4f4229a64781c1b8b1139a4a1" dependencies = [ "log", "nalgebra", @@ -833,7 +833,7 @@ checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "symm" version = "0.1.0" -source = "git+https://github.com/ntBre/symm#39161c959507d4216967ed85b282c664c88bd19a" +source = "git+https://github.com/ntBre/symm#e87c30859f4fc0d02269330230f39a474235afd2" dependencies = [ "approx", "nalgebra", @@ -877,7 +877,7 @@ dependencies = [ [[package]] name = "tensor" version = "0.1.0" -source = "git+https://github.com/ntBre/tensor#fa7d3b8f84d6cf5d2b89728de25dc5d8ebe43d12" +source = "git+https://github.com/ntBre/tensor#b7331cbf697d51ce7fbf8d41de55229f0cfeaa77" dependencies = [ "approx", ] From 7c913ecc27cc9a8835a15a613c1237c2ce49f9fa Mon Sep 17 00:00:00 2001 From: Brent Westbrook Date: Sat, 30 Nov 2024 15:42:33 -0500 Subject: [PATCH 06/35] set verbose to true to get full vibrational state output --- src/coord_type/cart.rs | 1 + src/coord_type/sic.rs | 1 + 2 files changed, 2 insertions(+) diff --git a/src/coord_type/cart.rs b/src/coord_type/cart.rs index 5f8599d..d877af6 100644 --- a/src/coord_type/cart.rs +++ b/src/coord_type/cart.rs @@ -85,6 +85,7 @@ pub fn freqs( mol.to_bohr(); let mut spectro = Spectro::from(mol); spectro.header = SPECTRO_HEADER.to_vec(); + spectro.verbose = true; // write input if let Some(dir) = dir { diff --git a/src/coord_type/sic.rs b/src/coord_type/sic.rs index bb40155..5eda6b5 100644 --- a/src/coord_type/sic.rs +++ b/src/coord_type/sic.rs @@ -502,6 +502,7 @@ impl Sic { // spectro let mut spectro = Spectro::from(mol); spectro.header = SPECTRO_HEADER.to_vec(); + spectro.verbose = true; let fc3 = spectro::new_fc3(spectro.n3n, &f3); let fc4 = spectro::new_fc4(spectro.n3n, &f4); From 254566c201cf325648be5b08b51ada0c27e6f1cf Mon Sep 17 00:00:00 2001 From: Brent Westbrook Date: Sat, 30 Nov 2024 15:46:16 -0500 Subject: [PATCH 07/35] use die macro --- src/main.rs | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/main.rs b/src/main.rs index fdc3c35..39a1f96 100644 --- a/src/main.rs +++ b/src/main.rs @@ -4,7 +4,7 @@ use pbqff::{ cleanup, config::{self, Config}, coord_type::{normal::Normal, Cart, CoordType, Load, Sic}, - Intder, + die, Intder, }; use psqs::{ program::{cfour::Cfour, dftbplus::DFTBPlus, molpro::Molpro, mopac::Mopac}, @@ -66,19 +66,14 @@ fn main() -> Result<(), std::io::Error> { match serde_json::to_string(&config) { Ok(s) => println!("{}", s), Err(e) => { - eprintln!( - "failed to deserialize {infile} with {e}", - infile = args.infile - ); - std::process::exit(1); + die!("failed to deserialize {} with {e}", args.infile); } }; return Ok(()); } let path = Path::new("pbqff.out"); if path.exists() && !args.overwrite { - eprintln!("existing pbqff output. overwrite with -o/--overwrite"); - std::process::exit(1); + die!("existing pbqff output. overwrite with -o/--overwrite"); } let outfile = File::create(path).expect("failed to create outfile"); let logfile = File::create("pbqff.log").expect("failed to create log file"); From 455310e5b7e7d37efa8d71f27d551d2f23f182d0 Mon Sep 17 00:00:00 2001 From: Brent Westbrook Date: Sat, 30 Nov 2024 16:15:01 -0500 Subject: [PATCH 08/35] add assert_cmd and insta and add basic assert_cmd test for cart --- Cargo.lock | 148 +++++++++++++++++++++++++++++++++++++++++--- Cargo.toml | 4 +- testfiles/cart.toml | 2 +- tests/cart.rs | 23 +++++++ 4 files changed, 167 insertions(+), 10 deletions(-) create mode 100644 tests/cart.rs diff --git a/Cargo.lock b/Cargo.lock index 9387cda..ce28122 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -84,6 +84,22 @@ dependencies = [ "num-traits", ] +[[package]] +name = "assert_cmd" +version = "2.0.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc1835b7f27878de8525dc71410b5a31cdcc5f230aed5ba5df968e09c201b23d" +dependencies = [ + "anstyle", + "bstr", + "doc-comment", + "libc", + "predicates", + "predicates-core", + "predicates-tree", + "wait-timeout", +] + [[package]] name = "autocfg" version = "1.3.0" @@ -96,6 +112,17 @@ version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" +[[package]] +name = "bstr" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a68f1f47cdf0ec8ee4b941b2eee2a80cb796db73118c0dd09ac63fbe405be22" +dependencies = [ + "memchr", + "regex-automata", + "serde", +] + [[package]] name = "bumpalo" version = "3.16.0" @@ -184,6 +211,18 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0" +[[package]] +name = "console" +version = "0.15.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e1f83fc076bd6dd27517eacdf25fef6c4dfe5f1d7448bafaaf3a26f13b5e4eb" +dependencies = [ + "encode_unicode", + "lazy_static", + "libc", + "windows-sys", +] + [[package]] name = "core-foundation-sys" version = "0.8.6" @@ -215,12 +254,30 @@ version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" +[[package]] +name = "difflib" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6184e33543162437515c2e2b48714794e37845ec9851711914eec9d308f6ebe8" + +[[package]] +name = "doc-comment" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10" + [[package]] name = "either" version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" +[[package]] +name = "encode_unicode" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" + [[package]] name = "env_filter" version = "0.1.2" @@ -262,9 +319,9 @@ dependencies = [ [[package]] name = "fastrand" -version = "2.1.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" +checksum = "486f806e73c5707928240ddc295403b1b93c96a02038563881c4a2fd84b81ac4" [[package]] name = "form_urlencoded" @@ -351,6 +408,18 @@ dependencies = [ "hashbrown", ] +[[package]] +name = "insta" +version = "1.41.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e9ffc4d4892617c50a928c52b2961cb5174b6fc6ebf252b2fac9d21955c48b8" +dependencies = [ + "console", + "lazy_static", + "linked-hash-map", + "similar", +] + [[package]] name = "intder" version = "0.1.0" @@ -395,11 +464,17 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "lazy_static" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" + [[package]] name = "libc" -version = "0.2.155" +version = "0.2.167" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" +checksum = "09d6582e104315a817dff97f75133544b2e094ee22447d2acf4a74e189ba06fc" [[package]] name = "libgit2-sys" @@ -441,6 +516,12 @@ dependencies = [ "vcpkg", ] +[[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.4.14" @@ -595,9 +676,11 @@ name = "pbqff" version = "0.1.0" dependencies = [ "approx", + "assert_cmd", "clap", "env_logger", "git2", + "insta", "intder", "libc", "log", @@ -626,6 +709,33 @@ version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" +[[package]] +name = "predicates" +version = "3.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e9086cc7640c29a356d1a29fd134380bee9d8f79a17410aa76e7ad295f42c97" +dependencies = [ + "anstyle", + "difflib", + "predicates-core", +] + +[[package]] +name = "predicates-core" +version = "1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae8177bee8e75d6846599c6b9ff679ed51e882816914eec639944d7c9aa11931" + +[[package]] +name = "predicates-tree" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41b740d195ed3166cd147c8047ec98db0e22ec019eb8eeb76d343b795304fb13" +dependencies = [ + "predicates-core", + "termtree", +] + [[package]] name = "proc-macro2" version = "1.0.86" @@ -731,9 +841,9 @@ checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" [[package]] name = "rustix" -version = "0.38.34" +version = "0.38.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" +checksum = "d7f649912bc1495e167a6edee79151c84b1bad49748cb4f1f1167f459f6224f6" dependencies = [ "bitflags", "errno", @@ -811,6 +921,12 @@ dependencies = [ "wide", ] +[[package]] +name = "similar" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1de1d4f81173b03af4c0cbed3c898f6bff5b870e4a7f5d6f4057d62a7a4b686e" + [[package]] name = "spectro" version = "0.1.0" @@ -864,12 +980,13 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.10.1" +version = "3.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" +checksum = "28cce251fcbc87fac86a866eeb0d6c2d536fc16d06f184bb61aeae11aa4cee0c" dependencies = [ "cfg-if", "fastrand", + "once_cell", "rustix", "windows-sys", ] @@ -882,6 +999,12 @@ dependencies = [ "approx", ] +[[package]] +name = "termtree" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3369f5ac52d5eb6ab48c6b4ffdc8efbcad6b89c765749064ba298f2c68a16a76" + [[package]] name = "tinyvec" version = "1.8.0" @@ -981,6 +1104,15 @@ version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" +[[package]] +name = "wait-timeout" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f200f5b12eb75f8c1ed65abd4b2db8a6e1b138a20de009dacee265a2498f3f6" +dependencies = [ + "libc", +] + [[package]] name = "wasm-bindgen" version = "0.2.92" diff --git a/Cargo.toml b/Cargo.toml index ecad2c7..a2e1b19 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,7 +24,9 @@ log = "0.4.22" [dev-dependencies] approx = "0.5.1" -tempfile = "3.10.0" +tempfile = "3.14.0" +assert_cmd = "2.0.16" +insta = "1.41.1" [[bin]] name = "cart" diff --git a/testfiles/cart.toml b/testfiles/cart.toml index 69f6d3b..dc41117 100644 --- a/testfiles/cart.toml +++ b/testfiles/cart.toml @@ -15,7 +15,7 @@ charge = 0 step_size = 0.005 coord_type = "cart" program = "mopac" -queue = "slurm" +queue = "local" sleep_int = 2 job_limit = 2048 chunk_size = 1 diff --git a/tests/cart.rs b/tests/cart.rs new file mode 100644 index 0000000..58a6ac4 --- /dev/null +++ b/tests/cart.rs @@ -0,0 +1,23 @@ +use std::{fs::read_to_string, path::Path}; + +use assert_cmd::Command; +use tempfile::tempdir; + +#[test] +fn cart() -> std::io::Result<()> { + let config_file = Path::new("testfiles/cart.toml"); + let dir = tempdir()?; + std::fs::copy(config_file, dir.path().join("cart.toml"))?; + let mut cmd = Command::cargo_bin("pbqff").unwrap(); + let assert = cmd.arg("cart.toml").current_dir(&dir).assert(); + let output = assert.get_output(); + + assert!( + output.status.success(), + "stderr: {}\nlog: {}", + String::from_utf8_lossy(&output.stderr), + read_to_string(dir.path().join("pbqff.log"))?, + ); + + Ok(()) +} From 7dad4b0d2d0e25fc0455547fe47dad02d8467dce Mon Sep 17 00:00:00 2001 From: Brent Westbrook Date: Sat, 30 Nov 2024 16:19:12 -0500 Subject: [PATCH 09/35] add cart snapshot --- tests/cart.rs | 3 + tests/snapshots/cart__cart.snap | 183 ++++++++++++++++++++++++++++++++ 2 files changed, 186 insertions(+) create mode 100644 tests/snapshots/cart__cart.snap diff --git a/tests/cart.rs b/tests/cart.rs index 58a6ac4..1b62d8b 100644 --- a/tests/cart.rs +++ b/tests/cart.rs @@ -1,6 +1,7 @@ use std::{fs::read_to_string, path::Path}; use assert_cmd::Command; +use insta::assert_snapshot; use tempfile::tempdir; #[test] @@ -19,5 +20,7 @@ fn cart() -> std::io::Result<()> { read_to_string(dir.path().join("pbqff.log"))?, ); + assert_snapshot!(read_to_string(dir.path().join("pbqff.out"))?); + Ok(()) } diff --git a/tests/snapshots/cart__cart.snap b/tests/snapshots/cart__cart.snap new file mode 100644 index 0000000..1437783 --- /dev/null +++ b/tests/snapshots/cart__cart.snap @@ -0,0 +1,183 @@ +--- +source: tests/cart.rs +expression: "read_to_string(dir.path().join(\"pbqff.out\"))?" +snapshot_kind: text +--- +PID: 3507331 +version: deadbeef +normalized geometry: + +C -0.00000000 -0.89768253 0.00000000 +C -0.67626535 0.36933549 0.00000000 +C 0.67626535 0.36933549 -0.00000000 +H -1.55801907 0.94666167 -0.00000000 +H 1.55801907 0.94666167 0.00000000 + +point group:C2v(Axis(Y), Plane(Axis(Y), Axis(Z)), Plane(Axis(X), Axis(Y))) +15 Cartesian coordinates requires 11952 points +STATE NO. ENERGY (CM-1) ABOVE ZPT VIBRATIONAL STATE + 1 6675.1484 0.0000 NON-DEG (Vs) : 0 0 0 0 0 0 0 0 0 + 2 9458.1841 2783.0356 NON-DEG (Vs) : 1 0 0 0 0 0 0 0 0 + 3 9438.4238 2763.2754 NON-DEG (Vs) : 0 1 0 0 0 0 0 0 0 + 4 8451.5311 1776.3827 NON-DEG (Vs) : 0 0 1 0 0 0 0 0 0 + 5 7852.9724 1177.8240 NON-DEG (Vs) : 0 0 0 1 0 0 0 0 0 + 6 7716.4124 1041.2640 NON-DEG (Vs) : 0 0 0 0 1 0 0 0 0 + 7 7635.1650 960.0165 NON-DEG (Vs) : 0 0 0 0 0 1 0 0 0 + 8 7595.7362 920.5877 NON-DEG (Vs) : 0 0 0 0 0 0 1 0 0 + 9 7602.4989 927.3505 NON-DEG (Vs) : 0 0 0 0 0 0 0 1 0 + 10 7581.2336 906.0851 NON-DEG (Vs) : 0 0 0 0 0 0 0 0 1 + 11 12220.3766 5545.2282 NON-DEG (Vs) : 2 0 0 0 0 0 0 0 0 + 12 12180.6648 5505.5164 NON-DEG (Vs) : 0 2 0 0 0 0 0 0 0 + 13 10248.0779 3572.9294 NON-DEG (Vs) : 0 0 2 0 0 0 0 0 0 + 14 9025.9905 2350.8420 NON-DEG (Vs) : 0 0 0 2 0 0 0 0 0 + 15 8750.2987 2075.1503 NON-DEG (Vs) : 0 0 0 0 2 0 0 0 0 + 16 8593.3920 1918.2436 NON-DEG (Vs) : 0 0 0 0 0 2 0 0 0 + 17 8513.7222 1838.5737 NON-DEG (Vs) : 0 0 0 0 0 0 2 0 0 + 18 8528.2210 1853.0725 NON-DEG (Vs) : 0 0 0 0 0 0 0 2 0 + 19 8488.2359 1813.0875 NON-DEG (Vs) : 0 0 0 0 0 0 0 0 2 + 20 12180.8183 5505.6698 NON-DEG (Vs) : 1 1 0 0 0 0 0 0 0 + 21 11245.9314 4570.7830 NON-DEG (Vs) : 1 0 1 0 0 0 0 0 0 + 22 10638.2701 3963.1217 NON-DEG (Vs) : 1 0 0 1 0 0 0 0 0 + 23 10499.8008 3824.6523 NON-DEG (Vs) : 1 0 0 0 1 0 0 0 0 + 24 10418.3778 3743.2294 NON-DEG (Vs) : 1 0 0 0 0 1 0 0 0 + 25 10377.0712 3701.9227 NON-DEG (Vs) : 1 0 0 0 0 0 1 0 0 + 26 10385.5329 3710.3845 NON-DEG (Vs) : 1 0 0 0 0 0 0 1 0 + 27 10363.7088 3688.5603 NON-DEG (Vs) : 1 0 0 0 0 0 0 0 1 + 28 11227.7519 4552.6034 NON-DEG (Vs) : 0 1 1 0 0 0 0 0 0 + 29 10617.6212 3942.4727 NON-DEG (Vs) : 0 1 0 1 0 0 0 0 0 + 30 10481.5791 3806.4306 NON-DEG (Vs) : 0 1 0 0 1 0 0 0 0 + 31 10400.0162 3724.8677 NON-DEG (Vs) : 0 1 0 0 0 1 0 0 0 + 32 10358.6260 3683.4776 NON-DEG (Vs) : 0 1 0 0 0 0 1 0 0 + 33 10366.8071 3691.6586 NON-DEG (Vs) : 0 1 0 0 0 0 0 1 0 + 34 10344.3559 3669.2074 NON-DEG (Vs) : 0 1 0 0 0 0 0 0 1 + 35 9625.1202 2949.9718 NON-DEG (Vs) : 0 0 1 1 0 0 0 0 0 + 36 9500.9100 2825.7616 NON-DEG (Vs) : 0 0 1 0 1 0 0 0 0 + 37 9422.8640 2747.7155 NON-DEG (Vs) : 0 0 1 0 0 1 0 0 0 + 38 9382.2124 2707.0640 NON-DEG (Vs) : 0 0 1 0 0 0 1 0 0 + 39 9391.0166 2715.8682 NON-DEG (Vs) : 0 0 1 0 0 0 0 1 0 + 40 9368.6750 2693.5265 NON-DEG (Vs) : 0 0 1 0 0 0 0 0 1 + 41 8882.7754 2207.6270 NON-DEG (Vs) : 0 0 0 1 1 0 0 0 0 + 42 8810.5269 2135.3784 NON-DEG (Vs) : 0 0 0 1 0 1 0 0 0 + 43 8770.7420 2095.5936 NON-DEG (Vs) : 0 0 0 1 0 0 1 0 0 + 44 8779.6275 2104.4790 NON-DEG (Vs) : 0 0 0 1 0 0 0 1 0 + 45 8756.3206 2081.1722 NON-DEG (Vs) : 0 0 0 1 0 0 0 0 1 + 46 8677.2924 2002.1439 NON-DEG (Vs) : 0 0 0 0 1 1 0 0 0 + 47 8637.3815 1962.2330 NON-DEG (Vs) : 0 0 0 0 1 0 1 0 0 + 48 8643.7645 1968.6161 NON-DEG (Vs) : 0 0 0 0 1 0 0 1 0 + 49 8617.4627 1942.3143 NON-DEG (Vs) : 0 0 0 0 1 0 0 0 1 + 50 8558.1388 1882.9903 NON-DEG (Vs) : 0 0 0 0 0 1 1 0 0 + 51 8557.2801 1882.1317 NON-DEG (Vs) : 0 0 0 0 0 1 0 1 0 + 52 8543.2130 1868.0645 NON-DEG (Vs) : 0 0 0 0 0 1 0 0 1 + 53 8524.3863 1849.2378 NON-DEG (Vs) : 0 0 0 0 0 0 1 1 0 + 54 8496.4700 1821.3215 NON-DEG (Vs) : 0 0 0 0 0 0 1 0 1 + 55 8512.5635 1837.4151 NON-DEG (Vs) : 0 0 0 0 0 0 0 1 1 + +Transformed Geometry (Å): + +C -0.00000000 0.89768253 0.00000000 +C -0.67626535 -0.36933549 -0.00000000 +C 0.67626535 -0.36933549 -0.00000000 +H -1.55801907 -0.94666167 -0.00000000 +H 1.55801907 -0.94666167 -0.00000000 + + +Equilibrium Rotational Constants (cm-1): + A B C + 1.142876423691 1.062308047247 0.550560208407 + +Geometry: +C -0.00000000 0.89768253 0.00000000 +C -0.67626535 -0.36933549 -0.00000000 +C 0.67626535 -0.36933549 -0.00000000 +H -1.55801907 -0.94666167 -0.00000000 +H 1.55801907 -0.94666167 -0.00000000 + +Vibrational Frequencies (cm-1): + Mode Symm Harm Fund Corr + 1 A1 2819.3 2782.2 2783.0 + 2 B2 2798.3 2762.7 2763.3 + 3 A1 1819.9 1790.9 1776.4 + 4 A1 1199.6 1177.8 1177.8 + 5 B2 1061.2 1041.3 1041.3 + 6 A2 964.4 960.0 960.0 + 7 B2 932.0 920.6 920.6 + 8 B1 930.9 927.4 927.4 + 9 A1 913.1 906.1 906.1 + +ZPT = 6675.1 + +Rotational Constants (cm-1): + State A B C + 0 0 0 0 0 0 0 0 0 1.1407734 1.0611362 0.5480720 + 1 0 0 0 0 0 0 0 0 1.1406319 1.0603793 0.5478438 + 0 1 0 0 0 0 0 0 0 1.1406670 1.0606278 0.5479173 + 0 0 1 0 0 0 0 0 0 1.1397112 1.0569160 0.5467306 + 0 0 0 1 0 0 0 0 0 1.1447565 1.0596411 0.5479643 + 0 0 0 0 1 0 0 0 0 1.1359400 1.0654247 0.5467114 + 0 0 0 0 0 1 0 0 0 1.1409831 1.0582644 0.5487409 + 0 0 0 0 0 0 1 0 0 1.1397849 1.0642179 0.5475052 + 0 0 0 0 0 0 0 1 0 1.1370221 1.0591375 0.5487139 + 0 0 0 0 0 0 0 0 1 1.1432616 1.0632694 0.5455443 + +Quartic Distortion Constants (cm-1): +Watson A Reduction +Delta J: 0.000001188203 +Delta K: 0.000001639286 +Delta JK: 0.000001162612 +delta J: 0.000000486883 +delta k: 0.000001733857 + +Watson S Reduction +D J : 0.000000528879 +D JK: 0.000005118555 +D K : -0.000001657333 +d 1 : -0.000000486883 +d 2 : -0.000000329662 + +Linear Molecules +De : 0.000000000000 + +Sextic Distortion Constants (cm-1): +Watson A Reduction +Phi J: 3.065449747733e-12 +Phi K: 2.249299001163e-10 +Phi JK: 6.539915598277e-11 +Phi KJ: -2.646240718131e-10 +phi J: 1.521237749685e-12 +phi JK: 3.495475781744e-11 +phi k: -1.880566782911e-11 + +Watson S Reduction +H J: -4.794959455171e-12 +H K: 2.313085902779e-10 +H JK: 1.152953355552e-10 +H KJ: -3.130385323442e-10 +h 1: 1.651178662715e-12 +h 2: 3.930204601452e-12 +h 3: -1.299409130301e-13 + +Linear Molecule +He : 0.000000000000e0 + + +Coriolis Resonances: + 4 3 C + 5 4 A + 6 5 A + 7 6 B + 8 5 B + 8 7 A + +Type 1 Fermi Resonances: + 5 2 + 6 2 + 7 2 + 8 2 + +Type 2 Fermi Resonances: + 4 2 1 + 6 2 1 + 6 4 2 + 8 2 0 + +normal termination of pbqff From 7ac849a74bbd7304777854f1ebb5dc7b875fda14 Mon Sep 17 00:00:00 2001 From: Brent Westbrook Date: Sat, 30 Nov 2024 16:26:59 -0500 Subject: [PATCH 10/35] update snapshot to ignore PID --- Cargo.lock | 1 + Cargo.toml | 2 +- tests/cart.rs | 10 ++++++++-- tests/snapshots/cart__cart.snap | 4 ++-- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ce28122..2df7d30 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -417,6 +417,7 @@ dependencies = [ "console", "lazy_static", "linked-hash-map", + "regex", "similar", ] diff --git a/Cargo.toml b/Cargo.toml index a2e1b19..1f28a27 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -26,7 +26,7 @@ log = "0.4.22" approx = "0.5.1" tempfile = "3.14.0" assert_cmd = "2.0.16" -insta = "1.41.1" +insta = { version = "1.41.1", features = ["filters"] } [[bin]] name = "cart" diff --git a/tests/cart.rs b/tests/cart.rs index 1b62d8b..efa102c 100644 --- a/tests/cart.rs +++ b/tests/cart.rs @@ -1,7 +1,7 @@ use std::{fs::read_to_string, path::Path}; use assert_cmd::Command; -use insta::assert_snapshot; +use insta::{assert_snapshot, with_settings}; use tempfile::tempdir; #[test] @@ -20,7 +20,13 @@ fn cart() -> std::io::Result<()> { read_to_string(dir.path().join("pbqff.log"))?, ); - assert_snapshot!(read_to_string(dir.path().join("pbqff.out"))?); + with_settings!( + {filters => vec![ + (r"PID: \d+", "PID: [PID]"), + ]}, { + assert_snapshot!(read_to_string(dir.path().join("pbqff.out")).unwrap()); + } + ); Ok(()) } diff --git a/tests/snapshots/cart__cart.snap b/tests/snapshots/cart__cart.snap index 1437783..9a3dff5 100644 --- a/tests/snapshots/cart__cart.snap +++ b/tests/snapshots/cart__cart.snap @@ -1,9 +1,9 @@ --- source: tests/cart.rs -expression: "read_to_string(dir.path().join(\"pbqff.out\"))?" +expression: "read_to_string(dir.path().join(\"pbqff.out\")).unwrap()" snapshot_kind: text --- -PID: 3507331 +PID: [PID] version: deadbeef normalized geometry: From ec63c82b944ff22c3ddb5c30a2f6d65b3768ca72 Mon Sep 17 00:00:00 2001 From: Brent Westbrook Date: Sat, 30 Nov 2024 17:09:22 -0500 Subject: [PATCH 11/35] redact numerical results from cart snapshot --- tests/cart.rs | 11 ++- tests/snapshots/cart__cart.snap | 154 ++------------------------------ 2 files changed, 18 insertions(+), 147 deletions(-) diff --git a/tests/cart.rs b/tests/cart.rs index efa102c..5486ac8 100644 --- a/tests/cart.rs +++ b/tests/cart.rs @@ -20,9 +20,18 @@ fn cart() -> std::io::Result<()> { read_to_string(dir.path().join("pbqff.log"))?, ); + // filter out essentially all of the numerical results just to check that + // all of the sections are there with_settings!( {filters => vec![ - (r"PID: \d+", "PID: [PID]"), + (r"(?m)^PID: \d+$", "PID: [PID]"), + (r"(?s)(normalized geometry:).*(point group)", "$1[Normalized Geometry]\n$2"), + (r"(?ms)^STATE NO.*?^$", "[Vibrational States]"), + (r"(?s)(Transformed Geometry \(Å\):).*(Equilibrium)", "$1\n[Transformed Geometry]\n$2"), + (r"(?ms)(Equilibrium Rotational Constants \(cm-1\):).*?^$", "$1\n[Rotational Constants]\n"), + (r"(?s)(Geometry:).*(Vibrational)", "$1\n[Geometry]\n$2"), + (r"(?s)(Vibrational Frequencies \(cm-1\):).*?(ZPT)", "$1\n[Freqs]\n$2"), + (r"(?ms)(^Rotational Constants \(cm-1\):).*?(Coriolis Resonances)", "$1\n[Rotational Constants]\n$2"), ]}, { assert_snapshot!(read_to_string(dir.path().join("pbqff.out")).unwrap()); } diff --git a/tests/snapshots/cart__cart.snap b/tests/snapshots/cart__cart.snap index 9a3dff5..6435fb1 100644 --- a/tests/snapshots/cart__cart.snap +++ b/tests/snapshots/cart__cart.snap @@ -5,161 +5,23 @@ snapshot_kind: text --- PID: [PID] version: deadbeef -normalized geometry: - -C -0.00000000 -0.89768253 0.00000000 -C -0.67626535 0.36933549 0.00000000 -C 0.67626535 0.36933549 -0.00000000 -H -1.55801907 0.94666167 -0.00000000 -H 1.55801907 0.94666167 0.00000000 - +normalized geometry:[Normalized Geometry] point group:C2v(Axis(Y), Plane(Axis(Y), Axis(Z)), Plane(Axis(X), Axis(Y))) 15 Cartesian coordinates requires 11952 points -STATE NO. ENERGY (CM-1) ABOVE ZPT VIBRATIONAL STATE - 1 6675.1484 0.0000 NON-DEG (Vs) : 0 0 0 0 0 0 0 0 0 - 2 9458.1841 2783.0356 NON-DEG (Vs) : 1 0 0 0 0 0 0 0 0 - 3 9438.4238 2763.2754 NON-DEG (Vs) : 0 1 0 0 0 0 0 0 0 - 4 8451.5311 1776.3827 NON-DEG (Vs) : 0 0 1 0 0 0 0 0 0 - 5 7852.9724 1177.8240 NON-DEG (Vs) : 0 0 0 1 0 0 0 0 0 - 6 7716.4124 1041.2640 NON-DEG (Vs) : 0 0 0 0 1 0 0 0 0 - 7 7635.1650 960.0165 NON-DEG (Vs) : 0 0 0 0 0 1 0 0 0 - 8 7595.7362 920.5877 NON-DEG (Vs) : 0 0 0 0 0 0 1 0 0 - 9 7602.4989 927.3505 NON-DEG (Vs) : 0 0 0 0 0 0 0 1 0 - 10 7581.2336 906.0851 NON-DEG (Vs) : 0 0 0 0 0 0 0 0 1 - 11 12220.3766 5545.2282 NON-DEG (Vs) : 2 0 0 0 0 0 0 0 0 - 12 12180.6648 5505.5164 NON-DEG (Vs) : 0 2 0 0 0 0 0 0 0 - 13 10248.0779 3572.9294 NON-DEG (Vs) : 0 0 2 0 0 0 0 0 0 - 14 9025.9905 2350.8420 NON-DEG (Vs) : 0 0 0 2 0 0 0 0 0 - 15 8750.2987 2075.1503 NON-DEG (Vs) : 0 0 0 0 2 0 0 0 0 - 16 8593.3920 1918.2436 NON-DEG (Vs) : 0 0 0 0 0 2 0 0 0 - 17 8513.7222 1838.5737 NON-DEG (Vs) : 0 0 0 0 0 0 2 0 0 - 18 8528.2210 1853.0725 NON-DEG (Vs) : 0 0 0 0 0 0 0 2 0 - 19 8488.2359 1813.0875 NON-DEG (Vs) : 0 0 0 0 0 0 0 0 2 - 20 12180.8183 5505.6698 NON-DEG (Vs) : 1 1 0 0 0 0 0 0 0 - 21 11245.9314 4570.7830 NON-DEG (Vs) : 1 0 1 0 0 0 0 0 0 - 22 10638.2701 3963.1217 NON-DEG (Vs) : 1 0 0 1 0 0 0 0 0 - 23 10499.8008 3824.6523 NON-DEG (Vs) : 1 0 0 0 1 0 0 0 0 - 24 10418.3778 3743.2294 NON-DEG (Vs) : 1 0 0 0 0 1 0 0 0 - 25 10377.0712 3701.9227 NON-DEG (Vs) : 1 0 0 0 0 0 1 0 0 - 26 10385.5329 3710.3845 NON-DEG (Vs) : 1 0 0 0 0 0 0 1 0 - 27 10363.7088 3688.5603 NON-DEG (Vs) : 1 0 0 0 0 0 0 0 1 - 28 11227.7519 4552.6034 NON-DEG (Vs) : 0 1 1 0 0 0 0 0 0 - 29 10617.6212 3942.4727 NON-DEG (Vs) : 0 1 0 1 0 0 0 0 0 - 30 10481.5791 3806.4306 NON-DEG (Vs) : 0 1 0 0 1 0 0 0 0 - 31 10400.0162 3724.8677 NON-DEG (Vs) : 0 1 0 0 0 1 0 0 0 - 32 10358.6260 3683.4776 NON-DEG (Vs) : 0 1 0 0 0 0 1 0 0 - 33 10366.8071 3691.6586 NON-DEG (Vs) : 0 1 0 0 0 0 0 1 0 - 34 10344.3559 3669.2074 NON-DEG (Vs) : 0 1 0 0 0 0 0 0 1 - 35 9625.1202 2949.9718 NON-DEG (Vs) : 0 0 1 1 0 0 0 0 0 - 36 9500.9100 2825.7616 NON-DEG (Vs) : 0 0 1 0 1 0 0 0 0 - 37 9422.8640 2747.7155 NON-DEG (Vs) : 0 0 1 0 0 1 0 0 0 - 38 9382.2124 2707.0640 NON-DEG (Vs) : 0 0 1 0 0 0 1 0 0 - 39 9391.0166 2715.8682 NON-DEG (Vs) : 0 0 1 0 0 0 0 1 0 - 40 9368.6750 2693.5265 NON-DEG (Vs) : 0 0 1 0 0 0 0 0 1 - 41 8882.7754 2207.6270 NON-DEG (Vs) : 0 0 0 1 1 0 0 0 0 - 42 8810.5269 2135.3784 NON-DEG (Vs) : 0 0 0 1 0 1 0 0 0 - 43 8770.7420 2095.5936 NON-DEG (Vs) : 0 0 0 1 0 0 1 0 0 - 44 8779.6275 2104.4790 NON-DEG (Vs) : 0 0 0 1 0 0 0 1 0 - 45 8756.3206 2081.1722 NON-DEG (Vs) : 0 0 0 1 0 0 0 0 1 - 46 8677.2924 2002.1439 NON-DEG (Vs) : 0 0 0 0 1 1 0 0 0 - 47 8637.3815 1962.2330 NON-DEG (Vs) : 0 0 0 0 1 0 1 0 0 - 48 8643.7645 1968.6161 NON-DEG (Vs) : 0 0 0 0 1 0 0 1 0 - 49 8617.4627 1942.3143 NON-DEG (Vs) : 0 0 0 0 1 0 0 0 1 - 50 8558.1388 1882.9903 NON-DEG (Vs) : 0 0 0 0 0 1 1 0 0 - 51 8557.2801 1882.1317 NON-DEG (Vs) : 0 0 0 0 0 1 0 1 0 - 52 8543.2130 1868.0645 NON-DEG (Vs) : 0 0 0 0 0 1 0 0 1 - 53 8524.3863 1849.2378 NON-DEG (Vs) : 0 0 0 0 0 0 1 1 0 - 54 8496.4700 1821.3215 NON-DEG (Vs) : 0 0 0 0 0 0 1 0 1 - 55 8512.5635 1837.4151 NON-DEG (Vs) : 0 0 0 0 0 0 0 1 1 - +[Vibrational States] Transformed Geometry (Å): - -C -0.00000000 0.89768253 0.00000000 -C -0.67626535 -0.36933549 -0.00000000 -C 0.67626535 -0.36933549 -0.00000000 -H -1.55801907 -0.94666167 -0.00000000 -H 1.55801907 -0.94666167 -0.00000000 - - +[Transformed Geometry] Equilibrium Rotational Constants (cm-1): - A B C - 1.142876423691 1.062308047247 0.550560208407 - -Geometry: -C -0.00000000 0.89768253 0.00000000 -C -0.67626535 -0.36933549 -0.00000000 -C 0.67626535 -0.36933549 -0.00000000 -H -1.55801907 -0.94666167 -0.00000000 -H 1.55801907 -0.94666167 -0.00000000 +[Rotational Constants] +Geometry: +[Geometry] Vibrational Frequencies (cm-1): - Mode Symm Harm Fund Corr - 1 A1 2819.3 2782.2 2783.0 - 2 B2 2798.3 2762.7 2763.3 - 3 A1 1819.9 1790.9 1776.4 - 4 A1 1199.6 1177.8 1177.8 - 5 B2 1061.2 1041.3 1041.3 - 6 A2 964.4 960.0 960.0 - 7 B2 932.0 920.6 920.6 - 8 B1 930.9 927.4 927.4 - 9 A1 913.1 906.1 906.1 - +[Freqs] ZPT = 6675.1 Rotational Constants (cm-1): - State A B C - 0 0 0 0 0 0 0 0 0 1.1407734 1.0611362 0.5480720 - 1 0 0 0 0 0 0 0 0 1.1406319 1.0603793 0.5478438 - 0 1 0 0 0 0 0 0 0 1.1406670 1.0606278 0.5479173 - 0 0 1 0 0 0 0 0 0 1.1397112 1.0569160 0.5467306 - 0 0 0 1 0 0 0 0 0 1.1447565 1.0596411 0.5479643 - 0 0 0 0 1 0 0 0 0 1.1359400 1.0654247 0.5467114 - 0 0 0 0 0 1 0 0 0 1.1409831 1.0582644 0.5487409 - 0 0 0 0 0 0 1 0 0 1.1397849 1.0642179 0.5475052 - 0 0 0 0 0 0 0 1 0 1.1370221 1.0591375 0.5487139 - 0 0 0 0 0 0 0 0 1 1.1432616 1.0632694 0.5455443 - -Quartic Distortion Constants (cm-1): -Watson A Reduction -Delta J: 0.000001188203 -Delta K: 0.000001639286 -Delta JK: 0.000001162612 -delta J: 0.000000486883 -delta k: 0.000001733857 - -Watson S Reduction -D J : 0.000000528879 -D JK: 0.000005118555 -D K : -0.000001657333 -d 1 : -0.000000486883 -d 2 : -0.000000329662 - -Linear Molecules -De : 0.000000000000 - -Sextic Distortion Constants (cm-1): -Watson A Reduction -Phi J: 3.065449747733e-12 -Phi K: 2.249299001163e-10 -Phi JK: 6.539915598277e-11 -Phi KJ: -2.646240718131e-10 -phi J: 1.521237749685e-12 -phi JK: 3.495475781744e-11 -phi k: -1.880566782911e-11 - -Watson S Reduction -H J: -4.794959455171e-12 -H K: 2.313085902779e-10 -H JK: 1.152953355552e-10 -H KJ: -3.130385323442e-10 -h 1: 1.651178662715e-12 -h 2: 3.930204601452e-12 -h 3: -1.299409130301e-13 - -Linear Molecule -He : 0.000000000000e0 - - +[Rotational Constants] Coriolis Resonances: 4 3 C 5 4 A From 486237bee7598a748d211778d97cf86f0f8b2ff4 Mon Sep 17 00:00:00 2001 From: Brent Westbrook Date: Sat, 30 Nov 2024 20:34:38 -0500 Subject: [PATCH 12/35] use insta for config tests --- .../pbqff__config__tests__config.snap | 27 +++++ .../pbqff__config__tests__normal.snap | 27 +++++ .../pbqff__config__tests__path_template.snap | 27 +++++ src/config/tests.rs | 110 +----------------- 4 files changed, 86 insertions(+), 105 deletions(-) create mode 100644 src/config/snapshots/pbqff__config__tests__config.snap create mode 100644 src/config/snapshots/pbqff__config__tests__normal.snap create mode 100644 src/config/snapshots/pbqff__config__tests__path_template.snap diff --git a/src/config/snapshots/pbqff__config__tests__config.snap b/src/config/snapshots/pbqff__config__tests__config.snap new file mode 100644 index 0000000..3c5bf6c --- /dev/null +++ b/src/config/snapshots/pbqff__config__tests__config.snap @@ -0,0 +1,27 @@ +--- +source: src/config/tests.rs +expression: "Config::load(\"testfiles/test.toml\")" +snapshot_kind: text +--- +Config { + geometry: Zmat( + "C\nC 1 CC\nC 1 CC 2 CCC\nH 2 CH 1 HCC 3 180.0\nH 3 CH 1 HCC 2 180.0\n\nCC = 1.42101898\nCCC = 55.60133141\nCH = 1.07692776\nHCC = 147.81488230\n", + ), + optimize: true, + charge: 0, + step_size: 0.005, + coord_type: Sic, + template: "scfcrt=1.D-21 aux(precision=14 comp xp xs xw) PM6 THREADS=1", + hybrid_template: "scfcrt=1.D-21 aux(precision=14 comp xp xs xw) PM6 THREADS=1", + queue_template: None, + program: Mopac, + queue: Slurm, + sleep_int: 2, + job_limit: 2048, + chunk_size: 1, + findiff: false, + check_int: 100, + weights: None, + dummy_atoms: None, + norm_resume_hff: false, +} diff --git a/src/config/snapshots/pbqff__config__tests__normal.snap b/src/config/snapshots/pbqff__config__tests__normal.snap new file mode 100644 index 0000000..cbe738b --- /dev/null +++ b/src/config/snapshots/pbqff__config__tests__normal.snap @@ -0,0 +1,27 @@ +--- +source: src/config/tests.rs +expression: "Config::load(\"testfiles/normal.toml\")" +snapshot_kind: text +--- +Config { + geometry: Zmat( + "O\nH 1 OH\nH 1 OH 2 HOH\n\nOH = 1.0\nHOH = 109.5\n", + ), + optimize: true, + charge: 0, + step_size: 0.005, + coord_type: Normal, + template: "scfcrt=1.D-21 aux(precision=14 comp xp xs xw) PM6 THREADS=1", + hybrid_template: "scfcrt=1.D-21 aux(precision=14 comp xp xs xw) PM6 THREADS=1", + queue_template: None, + program: Mopac, + queue: Slurm, + sleep_int: 2, + job_limit: 2048, + chunk_size: 1, + findiff: false, + check_int: 0, + weights: None, + dummy_atoms: None, + norm_resume_hff: true, +} diff --git a/src/config/snapshots/pbqff__config__tests__path_template.snap b/src/config/snapshots/pbqff__config__tests__path_template.snap new file mode 100644 index 0000000..d30c2e7 --- /dev/null +++ b/src/config/snapshots/pbqff__config__tests__path_template.snap @@ -0,0 +1,27 @@ +--- +source: src/config/tests.rs +expression: "Config::load(\"testfiles/path.toml\")" +snapshot_kind: text +--- +Config { + geometry: Zmat( + "C\nC 1 CC\nC 1 CC 2 CCC\nH 2 CH 1 HCC 3 180.0\nH 3 CH 1 HCC 2 180.0\n\nCC = 1.42101898\nCCC = 55.60133141\nCH = 1.07692776\nHCC = 147.81488230\n", + ), + optimize: true, + charge: 0, + step_size: 0.005, + coord_type: Sic, + template: "scfcrt=1.D-21 aux(precision=14 comp xp xs xw) PM6 THREADS=1", + hybrid_template: "scfcrt=1.D-21 aux(precision=14 comp xp xs xw) PM6 THREADS=1", + queue_template: None, + program: Mopac, + queue: Slurm, + sleep_int: 2, + job_limit: 2048, + chunk_size: 1, + findiff: false, + check_int: 100, + weights: None, + dummy_atoms: None, + norm_resume_hff: false, +} diff --git a/src/config/tests.rs b/src/config/tests.rs index a0bbe75..9eb7303 100644 --- a/src/config/tests.rs +++ b/src/config/tests.rs @@ -1,118 +1,18 @@ +use insta::assert_debug_snapshot; + use super::*; #[test] fn config() { - let got = Config::load("testfiles/test.toml"); - let want = Config { - geometry: psqs::geom::Geom::Zmat( - "C -C 1 CC -C 1 CC 2 CCC -H 2 CH 1 HCC 3 180.0 -H 3 CH 1 HCC 2 180.0 - -CC = 1.42101898 -CCC = 55.60133141 -CH = 1.07692776 -HCC = 147.81488230 -" - .to_string(), - ), - optimize: true, - charge: 0, - step_size: 0.005, - coord_type: CoordType::Sic, - template: String::from( - "scfcrt=1.D-21 aux(precision=14 comp xp xs xw) PM6 THREADS=1", - ), - program: Program::Mopac, - sleep_int: 2, - job_limit: 2048, - chunk_size: 1, - queue: Queue::Slurm, - findiff: false, - check_int: 100, - queue_template: None, - hybrid_template: String::from( - "scfcrt=1.D-21 aux(precision=14 comp xp xs xw) PM6 THREADS=1", - ), - weights: None, - dummy_atoms: None, - norm_resume_hff: false, - }; - assert_eq!(got, want); + assert_debug_snapshot!(Config::load("testfiles/test.toml")); } #[test] fn path_template() { - let got = Config::load("testfiles/path.toml"); - let want = Config { - geometry: psqs::geom::Geom::Zmat( - "C -C 1 CC -C 1 CC 2 CCC -H 2 CH 1 HCC 3 180.0 -H 3 CH 1 HCC 2 180.0 - -CC = 1.42101898 -CCC = 55.60133141 -CH = 1.07692776 -HCC = 147.81488230 -" - .to_string(), - ), - optimize: true, - charge: 0, - step_size: 0.005, - coord_type: CoordType::Sic, - template: String::from( - "scfcrt=1.D-21 aux(precision=14 comp xp xs xw) PM6 THREADS=1", - ), - program: Program::Mopac, - sleep_int: 2, - job_limit: 2048, - chunk_size: 1, - queue: Queue::Slurm, - findiff: false, - check_int: 100, - queue_template: None, - hybrid_template: String::from( - "scfcrt=1.D-21 aux(precision=14 comp xp xs xw) PM6 THREADS=1", - ), - weights: None, - dummy_atoms: None, - norm_resume_hff: false, - }; - assert_eq!(got, want); + assert_debug_snapshot!(Config::load("testfiles/path.toml")); } #[test] fn normal() { - let got = Config::load("testfiles/normal.toml"); - let want = Config { - geometry: psqs::geom::Geom::Zmat( - "O\nH 1 OH\nH 1 OH 2 HOH\n\nOH = 1.0\nHOH = 109.5\n".to_string(), - ), - optimize: true, - charge: 0, - step_size: 0.005, - coord_type: CoordType::Normal, - template: "scfcrt=1.D-21 aux(precision=14 comp xp xs xw) PM6 THREADS=1" - .to_string(), - hybrid_template: - "scfcrt=1.D-21 aux(precision=14 comp xp xs xw) PM6 THREADS=1" - .to_string(), - queue_template: None, - program: Program::Mopac, - queue: Queue::Slurm, - sleep_int: 2, - job_limit: 2048, - chunk_size: 1, - findiff: false, - check_int: 0, - weights: None, - dummy_atoms: None, - norm_resume_hff: true, - }; - assert_eq!(got, want); + assert_debug_snapshot!(Config::load("testfiles/normal.toml")); } From 4266b5cc676c6592ba39e06866f9d7bf52a032ea Mon Sep 17 00:00:00 2001 From: Brent Westbrook Date: Sat, 30 Nov 2024 20:43:55 -0500 Subject: [PATCH 13/35] use test_case for config tests --- Cargo.lock | 34 +++++++++++++++++++ Cargo.toml | 1 + ... pbqff__config__tests__load_config-2.snap} | 2 +- ... pbqff__config__tests__load_config-3.snap} | 2 +- ...=> pbqff__config__tests__load_config.snap} | 2 +- src/config/tests.rs | 19 ++++------- 6 files changed, 44 insertions(+), 16 deletions(-) rename src/config/snapshots/{pbqff__config__tests__normal.snap => pbqff__config__tests__load_config-2.snap} (92%) rename src/config/snapshots/{pbqff__config__tests__config.snap => pbqff__config__tests__load_config-3.snap} (93%) rename src/config/snapshots/{pbqff__config__tests__path_template.snap => pbqff__config__tests__load_config.snap} (93%) diff --git a/Cargo.lock b/Cargo.lock index 2df7d30..2648cf0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -695,6 +695,7 @@ dependencies = [ "symm", "taylor", "tempfile", + "test-case", "toml", ] @@ -1006,6 +1007,39 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3369f5ac52d5eb6ab48c6b4ffdc8efbcad6b89c765749064ba298f2c68a16a76" +[[package]] +name = "test-case" +version = "3.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb2550dd13afcd286853192af8601920d959b14c401fcece38071d53bf0768a8" +dependencies = [ + "test-case-macros", +] + +[[package]] +name = "test-case-core" +version = "3.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adcb7fd841cd518e279be3d5a3eb0636409487998a4aff22f3de87b81e88384f" +dependencies = [ + "cfg-if", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "test-case-macros" +version = "3.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c89e72a01ed4c579669add59014b9a524d609c0c88c6a585ce37485879f6ffb" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "test-case-core", +] + [[package]] name = "tinyvec" version = "1.8.0" diff --git a/Cargo.toml b/Cargo.toml index 1f28a27..69c287b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -27,6 +27,7 @@ approx = "0.5.1" tempfile = "3.14.0" assert_cmd = "2.0.16" insta = { version = "1.41.1", features = ["filters"] } +test-case = "3.3.1" [[bin]] name = "cart" diff --git a/src/config/snapshots/pbqff__config__tests__normal.snap b/src/config/snapshots/pbqff__config__tests__load_config-2.snap similarity index 92% rename from src/config/snapshots/pbqff__config__tests__normal.snap rename to src/config/snapshots/pbqff__config__tests__load_config-2.snap index cbe738b..9484b04 100644 --- a/src/config/snapshots/pbqff__config__tests__normal.snap +++ b/src/config/snapshots/pbqff__config__tests__load_config-2.snap @@ -1,6 +1,6 @@ --- source: src/config/tests.rs -expression: "Config::load(\"testfiles/normal.toml\")" +expression: "Config::load(path)" snapshot_kind: text --- Config { diff --git a/src/config/snapshots/pbqff__config__tests__config.snap b/src/config/snapshots/pbqff__config__tests__load_config-3.snap similarity index 93% rename from src/config/snapshots/pbqff__config__tests__config.snap rename to src/config/snapshots/pbqff__config__tests__load_config-3.snap index 3c5bf6c..4a96214 100644 --- a/src/config/snapshots/pbqff__config__tests__config.snap +++ b/src/config/snapshots/pbqff__config__tests__load_config-3.snap @@ -1,6 +1,6 @@ --- source: src/config/tests.rs -expression: "Config::load(\"testfiles/test.toml\")" +expression: "Config::load(path)" snapshot_kind: text --- Config { diff --git a/src/config/snapshots/pbqff__config__tests__path_template.snap b/src/config/snapshots/pbqff__config__tests__load_config.snap similarity index 93% rename from src/config/snapshots/pbqff__config__tests__path_template.snap rename to src/config/snapshots/pbqff__config__tests__load_config.snap index d30c2e7..4a96214 100644 --- a/src/config/snapshots/pbqff__config__tests__path_template.snap +++ b/src/config/snapshots/pbqff__config__tests__load_config.snap @@ -1,6 +1,6 @@ --- source: src/config/tests.rs -expression: "Config::load(\"testfiles/path.toml\")" +expression: "Config::load(path)" snapshot_kind: text --- Config { diff --git a/src/config/tests.rs b/src/config/tests.rs index 9eb7303..26c8cea 100644 --- a/src/config/tests.rs +++ b/src/config/tests.rs @@ -1,18 +1,11 @@ use insta::assert_debug_snapshot; +use test_case::test_case; use super::*; -#[test] -fn config() { - assert_debug_snapshot!(Config::load("testfiles/test.toml")); -} - -#[test] -fn path_template() { - assert_debug_snapshot!(Config::load("testfiles/path.toml")); -} - -#[test] -fn normal() { - assert_debug_snapshot!(Config::load("testfiles/normal.toml")); +#[test_case("testfiles/test.toml")] +#[test_case("testfiles/path.toml")] +#[test_case("testfiles/normal.toml")] +fn load_config(path: &str) { + assert_debug_snapshot!(Config::load(path)); } From 3860882c9454890e511a2d59547a56523956be0a Mon Sep 17 00:00:00 2001 From: Brent Westbrook Date: Sat, 30 Nov 2024 20:58:11 -0500 Subject: [PATCH 14/35] use local queue in normal.toml, set insta suffixes to get reproducible ordering of snapshots --- ...__tests__load_config@testfiles__normal.toml.snap} | 2 +- ...ig__tests__load_config@testfiles__path.toml.snap} | 0 ...ig__tests__load_config@testfiles__test.toml.snap} | 0 src/config/tests.rs | 12 +++++++----- testfiles/normal.toml | 2 +- 5 files changed, 9 insertions(+), 7 deletions(-) rename src/config/snapshots/{pbqff__config__tests__load_config-2.snap => pbqff__config__tests__load_config@testfiles__normal.toml.snap} (97%) rename src/config/snapshots/{pbqff__config__tests__load_config-3.snap => pbqff__config__tests__load_config@testfiles__path.toml.snap} (100%) rename src/config/snapshots/{pbqff__config__tests__load_config.snap => pbqff__config__tests__load_config@testfiles__test.toml.snap} (100%) diff --git a/src/config/snapshots/pbqff__config__tests__load_config-2.snap b/src/config/snapshots/pbqff__config__tests__load_config@testfiles__normal.toml.snap similarity index 97% rename from src/config/snapshots/pbqff__config__tests__load_config-2.snap rename to src/config/snapshots/pbqff__config__tests__load_config@testfiles__normal.toml.snap index 9484b04..b6250d9 100644 --- a/src/config/snapshots/pbqff__config__tests__load_config-2.snap +++ b/src/config/snapshots/pbqff__config__tests__load_config@testfiles__normal.toml.snap @@ -15,7 +15,7 @@ Config { hybrid_template: "scfcrt=1.D-21 aux(precision=14 comp xp xs xw) PM6 THREADS=1", queue_template: None, program: Mopac, - queue: Slurm, + queue: Local, sleep_int: 2, job_limit: 2048, chunk_size: 1, diff --git a/src/config/snapshots/pbqff__config__tests__load_config-3.snap b/src/config/snapshots/pbqff__config__tests__load_config@testfiles__path.toml.snap similarity index 100% rename from src/config/snapshots/pbqff__config__tests__load_config-3.snap rename to src/config/snapshots/pbqff__config__tests__load_config@testfiles__path.toml.snap diff --git a/src/config/snapshots/pbqff__config__tests__load_config.snap b/src/config/snapshots/pbqff__config__tests__load_config@testfiles__test.toml.snap similarity index 100% rename from src/config/snapshots/pbqff__config__tests__load_config.snap rename to src/config/snapshots/pbqff__config__tests__load_config@testfiles__test.toml.snap diff --git a/src/config/tests.rs b/src/config/tests.rs index 26c8cea..aa22817 100644 --- a/src/config/tests.rs +++ b/src/config/tests.rs @@ -1,11 +1,13 @@ -use insta::assert_debug_snapshot; +use insta::{assert_debug_snapshot, with_settings}; use test_case::test_case; use super::*; -#[test_case("testfiles/test.toml")] -#[test_case("testfiles/path.toml")] -#[test_case("testfiles/normal.toml")] +#[test_case("testfiles/test.toml" ; "cart")] +#[test_case("testfiles/path.toml" ; "path templates")] +#[test_case("testfiles/normal.toml" ; "norm")] fn load_config(path: &str) { - assert_debug_snapshot!(Config::load(path)); + with_settings!({ snapshot_suffix => path }, { + assert_debug_snapshot!(Config::load(path)); + }); } diff --git a/testfiles/normal.toml b/testfiles/normal.toml index c55b2d9..fe0b583 100644 --- a/testfiles/normal.toml +++ b/testfiles/normal.toml @@ -12,7 +12,7 @@ step_size = 0.005 coord_type = "norm" norm_resume_hff = true program = "mopac" -queue = "slurm" +queue = "local" sleep_int = 2 job_limit = 2048 chunk_size = 1 From 3f1fb1fa5aa7b4e2d8ce2f2754acd45f0716c596 Mon Sep 17 00:00:00 2001 From: Brent Westbrook Date: Sat, 30 Nov 2024 21:02:36 -0500 Subject: [PATCH 15/35] add cart config case, update test.toml description to reflect sic --- ...sts__load_config@testfiles__cart.toml.snap | 27 +++++++++++++++++++ src/config/tests.rs | 5 ++-- 2 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 src/config/snapshots/pbqff__config__tests__load_config@testfiles__cart.toml.snap diff --git a/src/config/snapshots/pbqff__config__tests__load_config@testfiles__cart.toml.snap b/src/config/snapshots/pbqff__config__tests__load_config@testfiles__cart.toml.snap new file mode 100644 index 0000000..dbd1ba2 --- /dev/null +++ b/src/config/snapshots/pbqff__config__tests__load_config@testfiles__cart.toml.snap @@ -0,0 +1,27 @@ +--- +source: src/config/tests.rs +expression: "Config::load(path)" +snapshot_kind: text +--- +Config { + geometry: Zmat( + "C\nC 1 CC\nC 1 CC 2 CCC\nH 2 CH 1 HCC 3 180.0\nH 3 CH 1 HCC 2 180.0\n\nCC = 1.42101898\nCCC = 55.60133141\nCH = 1.07692776\nHCC = 147.81488230\n", + ), + optimize: true, + charge: 0, + step_size: 0.005, + coord_type: Cart, + template: "scfcrt=1.D-21 aux(precision=14 comp xp xs xw) PM6 THREADS=1", + hybrid_template: "scfcrt=1.D-21 aux(precision=14 comp xp xs xw) PM6 THREADS=1", + queue_template: None, + program: Mopac, + queue: Local, + sleep_int: 2, + job_limit: 2048, + chunk_size: 1, + findiff: false, + check_int: 100, + weights: None, + dummy_atoms: None, + norm_resume_hff: false, +} diff --git a/src/config/tests.rs b/src/config/tests.rs index aa22817..9f57081 100644 --- a/src/config/tests.rs +++ b/src/config/tests.rs @@ -3,9 +3,10 @@ use test_case::test_case; use super::*; -#[test_case("testfiles/test.toml" ; "cart")] +#[test_case("testfiles/test.toml" ; "basic sic")] +#[test_case("testfiles/cart.toml" ; "basic cart")] +#[test_case("testfiles/normal.toml" ; "basic norm")] #[test_case("testfiles/path.toml" ; "path templates")] -#[test_case("testfiles/normal.toml" ; "norm")] fn load_config(path: &str) { with_settings!({ snapshot_suffix => path }, { assert_debug_snapshot!(Config::load(path)); From fc0dfe912145a22784440271791b3cad0f475398 Mon Sep 17 00:00:00 2001 From: Brent Westbrook Date: Sat, 30 Nov 2024 21:13:32 -0500 Subject: [PATCH 16/35] move sic template to local queue --- .../pbqff__config__tests__load_config@testfiles__test.toml.snap | 2 +- testfiles/test.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/config/snapshots/pbqff__config__tests__load_config@testfiles__test.toml.snap b/src/config/snapshots/pbqff__config__tests__load_config@testfiles__test.toml.snap index 4a96214..c28ed4b 100644 --- a/src/config/snapshots/pbqff__config__tests__load_config@testfiles__test.toml.snap +++ b/src/config/snapshots/pbqff__config__tests__load_config@testfiles__test.toml.snap @@ -15,7 +15,7 @@ Config { hybrid_template: "scfcrt=1.D-21 aux(precision=14 comp xp xs xw) PM6 THREADS=1", queue_template: None, program: Mopac, - queue: Slurm, + queue: Local, sleep_int: 2, job_limit: 2048, chunk_size: 1, diff --git a/testfiles/test.toml b/testfiles/test.toml index c6ce5e3..7ed0a7b 100644 --- a/testfiles/test.toml +++ b/testfiles/test.toml @@ -15,7 +15,7 @@ charge = 0 step_size = 0.005 coord_type = "sic" program = "mopac" -queue = "slurm" +queue = "local" sleep_int = 2 job_limit = 2048 chunk_size = 1 From 8b46fd797991c82ebfc2f4f5e50ac9d5e4aeef43 Mon Sep 17 00:00:00 2001 From: Brent Westbrook Date: Sat, 30 Nov 2024 21:44:48 -0500 Subject: [PATCH 17/35] add norm.toml as copy of normal without resume_hff, parameterize run to cover the other coordinate types --- testfiles/norm.toml | 20 +++++++++++ tests/{cart.rs => run.rs} | 33 ++++++++++++------- ...=> run__run@testfiles__norm.toml.snap.new} | 33 +++++++++---------- 3 files changed, 57 insertions(+), 29 deletions(-) create mode 100644 testfiles/norm.toml rename tests/{cart.rs => run.rs} (59%) rename tests/snapshots/{cart__cart.snap => run__run@testfiles__norm.toml.snap.new} (64%) diff --git a/testfiles/norm.toml b/testfiles/norm.toml new file mode 100644 index 0000000..3f1de59 --- /dev/null +++ b/testfiles/norm.toml @@ -0,0 +1,20 @@ +geometry = """ +O +H 1 OH +H 1 OH 2 HOH + +OH = 1.0 +HOH = 109.5 +""" +optimize = true +charge = 0 +step_size = 0.005 +coord_type = "norm" +norm_resume_hff = false +program = "mopac" +queue = "local" +sleep_int = 2 +job_limit = 2048 +chunk_size = 1 +template = "scfcrt=1.D-21 aux(precision=14 comp xp xs xw) PM6 THREADS=1" +check_int = 0 \ No newline at end of file diff --git a/tests/cart.rs b/tests/run.rs similarity index 59% rename from tests/cart.rs rename to tests/run.rs index 5486ac8..1dfc746 100644 --- a/tests/cart.rs +++ b/tests/run.rs @@ -3,14 +3,22 @@ use std::{fs::read_to_string, path::Path}; use assert_cmd::Command; use insta::{assert_snapshot, with_settings}; use tempfile::tempdir; +use test_case::test_case; -#[test] -fn cart() -> std::io::Result<()> { - let config_file = Path::new("testfiles/cart.toml"); +#[test_case("testfiles/test.toml", &["testfiles/intder.in"]; "sic")] +#[test_case("testfiles/cart.toml", &[]; "cart")] +#[test_case("testfiles/norm.toml", &[]; "norm")] +fn run(path: &str, other_files: &[&str]) -> std::io::Result<()> { + let config_file = Path::new(path); let dir = tempdir()?; - std::fs::copy(config_file, dir.path().join("cart.toml"))?; + std::fs::copy(config_file, dir.path().join("pbqff.toml"))?; + for file in other_files { + let p = Path::new(file); + let filename = p.file_name().unwrap(); + std::fs::copy(file, dir.path().join(filename))?; + } let mut cmd = Command::cargo_bin("pbqff").unwrap(); - let assert = cmd.arg("cart.toml").current_dir(&dir).assert(); + let assert = cmd.arg("pbqff.toml").current_dir(&dir).assert(); let output = assert.get_output(); assert!( @@ -22,20 +30,23 @@ fn cart() -> std::io::Result<()> { // filter out essentially all of the numerical results just to check that // all of the sections are there - with_settings!( - {filters => vec![ + with_settings!({ + filters => vec![ (r"(?m)^PID: \d+$", "PID: [PID]"), (r"(?s)(normalized geometry:).*(point group)", "$1[Normalized Geometry]\n$2"), + (r"(?ms)^Normal Coordinates:.*?^$", "[Normal Coordinates]"), (r"(?ms)^STATE NO.*?^$", "[Vibrational States]"), (r"(?s)(Transformed Geometry \(Å\):).*(Equilibrium)", "$1\n[Transformed Geometry]\n$2"), (r"(?ms)(Equilibrium Rotational Constants \(cm-1\):).*?^$", "$1\n[Rotational Constants]\n"), (r"(?s)(Geometry:).*(Vibrational)", "$1\n[Geometry]\n$2"), (r"(?s)(Vibrational Frequencies \(cm-1\):).*?(ZPT)", "$1\n[Freqs]\n$2"), (r"(?ms)(^Rotational Constants \(cm-1\):).*?(Coriolis Resonances)", "$1\n[Rotational Constants]\n$2"), - ]}, { - assert_snapshot!(read_to_string(dir.path().join("pbqff.out")).unwrap()); - } - ); + ], + snapshot_suffix => path + + }, { + assert_snapshot!(read_to_string(dir.path().join("pbqff.out")).unwrap()); + }); Ok(()) } diff --git a/tests/snapshots/cart__cart.snap b/tests/snapshots/run__run@testfiles__norm.toml.snap.new similarity index 64% rename from tests/snapshots/cart__cart.snap rename to tests/snapshots/run__run@testfiles__norm.toml.snap.new index 6435fb1..38719dd 100644 --- a/tests/snapshots/cart__cart.snap +++ b/tests/snapshots/run__run@testfiles__norm.toml.snap.new @@ -1,5 +1,6 @@ --- -source: tests/cart.rs +source: tests/run.rs +assertion_line: 48 expression: "read_to_string(dir.path().join(\"pbqff.out\")).unwrap()" snapshot_kind: text --- @@ -7,8 +8,16 @@ PID: [PID] version: deadbeef normalized geometry:[Normalized Geometry] point group:C2v(Axis(Y), Plane(Axis(Y), Axis(Z)), Plane(Axis(X), Axis(Y))) -15 Cartesian coordinates requires 11952 points -[Vibrational States] +9 Cartesian coordinates requires 64 points +[Normal Coordinates] + +Harmonic Frequencies: + 0 A1 2602.7 + 1 B2 2523.5 + 2 A1 1315.5 +3 normal coordinates require 69 points +anpass sum of squared residuals: 3.47850821e-19 + Transformed Geometry (Å): [Transformed Geometry] Equilibrium Rotational Constants (cm-1): @@ -18,28 +27,16 @@ Geometry: [Geometry] Vibrational Frequencies (cm-1): [Freqs] -ZPT = 6675.1 +ZPT = 3158.7 Rotational Constants (cm-1): [Rotational Constants] Coriolis Resonances: - 4 3 C - 5 4 A - 6 5 A - 7 6 B - 8 5 B - 8 7 A + 1 0 C Type 1 Fermi Resonances: - 5 2 - 6 2 - 7 2 - 8 2 + 2 0 Type 2 Fermi Resonances: - 4 2 1 - 6 2 1 - 6 4 2 - 8 2 0 normal termination of pbqff From 3df5fc00bf393ebe42fe05133a4846a4140787e8 Mon Sep 17 00:00:00 2001 From: Brent Westbrook Date: Sat, 30 Nov 2024 21:46:52 -0500 Subject: [PATCH 18/35] catch missing verbose for normals thanks snapshot tests --- src/coord_type/normal.rs | 1 + ...__norm.toml.snap.new => run__run@testfiles__norm.toml.snap} | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) rename tests/snapshots/{run__run@testfiles__norm.toml.snap.new => run__run@testfiles__norm.toml.snap} (97%) diff --git a/src/coord_type/normal.rs b/src/coord_type/normal.rs index f7592a2..d01544e 100644 --- a/src/coord_type/normal.rs +++ b/src/coord_type/normal.rs @@ -893,6 +893,7 @@ impl Normal { mol.to_bohr(); let mut spectro = Spectro::from(mol); spectro.header = SPECTRO_HEADER.to_vec(); + spectro.verbose = true; // write input if let Some(dir) = dir { diff --git a/tests/snapshots/run__run@testfiles__norm.toml.snap.new b/tests/snapshots/run__run@testfiles__norm.toml.snap similarity index 97% rename from tests/snapshots/run__run@testfiles__norm.toml.snap.new rename to tests/snapshots/run__run@testfiles__norm.toml.snap index 38719dd..8bef57f 100644 --- a/tests/snapshots/run__run@testfiles__norm.toml.snap.new +++ b/tests/snapshots/run__run@testfiles__norm.toml.snap @@ -1,6 +1,5 @@ --- source: tests/run.rs -assertion_line: 48 expression: "read_to_string(dir.path().join(\"pbqff.out\")).unwrap()" snapshot_kind: text --- @@ -17,7 +16,7 @@ Harmonic Frequencies: 2 A1 1315.5 3 normal coordinates require 69 points anpass sum of squared residuals: 3.47850821e-19 - +[Vibrational States] Transformed Geometry (Å): [Transformed Geometry] Equilibrium Rotational Constants (cm-1): From 41dd39ad923c7a2a4542e1e6880064a9b6ded0e0 Mon Sep 17 00:00:00 2001 From: Brent Westbrook Date: Sat, 30 Nov 2024 21:57:10 -0500 Subject: [PATCH 19/35] add new snapshots --- .../run__run@testfiles__cart.toml.snap | 45 ++++++++++++ .../run__run@testfiles__test.toml.snap | 69 +++++++++++++++++++ 2 files changed, 114 insertions(+) create mode 100644 tests/snapshots/run__run@testfiles__cart.toml.snap create mode 100644 tests/snapshots/run__run@testfiles__test.toml.snap diff --git a/tests/snapshots/run__run@testfiles__cart.toml.snap b/tests/snapshots/run__run@testfiles__cart.toml.snap new file mode 100644 index 0000000..f3779f2 --- /dev/null +++ b/tests/snapshots/run__run@testfiles__cart.toml.snap @@ -0,0 +1,45 @@ +--- +source: tests/run.rs +expression: "read_to_string(dir.path().join(\"pbqff.out\")).unwrap()" +snapshot_kind: text +--- +PID: [PID] +version: deadbeef +normalized geometry:[Normalized Geometry] +point group:C2v(Axis(Y), Plane(Axis(Y), Axis(Z)), Plane(Axis(X), Axis(Y))) +15 Cartesian coordinates requires 11952 points +[Vibrational States] +Transformed Geometry (Å): +[Transformed Geometry] +Equilibrium Rotational Constants (cm-1): +[Rotational Constants] + +Geometry: +[Geometry] +Vibrational Frequencies (cm-1): +[Freqs] +ZPT = 6675.1 + +Rotational Constants (cm-1): +[Rotational Constants] +Coriolis Resonances: + 4 3 C + 5 4 A + 6 5 A + 7 6 B + 8 5 B + 8 7 A + +Type 1 Fermi Resonances: + 5 2 + 6 2 + 7 2 + 8 2 + +Type 2 Fermi Resonances: + 4 2 1 + 6 2 1 + 6 4 2 + 8 2 0 + +normal termination of pbqff diff --git a/tests/snapshots/run__run@testfiles__test.toml.snap b/tests/snapshots/run__run@testfiles__test.toml.snap new file mode 100644 index 0000000..31c7ba9 --- /dev/null +++ b/tests/snapshots/run__run@testfiles__test.toml.snap @@ -0,0 +1,69 @@ +--- +source: tests/run.rs +expression: "read_to_string(dir.path().join(\"pbqff.out\")).unwrap()" +snapshot_kind: text +--- +PID: [PID] +version: deadbeef + +Configuration Options: +geometry = { +C +C 1 CC +C 1 CC 2 CCC +H 2 CH 1 HCC 3 180.0 +H 3 CH 1 HCC 2 180.0 + +CC = 1.42101898 +CCC = 55.60133141 +CH = 1.07692776 +HCC = 147.81488230 + +} +optimize = true +charge = 0 +step_size = 0.005 +coord_type = sic +template = scfcrt=1.D-21 aux(precision=14 comp xp xs xw) PM6 THREADS=1 +hybrid_template = scfcrt=1.D-21 aux(precision=14 comp xp xs xw) PM6 THREADS=1 +queue_template = +program = mopac +queue = local +sleep_int = 2 +job_limit = 2048 +chunk_size = 1 +findiff = false +check_int = 100 +dummy_atoms = None +norm_resume_hff = false + +Optimized Geometry: +[Geometry] +Vibrational Frequencies (cm-1): +[Freqs] +ZPT = 6673.9 + +Rotational Constants (cm-1): +[Rotational Constants] +Coriolis Resonances: + 4 3 C + 5 4 A + 6 5 A + 7 6 B + 8 5 B + 8 7 A + +Type 1 Fermi Resonances: + 5 2 + 6 2 + 7 2 + 8 2 + +Type 2 Fermi Resonances: + 3 2 0 + 4 2 1 + 6 2 1 + 6 4 2 + 8 2 0 + +normal termination of pbqff From 9f634ccf022ecf70467b9d7cf418e97c32e6604c Mon Sep 17 00:00:00 2001 From: Brent Westbrook Date: Sat, 30 Nov 2024 22:09:55 -0500 Subject: [PATCH 20/35] redact version and anpass residuals --- tests/run.rs | 2 ++ tests/snapshots/run__run@testfiles__cart.toml.snap | 2 +- tests/snapshots/run__run@testfiles__norm.toml.snap | 4 ++-- tests/snapshots/run__run@testfiles__test.toml.snap | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/run.rs b/tests/run.rs index 1dfc746..37b69f2 100644 --- a/tests/run.rs +++ b/tests/run.rs @@ -33,6 +33,7 @@ fn run(path: &str, other_files: &[&str]) -> std::io::Result<()> { with_settings!({ filters => vec![ (r"(?m)^PID: \d+$", "PID: [PID]"), + (r"(?m)^version: [a-z0-9]+$", "version: [version]"), (r"(?s)(normalized geometry:).*(point group)", "$1[Normalized Geometry]\n$2"), (r"(?ms)^Normal Coordinates:.*?^$", "[Normal Coordinates]"), (r"(?ms)^STATE NO.*?^$", "[Vibrational States]"), @@ -41,6 +42,7 @@ fn run(path: &str, other_files: &[&str]) -> std::io::Result<()> { (r"(?s)(Geometry:).*(Vibrational)", "$1\n[Geometry]\n$2"), (r"(?s)(Vibrational Frequencies \(cm-1\):).*?(ZPT)", "$1\n[Freqs]\n$2"), (r"(?ms)(^Rotational Constants \(cm-1\):).*?(Coriolis Resonances)", "$1\n[Rotational Constants]\n$2"), + (r"(?m)^(anpass sum of squared residuals):(.+)$", "$1: [residual]"), ], snapshot_suffix => path diff --git a/tests/snapshots/run__run@testfiles__cart.toml.snap b/tests/snapshots/run__run@testfiles__cart.toml.snap index f3779f2..2f7b2ac 100644 --- a/tests/snapshots/run__run@testfiles__cart.toml.snap +++ b/tests/snapshots/run__run@testfiles__cart.toml.snap @@ -4,7 +4,7 @@ expression: "read_to_string(dir.path().join(\"pbqff.out\")).unwrap()" snapshot_kind: text --- PID: [PID] -version: deadbeef +version: [version] normalized geometry:[Normalized Geometry] point group:C2v(Axis(Y), Plane(Axis(Y), Axis(Z)), Plane(Axis(X), Axis(Y))) 15 Cartesian coordinates requires 11952 points diff --git a/tests/snapshots/run__run@testfiles__norm.toml.snap b/tests/snapshots/run__run@testfiles__norm.toml.snap index 8bef57f..4dfe796 100644 --- a/tests/snapshots/run__run@testfiles__norm.toml.snap +++ b/tests/snapshots/run__run@testfiles__norm.toml.snap @@ -4,7 +4,7 @@ expression: "read_to_string(dir.path().join(\"pbqff.out\")).unwrap()" snapshot_kind: text --- PID: [PID] -version: deadbeef +version: [version] normalized geometry:[Normalized Geometry] point group:C2v(Axis(Y), Plane(Axis(Y), Axis(Z)), Plane(Axis(X), Axis(Y))) 9 Cartesian coordinates requires 64 points @@ -15,7 +15,7 @@ Harmonic Frequencies: 1 B2 2523.5 2 A1 1315.5 3 normal coordinates require 69 points -anpass sum of squared residuals: 3.47850821e-19 +anpass sum of squared residuals: [residual] [Vibrational States] Transformed Geometry (Å): [Transformed Geometry] diff --git a/tests/snapshots/run__run@testfiles__test.toml.snap b/tests/snapshots/run__run@testfiles__test.toml.snap index 31c7ba9..1763dd8 100644 --- a/tests/snapshots/run__run@testfiles__test.toml.snap +++ b/tests/snapshots/run__run@testfiles__test.toml.snap @@ -4,7 +4,7 @@ expression: "read_to_string(dir.path().join(\"pbqff.out\")).unwrap()" snapshot_kind: text --- PID: [PID] -version: deadbeef +version: [version] Configuration Options: geometry = { From 022e513fe494b01cc117824ffa81244a9a93fd47 Mon Sep 17 00:00:00 2001 From: Brent Westbrook Date: Sat, 30 Nov 2024 22:37:22 -0500 Subject: [PATCH 21/35] handle sic-specific redactions to make sure states are there --- tests/run.rs | 6 ++-- .../run__run@testfiles__test.toml.snap | 28 +++++++++++++++++++ 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/tests/run.rs b/tests/run.rs index 37b69f2..dacc206 100644 --- a/tests/run.rs +++ b/tests/run.rs @@ -34,12 +34,14 @@ fn run(path: &str, other_files: &[&str]) -> std::io::Result<()> { filters => vec![ (r"(?m)^PID: \d+$", "PID: [PID]"), (r"(?m)^version: [a-z0-9]+$", "version: [version]"), - (r"(?s)(normalized geometry:).*(point group)", "$1[Normalized Geometry]\n$2"), + (r"(?si)(normalized geometry:).*(point group)", "$1[Normalized Geometry]\n$2"), (r"(?ms)^Normal Coordinates:.*?^$", "[Normal Coordinates]"), (r"(?ms)^STATE NO.*?^$", "[Vibrational States]"), (r"(?s)(Transformed Geometry \(Å\):).*(Equilibrium)", "$1\n[Transformed Geometry]\n$2"), (r"(?ms)(Equilibrium Rotational Constants \(cm-1\):).*?^$", "$1\n[Rotational Constants]\n"), - (r"(?s)(Geometry:).*(Vibrational)", "$1\n[Geometry]\n$2"), + (r"(?ms)(^Optimized Geometry:).*?$^", "$1\n[Optimized Geometry]\n$2"), + (r"(?ms)(^Refit Geometry).*?\d\n$^", "$1\n[Refit Geometry]"), + (r"(?ms)(^Geometry:).*(Vibrational)", "$1\n[Geometry]\n$2"), (r"(?s)(Vibrational Frequencies \(cm-1\):).*?(ZPT)", "$1\n[Freqs]\n$2"), (r"(?ms)(^Rotational Constants \(cm-1\):).*?(Coriolis Resonances)", "$1\n[Rotational Constants]\n$2"), (r"(?m)^(anpass sum of squared residuals):(.+)$", "$1: [residual]"), diff --git a/tests/snapshots/run__run@testfiles__test.toml.snap b/tests/snapshots/run__run@testfiles__test.toml.snap index 1763dd8..61830d2 100644 --- a/tests/snapshots/run__run@testfiles__test.toml.snap +++ b/tests/snapshots/run__run@testfiles__test.toml.snap @@ -38,6 +38,34 @@ dummy_atoms = None norm_resume_hff = false Optimized Geometry: +[Optimized Geometry] + +Normalized Geometry:[Normalized Geometry] +Point Group = C2v(Axis(Y), Plane(Axis(Y), Axis(Z)), Plane(Axis(X), Axis(Y))) + +Symmetry Internal Coordinates: +S0 (A1) = r(2-3) +S1 (A1) = r(1-2) + r(1-3) +S2 (A1) = r(2-4) + r(3-5) +S3 (A1) = ∠(4-2-1) + ∠(5-3-1) +S4 (B2) = r(1-2) - r(1-3) +S5 (B2) = r(2-4) - r(3-5) +S6 (B2) = ∠(4-2-1) - ∠(5-3-1) +S7 (B1) = τ(4-2-1-3) - τ(5-3-1-2) +S8 (A2) = τ(4-2-1-3) + τ(5-3-1-2) + +5 atoms require 1585 jobs +anpass sum of squared residuals: [residual] + +Refit Geometry +[Refit Geometry] +[Vibrational States] +Transformed Geometry (Å): +[Transformed Geometry] +Equilibrium Rotational Constants (cm-1): +[Rotational Constants] + +Geometry: [Geometry] Vibrational Frequencies (cm-1): [Freqs] From 4259a4aada950a8e9dbbf6cbd71ffc4344c89b3d Mon Sep 17 00:00:00 2001 From: Brent Westbrook Date: Sun, 1 Dec 2024 12:01:14 -0500 Subject: [PATCH 22/35] set threads to 1 for run tests, debugging github hanging forever --- tests/run.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/run.rs b/tests/run.rs index dacc206..ed892bf 100644 --- a/tests/run.rs +++ b/tests/run.rs @@ -18,7 +18,11 @@ fn run(path: &str, other_files: &[&str]) -> std::io::Result<()> { std::fs::copy(file, dir.path().join(filename))?; } let mut cmd = Command::cargo_bin("pbqff").unwrap(); - let assert = cmd.arg("pbqff.toml").current_dir(&dir).assert(); + let assert = cmd + .arg("pbqff.toml") + .args(["-t", "1"]) + .current_dir(&dir) + .assert(); let output = assert.get_output(); assert!( From 7f100e91cb292adcd1e0932672c1be6b8b87e194 Mon Sep 17 00:00:00 2001 From: Brent Westbrook Date: Sun, 1 Dec 2024 13:45:19 -0500 Subject: [PATCH 23/35] test threads 1 --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 04ee1de..8d46fdc 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -47,4 +47,4 @@ jobs: cp mopac/build/mopac /opt/mopac/. # https://twitter.com/jonhoo/status/1571290371124260865 - name: cargo test --locked - run: cargo test --locked --all-features --all-targets -- --include-ignored + run: cargo test --locked --all-features --all-targets -- --include-ignored -- --test-threads=1 From 26ecf3b508cd0991d7ad52233525551eb6dad70f Mon Sep 17 00:00:00 2001 From: Brent Westbrook Date: Sun, 1 Dec 2024 13:47:47 -0500 Subject: [PATCH 24/35] too many dashes --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8d46fdc..443ec97 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -47,4 +47,4 @@ jobs: cp mopac/build/mopac /opt/mopac/. # https://twitter.com/jonhoo/status/1571290371124260865 - name: cargo test --locked - run: cargo test --locked --all-features --all-targets -- --include-ignored -- --test-threads=1 + run: cargo test --locked --all-features --all-targets -- --include-ignored --test-threads=1 From 831b551a69eeeccbb68eff8917119c1dc24901e0 Mon Sep 17 00:00:00 2001 From: Brent Westbrook Date: Sun, 1 Dec 2024 17:02:59 -0500 Subject: [PATCH 25/35] nocapture for more debugging hang --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 443ec97..ec0be27 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -47,4 +47,4 @@ jobs: cp mopac/build/mopac /opt/mopac/. # https://twitter.com/jonhoo/status/1571290371124260865 - name: cargo test --locked - run: cargo test --locked --all-features --all-targets -- --include-ignored --test-threads=1 + run: cargo test --locked --all-features --all-targets -- --include-ignored --test-threads=1 --nocapture From 3cdd7253b4593879b3bfb85109fc1a0112248d70 Mon Sep 17 00:00:00 2001 From: Brent Westbrook Date: Sun, 1 Dec 2024 17:17:32 -0500 Subject: [PATCH 26/35] also copy shared library how has this been working so far?? --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ec0be27..e778334 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -44,7 +44,7 @@ jobs: - name: copy over mopac run: | mkdir -p /opt/mopac - cp mopac/build/mopac /opt/mopac/. + cp mopac/build/mopac mopac/build/libmopac.so /opt/mopac/. # https://twitter.com/jonhoo/status/1571290371124260865 - name: cargo test --locked run: cargo test --locked --all-features --all-targets -- --include-ignored --test-threads=1 --nocapture From 771be0769f0a2f531f82de5dafa5c23d56ecdfef Mon Sep 17 00:00:00 2001 From: Brent Westbrook Date: Sun, 1 Dec 2024 17:18:26 -0500 Subject: [PATCH 27/35] suffix --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e778334..e00abf8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -44,7 +44,7 @@ jobs: - name: copy over mopac run: | mkdir -p /opt/mopac - cp mopac/build/mopac mopac/build/libmopac.so /opt/mopac/. + cp mopac/build/mopac mopac/build/libmopac.so.1 /opt/mopac/. # https://twitter.com/jonhoo/status/1571290371124260865 - name: cargo test --locked run: cargo test --locked --all-features --all-targets -- --include-ignored --test-threads=1 --nocapture From 58ca07491bd52a9b63ff0ca3deb1dbf7f7faa769 Mon Sep 17 00:00:00 2001 From: Brent Westbrook Date: Sun, 1 Dec 2024 17:21:42 -0500 Subject: [PATCH 28/35] deleted cache, update paths --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e00abf8..a2ffbc9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -29,7 +29,7 @@ jobs: with: path: | mopac/build/mopac - mopac/build/libmopac.so.1 + mopac/build/libmopac.so key: ${{ runner.os }}-build-mopac - name: install mopac if: steps.cache-mopac.outputs.cache-hit != 'true' @@ -44,7 +44,7 @@ jobs: - name: copy over mopac run: | mkdir -p /opt/mopac - cp mopac/build/mopac mopac/build/libmopac.so.1 /opt/mopac/. + cp mopac/build/mopac mopac/build/libmopac.so /opt/mopac/. # https://twitter.com/jonhoo/status/1571290371124260865 - name: cargo test --locked run: cargo test --locked --all-features --all-targets -- --include-ignored --test-threads=1 --nocapture From cfc45124f6cd8396d03d1fe33bf9f37f704c674f Mon Sep 17 00:00:00 2001 From: Brent Westbrook Date: Sun, 1 Dec 2024 17:32:02 -0500 Subject: [PATCH 29/35] revert github debugging, mopac path was the problem --- .github/workflows/test.yml | 2 +- tests/run.rs | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a2ffbc9..a27bd45 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -47,4 +47,4 @@ jobs: cp mopac/build/mopac mopac/build/libmopac.so /opt/mopac/. # https://twitter.com/jonhoo/status/1571290371124260865 - name: cargo test --locked - run: cargo test --locked --all-features --all-targets -- --include-ignored --test-threads=1 --nocapture + run: cargo test --locked --all-features --all-targets -- --include-ignored diff --git a/tests/run.rs b/tests/run.rs index ed892bf..dacc206 100644 --- a/tests/run.rs +++ b/tests/run.rs @@ -18,11 +18,7 @@ fn run(path: &str, other_files: &[&str]) -> std::io::Result<()> { std::fs::copy(file, dir.path().join(filename))?; } let mut cmd = Command::cargo_bin("pbqff").unwrap(); - let assert = cmd - .arg("pbqff.toml") - .args(["-t", "1"]) - .current_dir(&dir) - .assert(); + let assert = cmd.arg("pbqff.toml").current_dir(&dir).assert(); let output = assert.get_output(); assert!( From e3e885369542f2ab772858e90fad9e443d040423 Mon Sep 17 00:00:00 2001 From: Brent Westbrook Date: Sun, 1 Dec 2024 17:43:59 -0500 Subject: [PATCH 30/35] give up on caching, download binary release --- .github/workflows/test.yml | 29 +++++++++-------------------- 1 file changed, 9 insertions(+), 20 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a27bd45..cf2de8e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -16,35 +16,24 @@ jobs: - uses: actions/checkout@v4 with: submodules: true + - name: Install ${{ matrix.toolchain }} uses: dtolnay/rust-toolchain@master with: toolchain: ${{ matrix.toolchain }} + - name: cargo generate-lockfile if: hashFiles('Cargo.lock') == '' run: cargo generate-lockfile - - name: Cache mopac - id: cache-mopac - uses: actions/cache@v4 - with: - path: | - mopac/build/mopac - mopac/build/libmopac.so - key: ${{ runner.os }}-build-mopac + - name: install mopac - if: steps.cache-mopac.outputs.cache-hit != 'true' - run: | - sudo apt install -y python3 python3-numpy - git clone https://github.com/openmopac/mopac.git - cd mopac - mkdir build - cd build - cmake .. - make - - name: copy over mopac run: | + curl https://github.com/openmopac/mopac/releases/download/v23.0.2/mopac-23.0.2-linux.tar.gz + gunzip mopac-23.0.2-linux.tar.gz + tar xf mopac-23.0.2-linux.tar mkdir -p /opt/mopac - cp mopac/build/mopac mopac/build/libmopac.so /opt/mopac/. - # https://twitter.com/jonhoo/status/1571290371124260865 + cp mopac-23.0.2-linux/bin/mopac /opt/mopac/. + cp mopac-23.0.2-linux/lib/libmopac.so /opt/mopac/. + - name: cargo test --locked run: cargo test --locked --all-features --all-targets -- --include-ignored From 46d02c0ecf955aa05235f118639156da88e15f1d Mon Sep 17 00:00:00 2001 From: Brent Westbrook Date: Sun, 1 Dec 2024 17:45:47 -0500 Subject: [PATCH 31/35] fix curl flags --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index cf2de8e..bdd861b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -28,7 +28,7 @@ jobs: - name: install mopac run: | - curl https://github.com/openmopac/mopac/releases/download/v23.0.2/mopac-23.0.2-linux.tar.gz + curl -OL https://github.com/openmopac/mopac/releases/download/v23.0.2/mopac-23.0.2-linux.tar.gz gunzip mopac-23.0.2-linux.tar.gz tar xf mopac-23.0.2-linux.tar mkdir -p /opt/mopac From f21fd9a592813ed06456f2087769e630c8793dfe Mon Sep 17 00:00:00 2001 From: Brent Westbrook Date: Sun, 1 Dec 2024 18:48:24 -0500 Subject: [PATCH 32/35] set -xe on mopac install --- .github/workflows/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index bdd861b..7466ab7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -28,6 +28,7 @@ jobs: - name: install mopac run: | + set -xe curl -OL https://github.com/openmopac/mopac/releases/download/v23.0.2/mopac-23.0.2-linux.tar.gz gunzip mopac-23.0.2-linux.tar.gz tar xf mopac-23.0.2-linux.tar From b99e716716e4d7e9c946949bcdbebfa059c4fb5e Mon Sep 17 00:00:00 2001 From: Brent Westbrook Date: Sun, 1 Dec 2024 18:48:37 -0500 Subject: [PATCH 33/35] nocapture to debug again --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7466ab7..5856346 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -37,4 +37,4 @@ jobs: cp mopac-23.0.2-linux/lib/libmopac.so /opt/mopac/. - name: cargo test --locked - run: cargo test --locked --all-features --all-targets -- --include-ignored + run: cargo test --locked --all-features --all-targets -- --include-ignored --nocapture From 36ee90787b2cad0f11fe162a8975f9277317bbcb Mon Sep 17 00:00:00 2001 From: Brent Westbrook Date: Sun, 1 Dec 2024 18:51:19 -0500 Subject: [PATCH 34/35] more debugging, can't find libmopac.so.2 --- .github/workflows/test.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5856346..841aa6f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -34,7 +34,9 @@ jobs: tar xf mopac-23.0.2-linux.tar mkdir -p /opt/mopac cp mopac-23.0.2-linux/bin/mopac /opt/mopac/. - cp mopac-23.0.2-linux/lib/libmopac.so /opt/mopac/. + cp mopac-23.0.2-linux/lib/libmopac.so* /opt/mopac/. + ls /opt/mopac + ldd /opt/mopac/mopac - name: cargo test --locked run: cargo test --locked --all-features --all-targets -- --include-ignored --nocapture From 83adf33fc641630bcabb1c69f6390c1596433c2b Mon Sep 17 00:00:00 2001 From: Brent Westbrook Date: Sun, 1 Dec 2024 18:53:21 -0500 Subject: [PATCH 35/35] apparently we need even more .so files --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 841aa6f..8daa0b3 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -34,7 +34,7 @@ jobs: tar xf mopac-23.0.2-linux.tar mkdir -p /opt/mopac cp mopac-23.0.2-linux/bin/mopac /opt/mopac/. - cp mopac-23.0.2-linux/lib/libmopac.so* /opt/mopac/. + cp mopac-23.0.2-linux/lib/*.so* /opt/mopac/. ls /opt/mopac ldd /opt/mopac/mopac