Skip to content

Conversation

@OutisLi
Copy link
Contributor

@OutisLi OutisLi commented Aug 1, 2025

Previously, the systems in the input.json can either be a str containing a directory that has multiple systems to be searched or a list of direct path of systems.

Now it will also search for subsystems for each str in the list.

Summary by CodeRabbit

  • Documentation

    • Clarified how the "systems" argument is interpreted for both string and list inputs, with more detailed guidance on directory and recursive behaviors.
  • Bug Fixes

    • Improved handling of list inputs so each item can be a system path or a directory to search, and added validation for unsupported input types.

@github-actions github-actions bot added the Python label Aug 1, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 1, 2025

📝 Walkthrough

Walkthrough

Updated docstrings clarifying the "systems" argument formats for training/validation helpers and modified process_systems to expand string entries inside list inputs and validate unsupported input types (raising ValueError).

Changes

Cohort / File(s) Change Summary
Docstring Clarification
deepmd/utils/argcheck.py
Clarified training_data_args() and validation_data_args() docstrings to explain that a string can be a system directory or parent directory to recursively search, and that lists are processed element-wise.
System Processing Enhancement
deepmd/utils/data_system.py
process_systems now iterates list inputs, expands each string element via expand_sys_str, accumulates results, appends non-string items as-is, and raises ValueError for unsupported types.

Sequence Diagram(s)

sequenceDiagram
    participant Caller
    participant process_systems
    participant expand_sys_str

    Caller->>process_systems: call(systems)
    alt systems is str
        process_systems->>expand_sys_str: expand_sys_str(systems)
        expand_sys_str-->>process_systems: expanded list
        process_systems-->>Caller: return expanded list
    else systems is list
        loop for each element
            alt element is str
                process_systems->>expand_sys_str: expand_sys_str(element)
                expand_sys_str-->>process_systems: expanded list
            else
                process_systems-->>process_systems: append element
            end
        end
        process_systems-->>Caller: return accumulated list
    else
        process_systems-->>Caller: raise ValueError
    end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

Suggested reviewers

  • njzjz

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d4f2bcf and ffef085.

📒 Files selected for processing (1)
  • deepmd/utils/argcheck.py (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • deepmd/utils/argcheck.py
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (29)
  • GitHub Check: Build C++ (cpu, cpu)
  • GitHub Check: Build C++ (cuda, cuda)
  • GitHub Check: Build C++ (rocm, rocm)
  • GitHub Check: Build C++ (cuda120, cuda)
  • GitHub Check: Build C++ (clang, clang)
  • GitHub Check: Build wheels for cp311-macosx_arm64
  • GitHub Check: Build wheels for cp311-manylinux_x86_64
  • GitHub Check: Analyze (python)
  • GitHub Check: Build wheels for cp310-manylinux_aarch64
  • GitHub Check: Analyze (c-cpp)
  • GitHub Check: Build wheels for cp311-win_amd64
  • GitHub Check: Test Python (6, 3.12)
  • GitHub Check: Test Python (5, 3.12)
  • GitHub Check: Test Python (6, 3.9)
  • GitHub Check: Test Python (5, 3.9)
  • GitHub Check: Build C library (2.14, >=2.5.0,<2.15, libdeepmd_c_cu11.tar.gz)
  • GitHub Check: Test C++ (false)
  • GitHub Check: Build C library (2.18, libdeepmd_c.tar.gz)
  • GitHub Check: Test Python (3, 3.12)
  • GitHub Check: Build wheels for cp311-macosx_x86_64
  • GitHub Check: Build wheels for cp311-manylinux_x86_64
  • GitHub Check: Test Python (4, 3.12)
  • GitHub Check: Test C++ (true)
  • GitHub Check: Test Python (4, 3.9)
  • GitHub Check: Test Python (2, 3.9)
  • GitHub Check: Test Python (1, 3.12)
  • GitHub Check: Test Python (1, 3.9)
  • GitHub Check: Test Python (2, 3.12)
  • GitHub Check: Test Python (3, 3.9)
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 1, 2025

📝 Walkthrough

Walkthrough

The documentation for the "systems" argument in two utility functions was clarified to better describe its expected formats and processing logic. Separately, the process_systems function was updated to recursively expand and flatten list inputs, ensuring each string element is processed as a path or directory and all resulting system paths are collected.

Changes

Cohort / File(s) Change Summary
Docstring Clarification
deepmd/utils/argcheck.py
Updated docstrings for training_data_args() and validation_data_args() to clarify handling of "systems" argument.
Enhanced List Expansion in System Processing
deepmd/utils/data_system.py
Modified process_systems to process list inputs by expanding each string element as a directory or path, flattening results.

Sequence Diagram(s)

sequenceDiagram
    participant Caller
    participant process_systems
    participant expand_sys_str

    Caller->>process_systems: Call with systems (str or list)
    alt systems is str
        process_systems->>expand_sys_str: Expand systems string
        expand_sys_str-->>process_systems: List of system paths
        process_systems-->>Caller: Return expanded list
    else systems is list
        loop For each element in systems
            alt element is str
                process_systems->>expand_sys_str: Expand element string
                expand_sys_str-->>process_systems: List of system paths
            else element is not str
                process_systems-->>process_systems: Append element as-is
            end
        end
        process_systems-->>Caller: Return flattened list
    end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~6 minutes

Possibly related PRs

Suggested labels

Python

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (2)
deepmd/utils/argcheck.py (2)

2924-2928: Docstring improvement looks good, minor clarity tweak suggested

Great to see the recursive-search behavior documented.
For completeness, consider noting that, when the list contains non-string items (e.g. already-expanded Path objects returned by process_systems), those elements are preserved as is. This matches the current implementation in data_system.py and avoids future confusion.


3004-3007: Replicate the same clarification for validation systems

Same comment as above: explicitly mention that non-string elements in the list are passed through unchanged so that the training/validation docs stay perfectly in sync with process_systems.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 43504d3 and bbedfd5.

📒 Files selected for processing (2)
  • deepmd/utils/argcheck.py (2 hunks)
  • deepmd/utils/data_system.py (2 hunks)
🔇 Additional comments (2)
deepmd/utils/data_system.py (2)

740-740: LGTM: Clear documentation update

The documentation accurately reflects the new behavior where list elements can be either system paths or directories that will be recursively searched.


761-769: LGTM: Robust implementation of recursive system expansion

The implementation correctly handles the new recursive search functionality:

  • Properly iterates through list elements and processes strings with expand_sys_str
  • Flattens the results by extending rather than appending, avoiding nested lists
  • Preserves non-string elements unchanged for backward compatibility
  • Aligns perfectly with the PR objective to recursively search for subsystems

@codecov
Copy link

codecov bot commented Aug 1, 2025

Codecov Report

❌ Patch coverage is 75.00000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.34%. Comparing base (43504d3) to head (d4f2bcf).
⚠️ Report is 10 commits behind head on devel.

Files with missing lines Patch % Lines
deepmd/utils/data_system.py 75.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##            devel    #4858      +/-   ##
==========================================
- Coverage   84.76%   84.34%   -0.43%     
==========================================
  Files         699      702       +3     
  Lines       68077    68592     +515     
  Branches     3541     3572      +31     
==========================================
+ Hits        57708    57854     +146     
- Misses       9235     9599     +364     
- Partials     1134     1139       +5     

☔ View full report in Codecov by Sentry.
📢 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

♻️ Duplicate comments (1)
deepmd/utils/data_system.py (1)

761-769: Answering prior review: clarify “other situations” and enforce policy

Re: “What’s the other situations?” Non-string list elements are the only “other” case here. Current behavior appends them as-is, which is ambiguous. Prefer either:

  • Reject non-string items (as in the fix above), or
  • Officially support os.PathLike (normalize via os.fspath), and document it.

I recommend rejection for now to keep the API strict and consistent.

🧹 Nitpick comments (4)
deepmd/utils/data_system.py (2)

740-742: Doc update aligns with PR intent; ensure clarity on patterns application

Good clarification on list handling. To avoid confusion, explicitly state that when rglob_patterns is provided, it is applied per string item in the list (same as the single-string case).


769-769: Optional: de-duplicate discovered systems while preserving order

If the same system can be discovered from multiple inputs, consider de-duplicating:

-        systems = result_systems
+        systems = list(dict.fromkeys(result_systems))
deepmd/utils/argcheck.py (2)

2926-2928: Doc nit: mention rglob_patterns are applied per list item too

To mirror process_systems semantics and prevent ambiguity, append that when rglob_patterns are set, they apply to each string item in the list, same as single-string input.


3004-3007: Doc nit: mirror training_data wording about rglob_patterns per item

Same suggestion as training: explicitly mention that rglob_patterns are applied per-item when systems is a list of strings.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 43504d3 and d4f2bcf.

📒 Files selected for processing (2)
  • deepmd/utils/argcheck.py (2 hunks)
  • deepmd/utils/data_system.py (2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (29)
  • GitHub Check: Build wheels for cp310-manylinux_aarch64
  • GitHub Check: Build wheels for cp311-win_amd64
  • GitHub Check: Build wheels for cp311-manylinux_x86_64
  • GitHub Check: Build wheels for cp311-macosx_x86_64
  • GitHub Check: Build wheels for cp311-macosx_arm64
  • GitHub Check: Build wheels for cp311-manylinux_x86_64
  • GitHub Check: Analyze (python)
  • GitHub Check: Analyze (c-cpp)
  • GitHub Check: Build C++ (cuda120, cuda)
  • GitHub Check: Test Python (4, 3.9)
  • GitHub Check: Test Python (6, 3.12)
  • GitHub Check: Test Python (6, 3.9)
  • GitHub Check: Build C++ (cuda, cuda)
  • GitHub Check: Build C++ (rocm, rocm)
  • GitHub Check: Test Python (4, 3.12)
  • GitHub Check: Test Python (5, 3.12)
  • GitHub Check: Test Python (5, 3.9)
  • GitHub Check: Test Python (3, 3.12)
  • GitHub Check: Build C++ (clang, clang)
  • GitHub Check: Build C++ (cpu, cpu)
  • GitHub Check: Test Python (3, 3.9)
  • GitHub Check: Test Python (1, 3.12)
  • GitHub Check: Test Python (2, 3.12)
  • GitHub Check: Test Python (2, 3.9)
  • GitHub Check: Test Python (1, 3.9)
  • GitHub Check: Test C++ (true)
  • GitHub Check: Test C++ (false)
  • GitHub Check: Build C library (2.14, >=2.5.0,<2.15, libdeepmd_c_cu11.tar.gz)
  • GitHub Check: Build C library (2.18, libdeepmd_c.tar.gz)

@njzjz
Copy link
Member

njzjz commented Aug 26, 2025

I don't find my comments were resolved by any commits

@OutisLi OutisLi closed this Oct 20, 2025
@OutisLi OutisLi deleted the multi_system branch October 20, 2025 01:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants