Skip to content

doped.io - #154

Draft
kavanase wants to merge 126 commits into
developfrom
IO_refactor
Draft

kavanase wants to merge 126 commits into
developfrom
IO_refactor

Conversation

@kavanase

Copy link
Copy Markdown
Member

This PR implements a refactoring of calculation I/O in doped, moving all calculator-specific (e.g. VASP) code to a doped.io subpackage, where each calculator then has its own subpackage as doped.io.<calculator> with inputs, outputs and optionally utils sub-modules (e.g. doped.io.vasp.outputs). A unified interface is then used for calculation inputs and outputs, streamlining the addition of new calculators (Quantum Espresso, GPAW, FHI-aims, ...) to doped.

kavanase added 21 commits July 20, 2026 18:19
@kavanase kavanase added the enhancement New feature or request label Jul 20, 2026
@kavanase
kavanase marked this pull request as draft July 20, 2026 17:28
@kavanase kavanase changed the title Draft: doped.io doped.io Jul 20, 2026
@SMTG-Bham SMTG-Bham deleted a comment from coderabbitai Bot Jul 20, 2026
kavanase and others added 2 commits July 22, 2026 12:25
…develop merge)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
# Conflicts:
#	doped/analysis.py
#	doped/core.py
#	doped/utils/parsing.py
#	doped/vasp.py
#	examples/GGA_workflow_tutorial.ipynb
#	examples/Se/F_i_C2_-1_20Å_Stenciled_POSCAR
#	examples/Se/F_i_C2_1_20Å_Stenciled_POSCAR
#	examples/Se/H_Se_-1_20Å_Stenciled_POSCAR
#	examples/Se/H_Se_0_20Å_Stenciled_POSCAR
#	examples/Se/Se_20Å_Supercell_POSCAR
#	examples/Se/Se_i_C2_-1_20Å_Stenciled_POSCAR
#	examples/Se/Se_i_C2_-2_20Å_Stenciled_POSCAR
#	examples/Se/Se_i_C2_0_20Å_Stenciled_POSCAR
#	examples/Se/v_Se_-1_20Å_Stenciled_POSCAR
#	examples/Se/v_Se_-2_20Å_Stenciled_POSCAR
#	examples/Se/v_Se_0_20Å_Stenciled_POSCAR
#	examples/chemical_potentials_tutorial.ipynb
@coderabbitai

coderabbitai Bot commented Jul 22, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 99e6e0b0-f3b0-4cbc-aded-a95a559e85a5

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
Finishing Touches

🧪 Generate unit tests (beta)

  • Create PR with unit tests
  • Commit unit tests in branch IO_refactor
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

kavanase and others added 30 commits November 1, 2026 13:33
…mpeting-phase branch

Both sides branched from c85a5bd. Kept from this branch: the light `read_gpw`/ULM reader,
`_open_gpaw_restart` (stored-results check for all four `.gpw` readers), the charge check removal, and
the example's primitive-cell host, Niggli-reduced phases and 400 eV / k-density 4 settings.

Taken from d3bc935: GPAW `check_entry_compatibility` (k-point/grid meshes excluded), the
`find_calc_output` backend hook for analyzer file selection, competing-phase wording in the multiple-files
warning, k-point meshes from `get_bz_k_points()`, `converged_electronic`, no duplicated
`entry.parameters`, no unused `subfolder` argument, the example docstrings and the real-calculation tests
(phase fixture, analyzer, file priority, settings mismatch, k-point mesh and example inputs).

Changed relative to d3bc935:
- `find_calc_output` errors (`ValueError` for ambiguous filenames, as well as `FileNotFoundError`) fall
  back to the generic file pick with a warning, rather than failing the whole analysis.
- The list-mode docstring uses the wording already on IO_refactor (57faf9b), to merge cleanly there.
- Dropped `_read_gpaw_calculation` (superseded by `_open_gpaw_restart`), the charge check test, and
  `test_gpaw_restart_without_energy` (covered by `test_restart_without_results_raises`).
- `pytest.warns` -> `_run_func_and_capture_stdout_warnings`; lazy `ase` k-point import; doped-style
  docstrings; `find_calc_output` documented in Adding_Calculators.rst.
- Remaining review nits: doped-style Args layouts and the singular/plural protocol-name comment.
…arsing

Add GPAW competing-phase output parsing for chemical potentials
Port develop's changes into the relocated IO_refactor modules:
- doped/vasp.py -> doped/io/vasp/inputs.py: INCAR helpers (_parse_incar_value, _is_hybrid, _use_user_nupdown,
  _update_incar_settings), DopedDictSet._kpts (KSPACING support), user EDIFF(_PER_ATOM)/NUPDOWN/NKRED/MAGMOM/
  KSPACING/POTCAR settings handling and DefectRelaxSet._singlepoint_incar_settings
- CompetingPhases VASP input methods -> doped.io.vasp.inputs module functions (KSPACING support, user EDIFF
  handling, _revert_sparse_tetrahedron_smearing)
- doped/utils/parsing.py -> doped/io/vasp/outputs.py: parse_projected_eigen override removed (and dropped from the
  doped.utils.parsing deprecation shim)
- doped/utils/symmetry.py: _SPGLIB_ERRORS handling; _check_spglib_version and is_periodic_image removed
- CompetingPhasesAnalyzer skipped-folder warnings and to_json/from_json were already on IO_refactor (keeping the
  backend-agnostic calc_output naming)
- New develop tests ported to tests/test_vasp.py and tests/test_generation.py
Port develop's VASP handling compaction (8d3fd3d) to doped/io/vasp/inputs.py (DefectRelaxSet NKRED logic,
_singlepoint_incar_settings override warnings and user_incar_settings docstrings), and update two get_vasprun
kwargs docstring examples for develop's removal of parse_mag
…and edge determination in GPAW (to boost generalisability, handle metallic / high-smearing systems etc)
Port develop's `_update_incar_settings` -> `_handle_EDIFF_and_update_incar_settings` rename to
`doped/io/vasp/inputs.py` (keeping the `doped/vasp.py` shim), and map the consolidated
`tests/.pytest_split_durations` to the IO test layout (`test_analysis.py` -> `test_parsing.py`).
Port develop's `doped/vasp.py` changes (`_handle_EDIFF_and_update_incar_settings` rename, non-collinear
`MAGMOM` fix) to `doped/io/vasp/inputs.py` and its `load_bulk_gap_data` MP band-structure updates to
`doped/parsing.py`, and map the consolidated `tests/.pytest_split_durations` to the IO test layout
(`test_analysis.py` -> `test_parsing.py`).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants