pub struct ObservationArchive { /* private fields */ }Expand description
Fixed-composition archive of oracle evaluations.
Implementations§
Source§impl ObservationArchive
impl ObservationArchive
Sourcepub fn open(dir: impl AsRef<Path>, z: Vec<u32>, cell: [f64; 3]) -> Result<Self>
pub fn open(dir: impl AsRef<Path>, z: Vec<u32>, cell: [f64; 3]) -> Result<Self>
Open (or create) the archive at dir for one fixed composition.
z is the per-atom atomic-number list in caller order; cell
the orthorhombic box lengths. The corpus lives at
dir/observations.rdb; trajectory ids continue across restarts.
Sourcepub fn append(&self, positions: &[f64], forces: &[f64], energy: f64) -> bool
pub fn append(&self, positions: &[f64], forces: &[f64], energy: f64) -> bool
Enqueue one evaluation. positions and forces are flat
3 * natoms buffers in caller order. Returns false only when
the row cannot be enqueued (wrong length, archive closing);
disk-side failures are counted in Self::dropped instead.
Sourcepub fn flush(&self)
pub fn flush(&self)
Block until every previously enqueued row is committed (or counted dropped). Call before reading the corpus back.
Trait Implementations§
Source§impl Drop for ObservationArchive
impl Drop for ObservationArchive
Auto Trait Implementations§
impl !Freeze for ObservationArchive
impl !RefUnwindSafe for ObservationArchive
impl !UnwindSafe for ObservationArchive
impl Send for ObservationArchive
impl Sync for ObservationArchive
impl Unpin for ObservationArchive
impl UnsafeUnpin for ObservationArchive
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more