-
Notifications
You must be signed in to change notification settings - Fork 0
Description
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:
-
Phase 1: Project Initialization and Structure
- Initialize a new Rust library project named
cheq. - Add crate metadata to
Cargo.toml, including the one-line description, keywords, authors, and licensing (MIT). - Create the full directory structure as defined in the project architecture document (
src/params,src/math,src/solver, etc.). - Create an initial
README.mdand license files.
- Initialize a new Rust library project named
-
Phase 2: Define Core Public Types
- In
src/types.rs:- Define the
AtomViewtrait withatomic_number()andposition()methods. Document its purpose of enabling zero-cost abstraction for user data. - Define the concrete
Atomstruct as a convenience implementation ofAtomView. - Define the
CalculationResultstruct containingcharges,equilibrated_potential, anditerations. Ensure all fields are clearly documented with their units.
- Define the
- In
src/params/mod.rs:- Define the
ElementDatastruct for elemental properties (chi,j,radius,n). - Define the
Parametersstruct which will hold aHashMap<u8, ElementData>.
- Define the
- Implement
Debug,Clone, andPartialEqtraits where appropriate for these structs.
- In
-
Phase 3: Architect Custom Error Handling
- In
src/error.rs:- Add
thiserroras a dependency. - Define the main
CheqErrorenum. - Implement initial error variants relevant to this and the next phase, such as
ParameterNotFound(u8),NoAtoms,IoError, andDeserializationError. - Ensure
CheqErrorderivesthiserror::ErrorandDebug.
- Add
- In
-
Phase 4: Establish the Public API Facade
- In
src/lib.rs:- Set up the module declarations (
mod error;,mod types;, etc.). - Add the crate-level documentation header, including a placeholder for a future usage example.
- Re-export all public-facing types (
CheqError,AtomView,Atom,CalculationResult,Parameters,ElementData) for a clean, flat API surface.
- Set up the module declarations (
- In
Metadata
Metadata
Assignees
Labels
Type
Projects
Status