Skip to content

Finalize API, Implement RustDoc, and Add Architectural Documentation #9

@TKanX

Description

@TKanX

Description:

The core QEq algorithm is implemented and tested, but the project now needs to be refined into a polished, stable, and well-documented crate for public consumption. This involves three key activities: finalizing a clean and ergonomic public API, writing comprehensive RustDoc documentation with clear examples, and adding high-level architectural documentation to guide future contributors and advanced users. Completing these tasks will ensure cheq is not just functional but also professional, accessible, and maintainable from day one.

Tasks:

  • Phase 1: Finalize Public API and Library Structure

    • In src/lib.rs:
      • Define the library's public API exclusively through pub use statements, creating a flat and discoverable interface.
      • Ensure all internal implementation modules (math, etc.) are kept private to the crate (mod math; not pub mod math;).
      • Confirm that all essential types (QEqSolver, AtomView, Atom, Parameters, SolverOptions, CalculationResult, CheqError) are re-exported from the top level.
      • Review the public fields and methods of all exported structs to ensure they represent a minimal and stable API surface.
  • Phase 2: Implement Comprehensive API Documentation (RustDoc)

    • Crate-Level Documentation: In src/lib.rs, add //! comments at the top of the file. This documentation should include:
      • A high-level overview of the Charge Equilibration (QEq) method and the purpose of the cheq library.
      • A clear, complete, and runnable "Quick Start" example demonstrating the primary use case (e.g., calculating charges for a water molecule).
      • Brief notes on the core concepts like QEqSolver, AtomView, and Parameters.
    • Public Item Documentation: Add /// comments to all public functions, structs, traits, enums, and their fields/methods.
      • Clearly document the purpose of each item (e.g., what QEqSolver::solve does).
      • Explain the parameters and return values, including all possible variants of CheqError.
      • Document the units for physical quantities in structs like ElementData (e.g., eV, Angstroms).
      • Provide small examples for key functions where applicable.
    • Verification: Run cargo doc --open --document-private-items to build and visually inspect the generated documentation, ensuring it is clear, professional, and free of broken links.
  • Phase 3: Add High-Level Architectural Documentation

    • Create README.md:
      • Write a user-facing README.md at the project root. This should be a more concise version of the crate-level documentation, suitable for browsing on GitHub.
      • Include installation instructions (how to add cheq to Cargo.toml).
      • Add badges for CI status and crates.io version once released.

Metadata

Metadata

Assignees

Labels

Type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions