Skip to content

Raise error when from_deepmd_npy_mixed with not-a-directory para. - #432

Merged
njzjz merged 3 commits into
deepmodeling:masterfrom
iProzd:fix_empty_dir
Aug 19, 2026
Merged

Raise error when from_deepmd_npy_mixed with not-a-directory para.#432
njzjz merged 3 commits into
deepmodeling:masterfrom
iProzd:fix_empty_dir

Conversation

@iProzd

@iProzd iProzd commented Mar 12, 2023

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • Bug Fixes
    • Improved error handling when importing mixed-format data from an invalid path.
    • A clear FileNotFoundError is now raised when the supplied path is not a directory.

@codecov

codecov Bot commented Mar 12, 2023

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.10%. Comparing base (f8c5d4a) to head (2eed074).
⚠️ Report is 397 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #432      +/-   ##
==========================================
+ Coverage   82.51%   88.10%   +5.59%     
==========================================
  Files          68       91      +23     
  Lines        6198     9562    +3364     
==========================================
+ Hits         5114     8425    +3311     
- Misses       1084     1137      +53     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread dpdata/plugins/deepmd.py Outdated

@njzjz-bot njzjz-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Requesting changes because the new validation disappears under Python optimization and leaves invalid input silently returning an empty collection. The inline suggestion is directly applicable; please also add tests for a missing path and a regular file path.

Process note: the Codex usage allowance is about to reset, so I am spending the remaining token budget now on this review.

Coding agent: Codex
Codex version: codex-cli 0.144.6
Model: gpt-5.6-sol
Reasoning effort: xhigh

Comment thread dpdata/plugins/deepmd.py Outdated
Co-authored-by: A bot of @njzjz <48687836+njzjz-bot@users.noreply.github.com>
Signed-off-by: Jinzhe Zeng <njzjz@qq.com>
@dosubot dosubot Bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Aug 19, 2026
@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Aug 19, 2026
@njzjz
njzjz enabled auto-merge (squash) August 19, 2026 15:21
@njzjz
njzjz merged commit b3c69fe into deepmodeling:master Aug 19, 2026
10 of 12 checks passed
@coderabbitai

coderabbitai Bot commented Aug 19, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: a58b5d36-bfa0-4c63-87ba-783b2cc8e16e

📥 Commits

Reviewing files that changed from the base of the PR and between 7fb45d8 and 2eed074.

📒 Files selected for processing (1)
  • dpdata/plugins/deepmd.py

Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review.


📝 Walkthrough

Walkthrough

DeePMDMixedFormat.from_multi_systems now checks that the supplied path is a directory. It raises FileNotFoundError before traversal when the check fails. Directory traversal remains unchanged.

Changes

DeepMD directory validation

Layer / File(s) Summary
Validate mixed-system input directory
dpdata/plugins/deepmd.py
from_multi_systems raises FileNotFoundError when directory is not a directory. Existing directory traversal remains unchanged.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Merge Risk: ⚪ Minimal · up to 2eed0

This localized change adds an error for an invalid parameter type, and no actionable merge-blocking risk remains beyond normal checks and review.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes raising an error for a non-directory path, which matches the main change, although the function name differs from the implementation.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch

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

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm This PR has been approved by a maintainer size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants