Conversation
- Add new parameters module for accessing DFT-D3 damping parameters from embedded TOML database (172 methods from simple-dftd3) - Make interface damping structs serde-serializable with serde_inline_default for inline default values - Extend DFTD3Error with ParametersError variant for TOML/parameter errors - Parse TOML entries directly via toml::Table and deserialize into interface structs using IntoDeserializer (eliminates intermediate DampingEntryRaw struct) - Add test_parameters example demonstrating module usage Co-Authored-By: Claude Code <noreply@anthropic.com> Co-Authored-By: glm-5 <service@zhipuai.cn>
Move public API tests from parameters.rs inline #[cfg(test)] module to examples/test_parameters.rs as #[test] functions, matching the style of test_interface.rs. Tests are translated from s-dftd3's python/dftd3/test_parameters.py. Only private-function tests (load_data_base, normalize_version) remain in the module. Also fix clippy needless-borrow warning in get_variant_entry call. Co-authored-by: Claude Code <noreply@anthropic.com> Co-authored-by: glm-5.1 <service@zhipuai.cn>
- Create parsing.rs with parse_damping_param, parse_damping_param_from_toml, and JSON support (behind json feature) - Enhance parameters.rs with get_merged_param_table, get_default_param_table, and normalize_method - Add test_parsing.rs example with comprehensive tests for all use cases - Update Cargo.toml with serde_json optional dependency and json feature - Add parsing module to lib.rs Co-authored-by: Claude Code <noreply@anthropic.com> Co-authored-by: glm-5.1 <service@zhipuai.cn> Co-authored-by: doubao-seed-2.0-code <service@volcengine.com>
- Create parsing.rs with dftd3_parse_damping_param, dftd3_parse_damping_param_from_toml, and json support (dftd3_parse_damping_param_from_json) - Update parameters.rs: rename functions to dftd3_* prefix, make helper functions pub(crate) - Update lib.rs prelude to include parsing module - Update test examples to use new function names - Add comprehensive tests for parsing module Co-authored-by: Claude Code <noreply@anthropic.com> Co-authored-by: doubao-seed-2.0-code <doubao@bytedance.com>
- Update module-level docstring with all supported input formats and a runnable example - Enhance function docstrings for all parsing functions - Update lib.rs top-level doc to mention parsing functions - Fix bug in dftd3_parse_damping_param_from_json_f where it was calling non-fallible version Co-authored-by: Claude Code <noreply@anthropic.com> Co-authored-by: doubao-seed-2.0-code <doubao@bytedance.com>
…example for custom parameters in README
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.
This PR will introduce parsing toml dictionary to define DFTD3 parameters, and also allow the API caller to retrive DFTD3 parameters in struct
DFTD3DampingParam.The minimal full example can be