From e0b0ecd1c3e72fb25a86fc332a8091f12efc335b Mon Sep 17 00:00:00 2001 From: Sebastian Pineda Date: Mon, 4 May 2026 14:08:18 +0200 Subject: [PATCH] fix: allow direct scheme with XTC by making box length optional; add CSS alias MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - `--box` for `direct` is now optional (no default_value in clap); when omitted without an XTC the 200 Å fallback is applied in lib.rs, preserving existing single-frame behaviour - Removes the hard error that fired even when -b was not supplied, allowing trajectory-averaged SAXS via `direct` without specifying a box - Add CSS (disulfide-bonded cysteine) as an alias for CYS in single_bead.yaml Co-Authored-By: Claude Sonnet 4.6 --- assets/single_bead.yaml | 1 + src/cli.rs | 6 +++--- src/lib.rs | 2 ++ 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/assets/single_bead.yaml b/assets/single_bead.yaml index d417599..1ae15b3 100644 --- a/assets/single_bead.yaml +++ b/assets/single_bead.yaml @@ -824,6 +824,7 @@ HLYS: { ff: !Alias LYS } HTYR: { ff: !Alias TYR } HCYS: { ff: !Alias CYS } CYX: { ff: !Alias CYS } +CSS: { radius: 3.6, formfactor: !Alias CYS } # PDB atom name aliases — map multi-character PDB names to their # element form factors so atomic-resolution structures work with diff --git a/src/cli.rs b/src/cli.rs index e577088..56b4f47 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -47,8 +47,8 @@ pub enum Commands { #[clap(short = 'p', long, default_value = "6")] pmax: usize, /// Cubic box side length (Å) - #[clap(short = 'b', long = "box", default_value = "200.0")] - side_length: f64, + #[clap(short = 'b', long = "box")] + side_length: Option, #[clap(flatten)] solvent: SolventArgs, }, @@ -291,7 +291,7 @@ fn command_to_scheme( solvent, } => ( IntensityScheme::Direct { pmax }, - Some([side_length; 3]), + side_length.map(|s| [s; 3]), solvent.to_config(), ), Commands::Multipole { diff --git a/src/lib.rs b/src/lib.rs index 01b2aad..806c0bc 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -212,6 +212,8 @@ impl Pripps { )); } structure.box_sides = Some(Vector3::from(box_sides)); + } else if xtcfile.is_none() { + structure.box_sides = Some(Vector3::from([200.0; 3])); } let active_solvent = solvent.filter(|cfg| cfg.is_active());