-
Notifications
You must be signed in to change notification settings - Fork 135
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
slow to import dpdata #526
Labels
enhancement
New feature or request
Comments
njzjz
added
enhancement
New feature or request
and removed
wontfix
This will not be worked on
labels
Aug 19, 2023
|
@link89 it will be helpful if you show the output of |
log.txt |
njzjz
added a commit
that referenced
this issue
May 15, 2024
Do a benchmark before working on #526 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Introduced benchmark tests for import functionality and command line interface operations. - **Tests** - Added new benchmark tests to assess performance improvements. - **Chores** - Integrated `pytest` and `pytest-codspeed` into the project for enhanced testing capabilities. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
njzjz
added a commit
to njzjz/dpdata
that referenced
this issue
May 16, 2024
Fix deepmodeling#526. Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
wanghan-iapcm
pushed a commit
that referenced
this issue
May 16, 2024
Fix #526. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Refactor** - Removed unnecessary import statements and restructured import handling for improved code organization and readability. - Reorganized imports within functions to localize dependencies and enhance code modularity. - **New Features** - Introduced conditional imports based on `TYPE_CHECKING` for better resource management and efficiency. - Added a new method `from_dict` to the `System` class for constructing instances from a data dictionary. - **Chores** - Updated linting rules in `pyproject.toml` to include `TID253` for banned module-level imports. - Modified import statements in test files to comply with the new linting rules for better code quality. - **Style** - Added `# noqa: TID253` comments to specific import statements to adhere to new linting rules and ensure clean code styling. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I find that it would takes up to 30s to run just
import dpdata
on the login node of HPC. I did some investigation myself and find that it would load almost all the modules into memory when importing thedpdata
module.Here is the relative code:
https://github.com/deepmodeling/dpdata/blob/master/dpdata/__init__.py#L21-L30
Is it possible to just remove the
__all__
expression? I think it is for users who like to usefrom dpdata import *
, which is not a good practices IMO.The text was updated successfully, but these errors were encountered: