Closed AntObi closed 1 month ago
The recent updates introduce a new function smact_validity
in the smact/screening.py
file to validate chemical compositions based on SMACT rules. This function leverages numpy
and pymatgen
libraries. Corresponding tests for smact_validity
were added in smact/tests/test_core.py
. Additionally, the examples/README.md
was updated to include an example usage of the new function.
File | Summary |
---|---|
smact/screening.py |
Added imports for numpy and pymatgen , and introduced smact_validity function to check composition validity. |
smact/tests/test_core.py |
Added test_smact_validity function to test the new smact_validity function with various chemical formulas. |
examples/README.md |
Included an example demonstrating the usage of smact_validity function. |
sequenceDiagram
participant User
participant smact.screening
participant smact.tests
participant examples
User->>smact.screening: Call smact_validity("NaCl")
smact.screening->>smact_validity: Validate composition
smact_validity->>User: Return True
User->>smact.tests: Run test_smact_validity
smact.tests->>smact_validity: Validate "NaCl"
smact_validity->>smact.tests: Return True
smact.tests->>smact_validity: Validate "Al3Li" (include_alloys=False)
smact_validity->>smact.tests: Return False
smact.tests->>smact_validity: Validate "Al3Li" (include_alloys=True)
smact_validity->>smact.tests: Return True
smact.tests->>User: Return test results
User->>examples: Read README.md
examples->>User: Show example usage of smact_validity
In the land of code, where elements blend, A new function arises, compositions to mend. With numpy and pymatgen, it checks with grace, Validity ensured, no errors to face. Tests and examples, all set in place, A rabbit's delight, in this coding space! 🐇
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Attention: Patch coverage is 94.00000%
with 3 lines
in your changes are missing coverage. Please review.
Project coverage is 73.82%. Comparing base (
d3e3926
) to head (abbaf7e
).:exclamation: Current head abbaf7e differs from pull request most recent head 2ec3efa
Please upload reports for the commit 2ec3efa to get more accurate results.
Files | Patch % | Lines |
---|---|---|
smact/screening.py | 93.18% | 3 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Add SMACT validity function
Description
smact_validity
to thesmact.screening
module which takes a formula/composition as input and returns True if the formula/composition would be SMACT valid (i.e. charge-neutral and passes the electronegativity test).Type of change
How Has This Been Tested?
test_core.py
to check the functionality of this new functionTest Configuration:
Reviewers
N/A
Checklist:
Summary by CodeRabbit
New Features
Documentation
Tests