use molframe_core::contract::DictionaryVersion;
use molframe_core::diagnostic::{Diagnostic, Findings};
use molframe_core::io::{InputBuffer, Limits};
use std::path::Path;
pub fn read_component_dictionary(
path: impl AsRef<Path>,
version: DictionaryVersion,
) -> Result<(molframe_chem::CifProvider, Vec<Diagnostic>), Findings> {
let input = InputBuffer::open(path, Limits::default()).map_err(Findings::from)?;
molframe_chem::read_ccd(&input, version).map_err(Findings::from)
}
pub fn open_component_dictionary(
path: impl AsRef<Path>,
version: DictionaryVersion,
) -> Result<molframe_chem::LazyCifProvider, Findings> {
let input = InputBuffer::open(path, Limits::default()).map_err(Findings::from)?;
Ok(molframe_chem::LazyCifProvider::new(input, version))
}