Conversation
22 tasks
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR enhances the cheq library by embedding a comprehensive default parameter set directly into the binary and providing a global accessor function. The implementation allows users to perform calculations without manually creating parameter files for common elements.
- Adds a comprehensive TOML file containing QEq parameters for elements 1-103
- Implements
get_default_parameters()function usingstd::sync::OnceLockfor thread-safe singleton access - Includes unit tests to verify parameter loading and singleton behavior
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/lib.rs | Implements the global parameter accessor function with lazy initialization and singleton pattern |
| resources/qeq.data.toml | Adds comprehensive atomic parameters for 103 elements with detailed documentation |
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:
Enhances the
cheqlibrary by embedding a comprehensive default parameter set directly into the binary. A new public function,get_default_parameters, provides convenient, thread-safe, and singleton-style access to these parameters. This change significantly improves the library's usability out-of-the-box, as users can now perform calculations without needing to manually create and load a parameter file for common elements.Changes:
Added Default TOML Parameter File:
resources/qeq.data.toml, a new file containing a comprehensive set of QEq parameters for elements 1 through 103.Implemented Global Parameter Accessor:
get_default_parameters().std::sync::OnceLockto lazily parse the embedded TOML file on its first call and caches the result for all subsequent calls.Parameters.panic!with a descriptive error message inget_or_initto catch potential library build issues where the embedded file might be corrupted.Included Unit Tests for Default Parameters:
get_default_parameterssuccessfully loads the parameters and contains expected elements (e.g., Carbon).