Skip to content

Improve thermal electronic#210

Merged
nhew1994 merged 4 commits intomainfrom
improve-thermal-electronic
Apr 14, 2026
Merged

Improve thermal electronic#210
nhew1994 merged 4 commits intomainfrom
improve-thermal-electronic

Conversation

@nhew1994
Copy link
Copy Markdown
Collaborator

No description provided.

nhew1994 added 3 commits April 9, 2026 17:15
…_volumes is specified, process only the corresponding folders instead of processing all folders and filtering afterward; improve type hints in ThermalElectronic; adjust ThermalElectronicData and Configuration; update tests
Copilot AI review requested due to automatic review settings April 14, 2026 19:18
Copy link
Copy Markdown
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 extends the thermal-electronic DOS ingestion workflow to support selecting explicit elec_* folders (as an alternative to selecting by volume), and updates tests/expected-results artifacts accordingly.

Changes:

  • Add selected_folders (mutually exclusive with selected_volumes) to thermal-electronic data loading APIs.
  • Propagate the new selection option through Configuration.process_thermal_electronic(...) and ThermalElectronicData.
  • Extend unit tests (and the expected-results notebook) to cover folder selection and the mutual-exclusion error.

Reviewed changes

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

Show a summary per file
File Description
tests/test_thermal_electronic_data/thermal_electronic_expected_results.ipynb Refresh expected-results notebook (clear outputs, add examples for selected_folders + mutual exclusivity).
tests/test_thermal_electronic.py Add test coverage for selected_folders and the mutual-exclusion error condition.
dfttk/thermal_electronic/thermal_electronic_data.py Add selected_folders support to VASP input harvesting and propagate into thermal-electronic processing.
dfttk/thermal_electronic/thermal_electronic.py Add selected_folders to read_total_electron_dos and adjust volume filtering behavior.
dfttk/configuration.py Wire selected_folders / vasprun_name through the Configuration-level processing entrypoint.
Comments suppressed due to low confidence (1)

dfttk/thermal_electronic/thermal_electronic_data.py:196

  • selected_folders is accepted but not validated against the detected elec_folders (or existence on disk). If a folder is misspelled/missing, the loop will fail later with FileNotFoundError when reading INCAR/KPOINTS/CONTCAR, which is harder to diagnose than a targeted ValueError. Consider validating selected_folders up front (and possibly enforcing the folder_prefix) and raising a clear error listing any missing folders.
        # Iterate over the requested folders; if none are provided, use all detected elec folders
        folders_to_process = natsorted(
            elec_folders if selected_folders is None else selected_folders
        )
        
        # Read the INCAR, KPOINTS, and structures for each electronic DOS folder
        for elec_folder in folders_to_process:
            incar_data = {}
            for key, name in zip(incar_keys, incar_names):
                incar_data[key] = Incar.from_file(
                    os.path.join(self.path, elec_folder, name)
                )

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

Comment thread dfttk/thermal_electronic/thermal_electronic.py
Comment thread dfttk/thermal_electronic/thermal_electronic.py
Comment thread dfttk/thermal_electronic/thermal_electronic_data.py Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@nhew1994 nhew1994 linked an issue Apr 14, 2026 that may be closed by this pull request
@nhew1994 nhew1994 merged commit 6bd3758 into main Apr 14, 2026
6 checks passed
@nhew1994 nhew1994 deleted the improve-thermal-electronic branch April 14, 2026 19:31
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.

Improve ThermalElectronic

2 participants