deepmodeling / deepmodeling/dftio

[Code scan] Implement or explicitly reject HDF5 output instead of silently no-oping

Open
#34 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Jupyter Notebook
Stars
16
Forks
14
PR merge metrics
No merged PRs in 30d

Description

This issue comes from a Codex global repository scan.

## Problem
The shared writer accepts `format == "hdf5"` and dispatches to `write_hdf5`:

https://github.com/deepmodeling/dftio/blob/c9d128f24a74ef2911e1a28f5640357488beb196/dftio/io/parse.py#L214-L222

But `write_hdf5` is an empty `pass` implementation:

https://github.com/deepmodeling/dftio/blob/c9d128f24a74ef2911e1a28f5640357488beb196/dftio/io/parse.py#L224-L225

There is also a signature mismatch: `write()` passes `energy=energy`, but `write_hdf5()` does not accept `energy`. So `--format hdf5` either raises `TypeError` or would silently produce no output if the signature is adjusted without an implementation.

## Suggested fix
Implement HDF5 output, or reject it in `write()` with a clear `NotImplementedError`. If keeping the method, align its signature with the dispatcher.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.