Skip to main content

molrs_core/
lib.rs

1//! # molrs
2//!
3//! A Rust library providing core molecular modeling functionality.
4//!
5//! ## Module layout
6//!
7//! - [`store`] — columnar data containers (`Block`, `Frame`, `MolRec`, keys)
8//! - [`system`] — molecular representations (`Atomistic`, `MolGraph`, `Topology`, elements)
9//! - [`chem`] — chemical perception (aromaticity, charges, rings, stereo, SMARTS)
10//! - [`spatial`] — regions, neighbor lists, geometry
11//! - [`math`], [`units`] — numerical and unit-system foundations
12//!
13//! ## Examples
14//!
15//! ### Element lookup
16//!
17//! ```
18//! use molrs_core::Element;
19//!
20//! // Look up elements by atomic number
21//! let hydrogen = Element::by_number(1).unwrap();
22//! assert_eq!(hydrogen.symbol(), "H");
23//!
24//! // Or by symbol (case-insensitive)
25//! let h = Element::by_symbol("h").unwrap();
26//! assert_eq!(h.name(), "Hydrogen");
27//! ```
28//!
29//! ### Packing
30//!
31//! Molecular packing (Packmol port) lives in the standalone
32//! [`molcrafts-molpack`](https://crates.io/crates/molcrafts-molpack) crate.
33
34#![allow(missing_docs)]
35#![warn(rustdoc::missing_crate_level_docs)]
36
37// Embedded data files
38pub mod data;
39
40// Domain groups
41pub mod chem;
42pub mod spatial;
43pub mod store;
44pub mod system;
45
46// Foundations
47pub mod error;
48pub mod math;
49pub mod types;
50pub mod units;
51
52// Public re-exports for common types
53pub use chem::aromaticity::perceive_aromaticity;
54pub use chem::gasteiger::{GasteigerCharges, compute_gasteiger_charges};
55pub use chem::hydrogens::{add_hydrogens, implicit_h_count, remove_hydrogens};
56pub use chem::rings::{RingInfo, find_rings};
57pub use chem::smarts::SmartsPattern;
58pub use chem::stereo::{
59    BondStereo, TetrahedralStereo, assign_bond_stereo_from_3d, assign_stereo_from_3d,
60    chiral_volume, find_chiral_centers,
61};
62pub use error::MolRsError;
63pub use store::block::Block;
64pub use store::frame::Frame;
65pub use store::frame_access::FrameAccess;
66pub use store::frame_view::FrameView;
67pub use store::molrec::{
68    MolRec, ObservableData, ObservableKind, ObservableRecord, SchemaValue, Trajectory,
69};
70pub use system::atomistic::{AngleId, AtomId, Atomistic, Bond, BondId, DihedralId, ImproperId};
71pub use system::coarsegrain::CoarseGrain;
72pub use system::element::Element;
73pub use system::mapping::{CGMapping, WeightScheme};
74pub use system::molgraph::{Atom, Bead, KindId, MolGraph, NodeId, PropValue, Relation};
75pub use system::topology::{Topology, TopologyRingInfo};
76pub use units::{Dimension, Quantity, Unit, UnitDef, UnitRegistry, UnitsError};