Description:
This foundational task establishes the core data contract for the entire cheq library. It involves initializing the project structure and defining all primary public-facing data structures and error types. The design will ensure a robust, type-safe, and user-friendly public API. Key components include a flexible AtomView trait to decouple the library from specific user data formats, a comprehensive CheqError enum for robust error handling, and clear CalculationResult and Parameters structs for unambiguous input/output. This milestone is critical for enabling all subsequent development of the parameter handling, mathematical core, and the main solver.
Tasks:
Description:
This foundational task establishes the core data contract for the entire
cheqlibrary. It involves initializing the project structure and defining all primary public-facing data structures and error types. The design will ensure a robust, type-safe, and user-friendly public API. Key components include a flexibleAtomViewtrait to decouple the library from specific user data formats, a comprehensiveCheqErrorenum for robust error handling, and clearCalculationResultandParametersstructs for unambiguous input/output. This milestone is critical for enabling all subsequent development of the parameter handling, mathematical core, and the main solver.Tasks:
Phase 1: Project Initialization and Structure
cheq.Cargo.toml, including the one-line description, keywords, authors, and licensing (MIT).src/params,src/math,src/solver, etc.).README.mdand license files.Phase 2: Define Core Public Types
src/types.rs:AtomViewtrait withatomic_number()andposition()methods. Document its purpose of enabling zero-cost abstraction for user data.Atomstruct as a convenience implementation ofAtomView.CalculationResultstruct containingcharges,equilibrated_potential, anditerations. Ensure all fields are clearly documented with their units.src/params/mod.rs:ElementDatastruct for elemental properties (chi,j,radius,n).Parametersstruct which will hold aHashMap<u8, ElementData>.Debug,Clone, andPartialEqtraits where appropriate for these structs.Phase 3: Architect Custom Error Handling
src/error.rs:thiserroras a dependency.CheqErrorenum.ParameterNotFound(u8),NoAtoms,IoError, andDeserializationError.CheqErrorderivesthiserror::ErrorandDebug.Phase 4: Establish the Public API Facade
src/lib.rs:mod error;,mod types;, etc.).CheqError,AtomView,Atom,CalculationResult,Parameters,ElementData) for a clean, flat API surface.