Skip to content

Refactor/thermal electronic#204

Merged
nhew1994 merged 6 commits intomainfrom
refactor/thermal-electronic
Feb 5, 2026
Merged

Refactor/thermal electronic#204
nhew1994 merged 6 commits intomainfrom
refactor/thermal-electronic

Conversation

@nhew1994
Copy link
Collaborator

@nhew1994 nhew1994 commented Feb 5, 2026

No description provided.

- Change `chemical_potential_range` default to None to avoid mutable default arrays.
- Set `electron_tol` default to 0.05 for consistency.
- Exit immediately with ValueError if chemical potential cannot be found in the specified range.
Copilot AI review requested due to automatic review settings February 5, 2026 21:28
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors the documentation and improves the code quality of the thermal electronic modules. The changes focus on standardizing docstring formats, improving parameter descriptions, enhancing error handling, and adding inline comments for better code clarity.

Changes:

  • Standardized docstring format across both files to use single-line Returns and Args sections without type annotations (relying on function signature type hints instead)
  • Enhanced class-level documentation with detailed Attributes sections and improved descriptions
  • Improved error handling by converting print statements to proper ValueError exceptions with exception chaining
  • Added inline comments to clarify calculation steps
  • Adjusted default parameters for chemical potential calculations (electron_tol: 0.5 → 0.05, chemical_potential_range now optional)

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
dfttk/thermal_electronic/thermal_electronic_data.py Removed module docstring, enhanced class docstring with Args section, standardized method documentation format, reordered parameters in get_thermal_electronic_data, removed unused electron_dos_data attribute
dfttk/thermal_electronic/thermal_electronic.py Removed TODO comment, standardized attribute and method documentation format, improved error handling in calculate_chemical_potential, added inline comments explaining calculation steps, changed default parameter values

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@nhew1994 nhew1994 requested a review from Copilot February 5, 2026 21:51
@nhew1994 nhew1994 merged commit 49a79c6 into main Feb 5, 2026
10 checks passed
@nhew1994 nhew1994 deleted the refactor/thermal-electronic branch February 5, 2026 21:53
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

natural order.
Returns: List of folder names with the given prefix, sorted in natural order.
"""

Copy link

Copilot AI Feb 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Multiple lines in this file contain trailing whitespace (e.g., lines 128, 147, 270, 636, 794, 847). While this is a minor style issue, consider running a linter or formatter to remove trailing whitespace for consistency with standard Python style guidelines.

Suggested change

Copilot uses AI. Check for mistakes.
Comment on lines 200 to +205
volumes_fit: np.ndarray,
temperatures: np.ndarray,
order: int = 1,
selected_volumes: np.ndarray = None,
folder_prefix: str = "elec",
vasprun_name: str = "vasprun.xml.elec_dos",
selected_volumes: np.ndarray = None,
Copy link

Copilot AI Feb 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The parameter order has been changed by moving 'selected_volumes' from before 'folder_prefix' to after 'vasprun_name'. This could break external code that calls this method with positional arguments. The internal caller in configuration.py uses keyword arguments and won't be affected, but consider whether this is a public API that external users might depend on. If so, this breaking change should be documented or avoided.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant