Skip to content

feat(project): Establish Core API, Data Structures, and CI#2

Merged
TKanX merged 11 commits intomainfrom
feature/1-establish-core-api-and-data-structures-for-cheq
Oct 19, 2025
Merged

feat(project): Establish Core API, Data Structures, and CI#2
TKanX merged 11 commits intomainfrom
feature/1-establish-core-api-and-data-structures-for-cheq

Conversation

@TKanX
Copy link
Member

@TKanX TKanX commented Oct 19, 2025

Summary:

Lays the foundational groundwork for the new cheq library, a pure Rust implementation for partial charge calculation. It introduces the core public API, including a robust parameter loading system from TOML files, a flexible trait-based approach for handling atomic data, and a comprehensive, strongly-typed error handling system. Additionally, a complete CI workflow has been established to ensure code quality, formatting, and correctness from the outset.

Changes:

  • Implemented Parameter Loading System:

    • Created Parameters and ElementData structs to model QEq parameters.
    • Implemented load_from_file and load_from_str to parse parameters from TOML sources.
    • Developed a custom Serde deserializer that intelligently handles element keys as either atomic numbers (e.g., "1") or symbols (e.g., "Fe"), providing user-friendly parameter files.
  • Defined Core API and Data Types:

    • Introduced a generic AtomView trait to allow the library to operate on user-defined atom structures without requiring data duplication or conversion.
    • Provided a concrete Atom struct as a default implementation of AtomView.
    • Defined a CalculationResult struct to standardize the output of charge calculations.
  • Established Comprehensive Error Handling:

    • Implemented a CheqError enum using thiserror to provide clear, actionable error messages.
    • Defined specific error variants for common failure modes, including parameter lookup failures (ParameterNotFound), I/O errors, convergence failures (NotConverged), and deserialization issues.
  • Set Up a Robust CI Workflow:

    • Added a new GitHub Actions workflow (ci.yml).
    • The CI pipeline now automatically checks code formatting (cargo fmt), runs the linter (cargo clippy), builds the project, runs all tests (cargo test), and verifies documentation generation (cargo doc).
  • Provided API Documentation:

    • Included doc comments for the public-facing error and parameter modules to clarify their usage and purpose.

@TKanX TKanX self-assigned this Oct 19, 2025
Copilot AI review requested due to automatic review settings October 19, 2025 21:42
@TKanX TKanX added the enhancement ✨ New feature or request label Oct 19, 2025
@TKanX TKanX linked an issue Oct 19, 2025 that may be closed by this pull request
25 tasks
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Foundational setup for the new cheq Rust library: core types and API, parameter loading from TOML with custom deserialization, comprehensive error handling, and CI workflow.

  • Add AtomView/Atom and CalculationResult core types
  • Implement Parameters loading with element-key deserialization (symbol or atomic number) and tests
  • Introduce CheqError enum with thiserror
  • Add CI workflow to format, lint, build, test, and doc

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/types.rs Adds AtomView trait, Atom struct, and CalculationResult for core API types
src/params.rs Implements Parameters with custom Serde deserializer for element keys, plus unit tests
src/error.rs Defines CheqError with detailed variants via thiserror
src/lib.rs Exposes modules error, params, types
Cargo.toml Declares crate metadata and dependencies (thiserror, serde, toml, tempfile)
.github/workflows/ci.yml Sets up CI steps for fmt, build, clippy, test, and doc

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@TKanX TKanX merged commit 7417fce into main Oct 19, 2025
2 checks passed
@TKanX TKanX deleted the feature/1-establish-core-api-and-data-structures-for-cheq branch October 19, 2025 21:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement ✨ New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Establish Core API and Data Structures for cheq

2 participants