Conversation
25 tasks
Contributor
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
Lays the foundational groundwork for the new
cheqlibrary, 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:
ParametersandElementDatastructs to model QEq parameters.load_from_fileandload_from_strto parse parameters from TOML sources."1") or symbols (e.g.,"Fe"), providing user-friendly parameter files.Defined Core API and Data Types:
AtomViewtrait to allow the library to operate on user-defined atom structures without requiring data duplication or conversion.Atomstruct as a default implementation ofAtomView.CalculationResultstruct to standardize the output of charge calculations.Established Comprehensive Error Handling:
CheqErrorenum usingthiserrorto provide clear, actionable error messages.ParameterNotFound), I/O errors, convergence failures (NotConverged), and deserialization issues.Set Up a Robust CI Workflow:
ci.yml).cargo fmt), runs the linter (cargo clippy), builds the project, runs all tests (cargo test), and verifies documentation generation (cargo doc).Provided API Documentation: