pub mod config;
pub mod error;
pub mod input;
pub mod output;
pub mod pipeline;
pub mod stage;
pub mod worker;
pub use config::{FeffConfig, FeffConfigBuilder};
pub use error::Error;
pub use input::{
Atom, CardToken, FeffInput, InputCard, Potential, ResolvedFeffInput, ResolvedFortranInput,
TypedCard,
};
pub use output::{FeffOutputs, FeffTable, OutputFile, OutputKind, PathEntry, PathLeg, PathsDat};
pub use pipeline::{FeffPipeline, PipelineResult, StageResult};
pub use stage::Stage;
use std::path::{Path, PathBuf};
pub fn run(
input_path: impl AsRef<Path>,
work_dir: impl Into<PathBuf>,
) -> Result<PipelineResult, Error> {
let input = FeffInput::from_file(input_path)?;
run_input(input, work_dir)
}
pub fn run_input(input: FeffInput, work_dir: impl Into<PathBuf>) -> Result<PipelineResult, Error> {
input.validate()?;
let config = FeffConfigBuilder::new()
.work_dir(work_dir.into())
.input(input)
.build()?;
FeffPipeline::new(config).run()
}
pub fn run_str(content: &str, work_dir: impl Into<PathBuf>) -> Result<PipelineResult, Error> {
let input = FeffInput::parse(content)?;
run_input(input, work_dir)
}
pub fn validate(input_path: impl AsRef<Path>) -> Result<(), Error> {
let input = FeffInput::from_file(input_path)?;
input.validate()
}
pub fn validate_str(content: &str) -> Result<(), Error> {
let input = FeffInput::parse(content)?;
input.validate()
}