Skip to main content
← OpenMECP Documentation

FileNaming

Struct FileNaming 

Source
pub struct FileNaming {
    basename: String,
}
Expand description

Manages dynamic file naming based on input file basename

All file names are prefixed with the basename extracted from the input file, ensuring unique file names when multiple jobs run in the same directory.

Fields§

§basename: String

Implementations§

Source§

impl FileNaming

Source

pub fn new(input_path: &Path) -> Self

Creates a new FileNaming instance from an input file path

Extracts the file stem (filename without extension) to use as the basename for all generated file names.

§Arguments
  • input_path - Path to the input file
§Example
use std::path::Path;
use omecp::naming::FileNaming;

let naming = FileNaming::new(Path::new("compound_xyz_123.input"));
assert_eq!(naming.basename(), "compound_xyz_123");
Source

pub fn basename(&self) -> &str

Returns the basename used for file naming

Source

pub fn state_a_chk(&self) -> String

Returns the state A checkpoint file name

Format: {basename}_state_A.chk

Source

pub fn state_b_chk(&self) -> String

Returns the state B checkpoint file name

Format: {basename}_state_B.chk

Source

pub fn a_chk(&self) -> String

Returns the ‘a’ checkpoint file name

Format: {basename}_a.chk

Source

pub fn b_chk(&self) -> String

Returns the ‘b’ checkpoint file name

Format: {basename}_b.chk

Source

pub fn state_a_chk_path(&self, job_dir: &str) -> String

Returns the state A checkpoint file path in a job directory

Format: {job_dir}/{basename}_state_A.chk

Source

pub fn state_b_chk_path(&self, job_dir: &str) -> String

Returns the state B checkpoint file path in a job directory

Format: {job_dir}/{basename}_state_B.chk

Source

pub fn a_chk_path(&self, job_dir: &str) -> String

Returns the ‘a’ checkpoint file path in a job directory

Format: {job_dir}/{basename}_a.chk

Source

pub fn b_chk_path(&self, job_dir: &str) -> String

Returns the ‘b’ checkpoint file path in a job directory

Format: {job_dir}/{basename}_b.chk

Source

pub fn state_a_gbw(&self, job_dir: &str) -> String

Returns the state A wavefunction file path

Format: {job_dir}/{basename}_state_A.gbw

Source

pub fn state_b_gbw(&self, job_dir: &str) -> String

Returns the state B wavefunction file path

Format: {job_dir}/{basename}_state_B.gbw

Source

pub fn a_gbw(&self, job_dir: &str) -> String

Returns the ‘a’ wavefunction file path

Format: {job_dir}/{basename}_a.gbw

Source

pub fn b_gbw(&self, job_dir: &str) -> String

Returns the ‘b’ wavefunction file path

Format: {job_dir}/{basename}_b.gbw

Source

pub fn pre_a(&self, job_dir: &str, ext: &str) -> String

Returns the pre-point A input file path

Format: {job_dir}/{basename}_pre_A.{ext}

Source

pub fn pre_b(&self, job_dir: &str, ext: &str) -> String

Returns the pre-point B input file path

Format: {job_dir}/{basename}_pre_B.{ext}

Source

pub fn pre_a_chk(&self, job_dir: &str) -> String

Returns the pre-point A checkpoint file path

Format: {job_dir}/{basename}_pre_A.chk

Source

pub fn pre_b_chk(&self, job_dir: &str) -> String

Returns the pre-point B checkpoint file path

Format: {job_dir}/{basename}_pre_B.chk

Source

pub fn pre_a_gbw(&self, job_dir: &str) -> String

Returns the pre-point A wavefunction file path

Format: {job_dir}/{basename}_pre_A.gbw

Source

pub fn pre_b_gbw(&self, job_dir: &str) -> String

Returns the pre-point B wavefunction file path

Format: {job_dir}/{basename}_pre_B.gbw

Source

pub fn step_state_a(&self, job_dir: &str, step: usize, ext: &str) -> String

Returns the state A input file path for a given step

Format: {job_dir}/{basename}_{step}_state_A.{ext}

Source

pub fn step_state_b(&self, job_dir: &str, step: usize, ext: &str) -> String

Returns the state B input file path for a given step

Format: {job_dir}/{basename}_{step}_state_B.{ext}

Source

pub fn step_state_a_gbw(&self, job_dir: &str, step: usize) -> String

Returns the state A wavefunction file path for a given step

Format: {job_dir}/{basename}_{step}_state_A.gbw

Source

pub fn step_state_b_gbw(&self, job_dir: &str, step: usize) -> String

Returns the state B wavefunction file path for a given step

Format: {job_dir}/{basename}_{step}_state_B.gbw

Source

pub fn step_state_a_engrad(&self, job_dir: &str, step: usize) -> String

Returns the state A engrad file path for a given step

Format: {job_dir}/{basename}_{step}_state_A.engrad

Source

pub fn step_state_b_engrad(&self, job_dir: &str, step: usize) -> String

Returns the state B engrad file path for a given step

Format: {job_dir}/{basename}_{step}_state_B.engrad

Source

pub fn step_a(&self, job_dir: &str, step: usize, ext: &str) -> String

Returns the ‘A’ input file path for a given step (PES analysis)

Format: {job_dir}/{basename}_{step}_A.{ext}

Source

pub fn step_b(&self, job_dir: &str, step: usize, ext: &str) -> String

Returns the ‘B’ input file path for a given step (PES analysis)

Format: {job_dir}/{basename}_{step}_B.{ext}

Source

pub fn drive_file( &self, job_dir: &str, step: usize, state: &str, ext: &str, ) -> String

Returns a drive calculation file path

Format: {job_dir}/{basename}_drive_{step}_{state}.{ext}

Source

pub fn neb_file( &self, job_dir: &str, step: usize, state: &str, ext: &str, ) -> String

Returns a NEB calculation file path

Format: {job_dir}/{basename}_neb_{step}_{state}.{ext}

Source

pub fn orca_basename(&self, job_dir: &str) -> String

Returns the basename for ORCA gbw file references in input headers

This is used in ORCA input files where the gbw path needs to be specified. Format: {job_dir}/{basename}

Source

pub fn final_mecp_xyz(&self) -> String

Returns the final MECP geometry output file name

Format: {basename}_mecp.xyz

§Example
use std::path::Path;
use omecp::naming::FileNaming;

let naming = FileNaming::new(Path::new("compound_xyz_123.input"));
assert_eq!(naming.final_mecp_xyz(), "compound_xyz_123_mecp.xyz");

Trait Implementations§

Source§

impl Clone for FileNaming

Source§

fn clone(&self) -> FileNaming

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for FileNaming

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.