-
Notifications
You must be signed in to change notification settings - Fork 25
refactor: reorganize imports and improve dataset builder logic in build.py #288
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
QG-phy
merged 1 commit into
deepmodeling:main
from
kirk0830:refactor-datasetbuilder-call
Dec 18, 2025
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: deepmodeling/DeePTB
Length of output: 182
🏁 Script executed:
Repository: deepmodeling/DeePTB
Length of output: 182
🏁 Script executed:
Repository: deepmodeling/DeePTB
Length of output: 182
🏁 Script executed:
Repository: deepmodeling/DeePTB
Length of output: 182
🏁 Script executed:
Repository: deepmodeling/DeePTB
Length of output: 182
🌐 Web query:
DeePTB dptb/data/build.py DatasetBuilder __call__ github💡 Result:
You can find the DatasetBuilder.call implementation in dptb/data/build.py of the DeePTB repo on GitHub (shows the full function signature and logic for building DefaultDataset / DeePHDataset / HDF5Dataset / LMDBDataset). Source (raw file): [1]; repo page: [2].
Sources:
[1] DeePTB dptb/data/build.py (raw). https://github.com/deepmodeling/DeePTB/blob/main/dptb/data/build.py?raw=true.
[2] deepmodeling/DeePTB GitHub repository. https://github.com/deepmodeling/DeePTB.
🌐 Web query:
site:github.com/deepmodeling/DeePTB dptb/data/build.py __call__ kwargs💡 Result:
The DatasetBuilder.call signature (from dptb/data/build.py) is:
def call(self,
root: str,
r_max: Union[float,int,dict],
er_max: Union[float,int,dict]=None,
oer_max: Union[float,int,dict]=None,
type: str = "DefaultDataset",
prefix: str = None,
separator: str = '.',
get_Hamiltonian: bool = False,
get_overlap: bool = False,
get_DM: bool = False,
get_eigenvalues: bool = False,
orthogonal: bool = False,
basis: str = None,
**kwargs
)
Notes:
Source: dptb/data/build.py (DeePTB repository). [1]
🏁 Script executed:
Repository: deepmodeling/DeePTB
Length of output: 182
🏁 Script executed:
Repository: deepmodeling/DeePTB
Length of output: 182
🏁 Script executed:
Repository: deepmodeling/DeePTB
Length of output: 182
🏁 Script executed:
Repository: deepmodeling/DeePTB
Length of output: 182
🌐 Web query:
site:github.com/deepmodeling/DeePTB "class DeePHE3Dataset" OR "class DefaultDataset" OR "class HDF5Dataset" OR "class LMDBDataset" __init__💡 Result:
I searched the deepmodeling/DeePTB repository for those class names.
Findings:
Sources:
If you want, I can (a) do a deeper code search through the repo files (open specific subfolders) and return exact file/line hits, or (b) provide direct links to any matching source files. Which would you prefer?
🌐 Web query:
deepmodeling/DeePTB dataset classes __init__ signature DefaultDataset HDF5Dataset LMDBDataset💡 Result:
I can fetch those exact init signatures from the DeePTB repo and return them. Do you want me to look them up on GitHub now?
__call__accepts**kwargsbut silently ignores them instead of forwarding to dataset constructorsThe
__call__method signature includes**kwargs, but these are never passed to any of the four dataset constructors (DeePHE3Dataset, DefaultDataset, HDF5Dataset, LMDBDataset). This means callers cannot configure dataset-specific options viabuild_dataset(..., some_option=...)— such arguments are silently dropped, which is surprising and error-prone.Either forward
**kwargsto the dataset constructors, or remove the parameter from__call__andfrom_modelto be explicit that extra options are not supported.Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@coderabbitai yes I noticed this, too. But this is not the problem brought about by this PR, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kirk0830 You're absolutely right! This is a pre-existing issue with the
**kwargssignature, not something introduced by your refactoring. Your PR is focused on improving the folder discovery logic, Path usage, and info.json handling – all good changes.The
**kwargswas already there and remains unused in the original code as well. If you'd like to address it in a future PR (either by forwarding the kwargs or removing the parameter), I can help open a tracking issue for it. Otherwise, feel free to keep this PR focused on the refactoring work you've done.