Skip to content

Commit

Permalink
[wav3d.rs] fix bug on argument dependence related charge summation
Browse files Browse the repository at this point in the history
[Cargo.toml] bump patch
  • Loading branch information
Ionizing committed May 8, 2024
1 parent 37b943a commit cbf6e05
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions src/commands/wav3d.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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<PathBuf>,
}


Expand Down Expand Up @@ -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)?;
}
Expand Down

0 comments on commit cbf6e05

Please sign in to comment.