-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Develop #77
Conversation
…ents unnecessary warning output from snb-run)
…th numbers (i.e. ignores "Binary file matches..." etc if slightly corrupted OUTCAR), only cut if also high energy compared to unperturbed
As recommended in [pep 0561](https://peps.python.org/pep-0561/), a blank `py.typed` marker should be included when type hints are used so downstream codes can type check with `mypy` and similar tools.
Create py.typed
WalkthroughThis update enhances the Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant CI/CD
participant Linter
participant Codebase
participant Docs
User->>CI/CD: Trigger build
CI/CD->>Linter: Run lint checks
Linter->>Codebase: Check code quality
Codebase-->>Linter: Return issues
Linter-->>CI/CD: Provide lint results
CI/CD-->>User: Notify build status
User->>Docs: Review documentation updates
Docs-->>User: Display new references and tools
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? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Outside diff range, codebase verification and nitpick comments (2)
README.md (1)
131-139
: Consider using asterisks for unordered list items.The markdown style guide suggests using asterisks instead of dashes for unordered list items. This change will improve consistency with markdownlint rules.
- - Z. Yuan & G. Hautier **_First-principles study of defects and doping limits in CaO_** [_Applied Physics Letters_](https://doi.org/10.1063/5.0211707) 2024 - - Y. Fu & H. Lohan et al. **_Factors Enabling Delocalized Charge-Carriers in Pnictogen-Based Solar Absorbers: In-depth Investigation into CuSbSe<sub>2</sub>_** [_arXiv_](https://doi.org/10.48550/arXiv.2401.02257) 2024 - - S. Hachmioune et al. **_Exploring the Thermoelectric Potential of MgB4: Electronic Band Structure, Transport Properties, and Defect Chemistry_** [_Chemistry of Materials_](https://doi.org/10.1021/acs.chemmater.4c00584) 2024 - - J. Hu et al. **_Enabling ionic transport in Li3AlP2 the roles of defects and disorder_** [_ChemRxiv_](https://doi.org/10.26434/chemrxiv-2024-3s0kh) 2024 - - A. G. Squires et al. **_Oxygen dimerization as a defect-driven process in bulk LiNiO2<sub>2</sub>_** [_ACS Energy Letters_](https://pubs.acs.org/doi/10.1021/acsenergylett.4c01307) 2024 - - I. Mosquera-Lois et al. **_Machine-learning structural reconstructions for accelerated point defect calculations_** [_npj Computational Materials_](https://doi.org/10.1038/s41524-024-01303-9) 2024 + * Z. Yuan & G. Hautier **_First-principles study of defects and doping limits in CaO_** [_Applied Physics Letters_](https://doi.org/10.1063/5.0211707) 2024 + * Y. Fu & H. Lohan et al. **_Factors Enabling Delocalized Charge-Carriers in Pnictogen-Based Solar Absorbers: In-depth Investigation into CuSbSe<sub>2</sub>_** [_arXiv_](https://doi.org/10.48550/arXiv.2401.02257) 2024 + * S. Hachmioune et al. **_Exploring the Thermoelectric Potential of MgB4: Electronic Band Structure, Transport Properties, and Defect Chemistry_** [_Chemistry of Materials_](https://doi.org/10.1021/acs.chemmater.4c00584) 2024 + * J. Hu et al. **_Enabling ionic transport in Li3AlP2 the roles of defects and disorder_** [_ChemRxiv_](https://doi.org/10.26434/chemrxiv-2024-3s0kh) 2024 + * A. G. Squires et al. **_Oxygen dimerization as a defect-driven process in bulk LiNiO2<sub>2</sub>_** [_ACS Energy Letters_](https://pubs.acs.org/doi/10.1021/acsenergylett.4c01307) 2024 + * I. Mosquera-Lois et al. **_Machine-learning structural reconstructions for accelerated point defect calculations_** [_npj Computational Materials_](https://doi.org/10.1038/s41524-024-01303-9) 2024Tools
Markdownlint
131-131: Expected: asterisk; Actual: dash
Unordered list style(MD004, ul-style)
132-132: Expected: asterisk; Actual: dash
Unordered list style(MD004, ul-style)
133-133: Expected: asterisk; Actual: dash
Unordered list style(MD004, ul-style)
135-135: Expected: asterisk; Actual: dash
Unordered list style(MD004, ul-style)
136-136: Expected: asterisk; Actual: dash
Unordered list style(MD004, ul-style)
137-137: Expected: asterisk; Actual: dash
Unordered list style(MD004, ul-style)
138-138: Expected: asterisk; Actual: dash
Unordered list style(MD004, ul-style)
139-139: Expected: asterisk; Actual: dash
Unordered list style(MD004, ul-style)
tests/test_energy_lowering_distortions.py (1)
82-85
: Consider breaking long lines.Lines 82, 84, and 85 exceed the recommended line length. Consider breaking them to improve readability.
- self.orig_castep_0pt3_files = os.listdir(f"{self.CASTEP_DATA_DIR}/vac_1_Cd_0/Bond_Distortion_30.0%") - self.orig_cp2k_0pt3_files = os.listdir(f"{self.CP2K_DATA_DIR}/vac_1_Cd_0/Bond_Distortion_30.0%") - self.orig_fhi_aims_0pt3_files = os.listdir(f"{self.FHI_AIMS_DATA_DIR}/vac_1_Cd_0/Bond_Distortion_30.0%") - self.orig_espresso_0pt3_files = os.listdir(f"{self.ESPRESSO_DATA_DIR}/vac_1_Cd_0/Bond_Distortion_30.0%") + self.orig_castep_0pt3_files = os.listdir( + f"{self.CASTEP_DATA_DIR}/vac_1_Cd_0/Bond_Distortion_30.0%" + ) + self.orig_cp2k_0pt3_files = os.listdir( + f"{self.CP2K_DATA_DIR}/vac_1_Cd_0/Bond_Distortion_30.0%" + ) + self.orig_fhi_aims_0pt3_files = os.listdir( + f"{self.FHI_AIMS_DATA_DIR}/vac_1_Cd_0/Bond_Distortion_30.0%" + ) + self.orig_espresso_0pt3_files = os.listdir( + f"{self.ESPRESSO_DATA_DIR}/vac_1_Cd_0/Bond_Distortion_30.0%" + )Tools
Ruff
82-82: Line too long (108 > 107)
(E501)
84-84: Line too long (112 > 107)
(E501)
85-85: Line too long (112 > 107)
(E501)
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (15)
- .github/workflows/lint.yml (2 hunks)
- CHANGELOG.rst (1 hunks)
- README.md (2 hunks)
- docs/Analysis.rst (1 hunks)
- docs/Code_Compatibility.rst (1 hunks)
- docs/ShakeNBreak_Example_Workflow.ipynb (5 hunks)
- docs/Tips.rst (1 hunks)
- docs/conf.py (1 hunks)
- docs/index.rst (2 hunks)
- setup.py (1 hunks)
- shakenbreak/SnB_run.sh (6 hunks)
- shakenbreak/energy_lowering_distortions.py (3 hunks)
- shakenbreak/input.py (1 hunks)
- shakenbreak/py.typed (1 hunks)
- tests/test_energy_lowering_distortions.py (3 hunks)
Files skipped from review due to trivial changes (8)
- CHANGELOG.rst
- docs/Analysis.rst
- docs/Code_Compatibility.rst
- docs/ShakeNBreak_Example_Workflow.ipynb
- docs/Tips.rst
- setup.py
- shakenbreak/input.py
- shakenbreak/py.typed
Additional context used
Ruff
docs/conf.py
28-28: Single quotes found but double quotes preferred
Replace single quotes with double quotes
(Q000)
tests/test_energy_lowering_distortions.py
82-82: Line too long (108 > 107)
(E501)
84-84: Line too long (112 > 107)
(E501)
85-85: Line too long (112 > 107)
(E501)
Markdownlint
README.md
131-131: Expected: asterisk; Actual: dash
Unordered list style(MD004, ul-style)
132-132: Expected: asterisk; Actual: dash
Unordered list style(MD004, ul-style)
133-133: Expected: asterisk; Actual: dash
Unordered list style(MD004, ul-style)
135-135: Expected: asterisk; Actual: dash
Unordered list style(MD004, ul-style)
136-136: Expected: asterisk; Actual: dash
Unordered list style(MD004, ul-style)
137-137: Expected: asterisk; Actual: dash
Unordered list style(MD004, ul-style)
138-138: Expected: asterisk; Actual: dash
Unordered list style(MD004, ul-style)
139-139: Expected: asterisk; Actual: dash
Unordered list style(MD004, ul-style)
Additional comments not posted (15)
.github/workflows/lint.yml (2)
40-40
: Ensureruff check --fix
is appropriate for your workflow.The change from
ruff --fix
toruff check --fix
indicates a shift towards a more cautious linting approach, checking for issues before applying fixes. Verify that this aligns with your intended workflow.Verification successful
The use of
ruff check --fix
is appropriate for your workflow.The configuration files indicate that automatic fixing is part of the pre-commit setup, suggesting that the cautious approach of checking before fixing in the CI workflow aligns with the project's intended use of
ruff
.
.pre-commit-config.yaml
includesruff
with--fix
, indicating automatic fixing is acceptable in some contexts.pyproject.toml
containsruff
configurations, supporting its integration in the project.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that `ruff check --fix` is correctly integrated into the workflow. # Test: Check the usage of `ruff check --fix` in the workflow file. Expect: Correct usage without errors. grep -A 2 'ruff check --fix' .github/workflows/lint.ymlLength of output: 128
Script:
#!/bin/bash # Search for any documentation or configuration files related to `ruff` to understand the intended workflow. rg 'ruff' --glob '*.md' --glob '*.yml' --glob '*.yaml' --glob '*.toml' --glob '*.json' -A 3Length of output: 710
56-56
: Checkflake8
configuration consistency.The
flake8
command now includes specific ignores and a max line length. Ensure these settings are consistent with your project's style guide.Verification successful
Flake8 Configuration Consistency Verified
The
flake8
settings specified in the GitHub Actions workflow are consistent with the project since no otherflake8
configuration files were found in the repository. Thus, there are no conflicting settings.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that `flake8` settings are consistent with project style guide. # Test: Check for `flake8` configuration in the project. Expect: Consistency with ignored rules and line length. grep -A 2 'flake8' .github/workflows/lint.ymlLength of output: 327
Script:
#!/bin/bash # Search for `flake8` configuration files and display their contents fd --type f --name '.flake8' --exec cat {} fd --type f --name 'setup.cfg' --exec grep -A 10 '\[flake8\]' {} fd --type f --name 'tox.ini' --exec grep -A 10 '\[flake8\]' {}Length of output: 929
Script:
#!/bin/bash # Corrected search for `flake8` configuration files and display their contents fd '.flake8' --exec cat {} fd 'setup.cfg' --exec grep -A 10 '\[flake8\]' {} fd 'tox.ini' --exec grep -A 10 '\[flake8\]' {}Length of output: 128
docs/conf.py (1)
28-28
: Verify version consistency with release notes.The version has been updated from '3.3.5' to '3.3.6'. Ensure this change is reflected in the project's release notes or changelog for consistency.
Verification successful
Version '3.3.6' is documented in the changelog.
The version update to '3.3.6' is reflected in the
CHANGELOG.rst
file, ensuring consistency with the release notes.
CHANGELOG.rst
: Contains an entry for version '3.3.6'.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that the version update is consistent with release notes. # Test: Check the changelog for the updated version. Expect: Version '3.3.6' mentioned in the changelog. grep '3.3.6' CHANGELOG.mdLength of output: 71
Script:
#!/bin/bash # Search for files that might contain release notes or version history. fd -e md -e rst -e txt -e adoc -e org -e html --type f --search-path docs --search-path . 'release' 'changelog' 'version'Length of output: 329
Script:
#!/bin/bash # Corrected search for files that might contain release notes or version history. fd -e md -e rst -e txt -e adoc -e org -e html --type f 'release|changelog|version'Length of output: 122
Script:
#!/bin/bash # Check for the version '3.3.6' in the identified changelog files. grep '3.3.6' CHANGELOG.rst docs/changelog_link.rstLength of output: 71
Tools
Ruff
28-28: Single quotes found but double quotes preferred
Replace single quotes with double quotes
(Q000)
shakenbreak/SnB_run.sh (9)
88-88
: Improve readability of convergence checks.The conditional checks for convergence have been refined. Ensure these changes enhance readability and maintainability without altering functionality.
100-100
: Ensure accuracy of positive energy counting.The logic for counting positive energies has been improved. Verify that the counting accurately reflects the intended criteria.
152-152
: Validate multiple single-step OUTCAR check.The function
check_multiple_single_step_outcars
has been introduced. Ensure it correctly identifies files with minimal ionic steps.
162-162
: Examine logic for counting ionic steps across OUTCARs.The script now uses
wc -l
for counting ionic steps, which is more accurate across multiple files. Verify this change aligns with the intended functionality.
216-217
: Review job submission logic.The job submission logic has been adjusted. Ensure it handles job names and file paths correctly, particularly with special characters.
222-223
: Check file cleanup conditions.The script ensures files are only removed if jobs are successfully submitted. Verify this logic to prevent accidental data loss.
198-198
: Consider file compression impact.The script compresses
vasprun.xml
to save space. Ensure this does not interfere with any downstream processes that require the uncompressed file.
44-44
: Check file pattern matching logic.The removal of the suffix "on" from the OUTCAR file iteration broadens the scope of processed files. Ensure this change aligns with the intended file processing logic.
93-97
: Handle missing OUTCAR in Unperturbed directory.The script now sets a default unperturbed energy if the OUTCAR is missing. Verify that this fallback mechanism is appropriate for all scenarios.
docs/index.rst (1)
174-174
: Documentation updates approved.The updates to input compatibility and references enhance the clarity and relevance of the documentation.
Also applies to: 214-221
shakenbreak/energy_lowering_distortions.py (2)
277-281
: Improved error handling with type checking.The addition of type checking for
distorted_struct
enhances robustness by ensuring it is aStructure
object. The error message provides clear debugging information.
470-470
: Enhanced warning handling withissubclass
.Using
issubclass
for warning checks allows compatibility with subclasses ofUserWarning
, improving flexibility and reliability.Also applies to: 542-542
No description provided.