From cbf6e05d981c9d3d6806c6a57baaf9c3e9c37243 Mon Sep 17 00:00:00 2001 From: Ionizing Date: Wed, 8 May 2024 20:56:49 +0800 Subject: [PATCH] [wav3d.rs] fix bug on argument dependence related charge summation [Cargo.toml] bump patch --- Cargo.lock | 2 +- src/commands/wav3d.rs | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 346013d..0eb031a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1157,7 +1157,7 @@ dependencies = [ [[package]] name = "rsgrad" -version = "0.4.11" +version = "0.4.13" dependencies = [ "anyhow", "byteorder", diff --git a/src/commands/wav3d.rs b/src/commands/wav3d.rs index 8efe67b..3ce1e54 100644 --- a/src/commands/wav3d.rs +++ b/src/commands/wav3d.rs @@ -101,7 +101,7 @@ pub struct Wav3D { /// Add eigen value suffix to the filename show_eigs_suffix: bool, - #[arg(long, requires("sum-prefix"))] + #[arg(long, requires("sum_prefix"))] /// Perform sum-up of the charge densities for selected bands. /// /// With this flag open, only `normsquared` or `ns` or `uns` or `dns` are allowed for @@ -113,11 +113,11 @@ pub struct Wav3D { /// if this flag is on. sum_chgs: bool, - #[arg(long, requires_if(ArgPredicate::IsPresent, "sum-chgs"))] + #[arg(long, requires("sum_chgs"))] /// Specify the output file for the summed charge densities. /// /// This argument is required if `sum_chgs` is on. - sum_prefix: PathBuf, + sum_prefix: Option, } @@ -348,7 +348,7 @@ I suggest providing `gamma_half` argument to avoid confusion."); if self.sum_chgs { save_to_vasp( - &self.sum_prefix.with_extension("vasp"), + &self.sum_prefix.as_ref().unwrap().with_extension("vasp"), &Arc::try_unwrap(chg_sum).unwrap().into_inner()?, &pos)?; }