Releases: vita-rs/vita
vita@0.2.0
🚀 Features
-
IO Module (
vita-io): Implements readers and writers for standard atomistic formats — read/write asymmetry (readers produce format-specific types; writers accept any capability-bounded source), XYZ format (HasSites + HasElements + HasPositions<V>), single-frame and trajectory reading, generic writing. 72 tests. -
Core Module (
vita-core): AddsElement::from_symbol— case-sensitive symbol lookup for named (Z 1–118) and systematic (Z ≥ 119) elements. 1,360 tests.
Contributors
- @TKanX — all development
Full Changelog: https://github.com/vita-rs/vita/compare/vita@0.1.0...vita@0.2.0
vita-io@0.1.0
🚀 Features
-
Read/Write Asymmetry
- Read = Concrete: each format reader produces one concrete type implementing exactly the capabilities the format records
- Write = Generic: each format writer accepts any
Sbounded on those capabilities — not only the reader's output type
-
Implements XYZ Format (
vita_io::xyz)- Output Type:
xyz::System<V: Scalar = f64>—HasSites,HasElements,HasPositions<V>; positions stored in Å - Reading:
xyz::read(reader)→Reader;.system::<V>()for a single frame,.systems::<V>()for a lazy trajectory iterator; element symbols are case-insensitive - Writing:
xyz::write::<V, U, S>(writer, source, config)— anyS: HasElements + HasPositions<V>, positions converted to unitUon output - Config:
Config { comment: &str }— per-frame metadata not captured by capabilities - 6 Error Kinds:
UnexpectedEof,AtomCount,AtomCountRange,FieldCount,ElementSymbol,Coordinate
- Output Type:
-
Implements Error Infrastructure (
vita_io::{Error, ParseError, Location})Location:Text { line: u32, column: Option<u32> }orBinary { offset: u64 }— one-based; column is byte-offset-basedParseError<K>: shared location + format-specificK; each format aliasesParseError/Errorwith its ownErrorKindError<K>:Io(std::io::Error)|Parse(ParseError<K>);Fromconversions for?propagation
-
Testing
- 72 Tests: error infrastructure (14), XYZ error kinds (6), reader (25), system (17), writer (10)
- Read: single-frame, trajectory, CRLF, scientific notation,
f32/f64, all 6 error paths - Write: generic-type source, unit conversion, comment validation, write→read round-trip
Contributors
- @TKanX — all development
Full Changelog: https://github.com/vita-rs/vita/commits/vita-io@0.1.0
vita-core@0.2.0
🚀 Features
- Adds
Element::from_symbol— case-sensitive inverse ofsymbol()- Named (Z 1–118): exact IUPAC symbol (
"H","Fe","Og") - Systematic (Z ≥ 119): IUPAC 1979 three-letter form (
"Uue","Bpp") - Round-trip:
Element::from_symbol(e.symbol()) == Some(e)holds for all Z 1–255 - Rejects silently: wrong case, unknown symbol, empty string →
None - +6 tests → 1,360 total
- Named (Z 1–118): exact IUPAC symbol (
Contributors
- @TKanX — all development
Full Changelog: https://github.com/vita-rs/vita/compare/vita-core@0.1.0...vita-core@0.2.0
vita@0.1.0
🚀 Features
- Core Module (
vita-core): Foundational vocabulary — 9 capability traits, 20 physical quantities with 101 unit implementations, 3D geometry (Point3 / Vector3 / Matrix3), chemical primitives (elements, isotopes, lattices), andScalarnumeric abstraction. Zero dependencies, 1,354 tests.
Contributors
- @TKanX — all development
Full Changelog: https://github.com/vita-rs/vita/commits/vita@0.1.0
vita-core@0.1.0
🚀 Features
-
Capability-Driven System Model
- 9 Traits:
HasSites,HasElements,HasIsotopes,HasPositions,HasMasses,HasVelocities,HasAccelerations,HasNetCharge,HasLattice - Keyed Access: Per-site data via
SiteIdgetter + bulk iterator (fn mass(&self, site) -> Mass<V, U>+fn masses(&self) -> impl Iterator<...>) - No Concrete System Type: Code declares trait bounds, stays blind to storage
- 9 Traits:
-
Dimensional Typesystem
- 20 Physical Quantities: Length, Mass, Time, Energy, Force, Charge, Temperature, Pressure, Velocity, Acceleration, Angle, Area, Volume, Frequency, Momentum, Density, Concentration, AmountOfSubstance, DipoleMoment, ForceConstant
- 101 Unit Implementations: Dalton, Hartree, Angstrom, Picosecond, Kelvin, Bar, Radian, Degree, Å ps⁻¹, …
- Compile-Time Unit Safety:
Mass<V, Dalton> + Mass<V, Gram>is a type error — explicit.to::<Dalton>()required - Macro-Generated: Single
define_quantity!macro for all quantities — consistent API, zero duplication
-
3D Geometry
Point3,Vector3,Matrix3: Generic over component type — works with baref64or dimensionedLength<f64, Angstrom>- Type-Level Safety:
Point3 - Point3 = Vector3;Point3 + Point3refused at compile time - Full Linear Algebra: Dot, cross, norm, normalize, angle, transpose, determinant, inverse, matrix-vector multiply
-
Chemical Primitives
- 118 Named Elements: IUPAC symbols and names; systematic naming for Z > 118
- Isotope Model: Element + mass number A, with A ≥ Z guard at construction
- Periodic Lattice: 4 constructors — from vectors, cubic, orthorhombic, full 6-parameter crystallographic (a, b, c, α, β, γ); validates non-degeneracy
-
Zero-Dependency Core
- No Transitive Dependencies: Compiles against
coreonly - Zero Heap Allocation: All operations on the stack; only
PhantomDatafor unit markers
- No Transitive Dependencies: Compiles against
-
Prelude for Ergonomic Import
use vita_core::prelude::*brings in all 9Has*traits,Scalar, andSiteId— ready to go in one line
-
Comprehensive Testing
- 1,354 Tests: Construction validation, arithmetic identities, unit-conversion round-trips, comparison/ordering, iterator contracts, lattice degeneracy detection
Contributors
- @TKanX — all development
Full Changelog: https://github.com/vita-rs/vita/commits/vita-core@0.1.0