Skip to content
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

rename j_must_have to j_deprecated and only warn about deprecated keys #3523

Closed
github-actions bot opened this issue Mar 19, 2024 · 1 comment · Fixed by #3816
Closed

rename j_must_have to j_deprecated and only warn about deprecated keys #3523

github-actions bot opened this issue Mar 19, 2024 · 1 comment · Fixed by #3816

Comments

@github-actions
Copy link

maybe rename this to j_deprecated and only warn about deprecated keys,
if the deprecated_key argument is left empty function puppose is only custom
error since dict[key] already raises KeyError when the key is missing

Line: 184

return default_mesh
# TODO: rename j_must_have to j_deprecated and only warn about deprecated keys
# maybe rename this to j_deprecated and only warn about deprecated keys,
# if the deprecated_key argument is left empty function puppose is only custom
# error since dict[key] already raises KeyError when the key is missing
def j_must_have(
jdata: Dict[str, "_DICT_VAL"], key: str, deprecated_key: List[str] = []
) -> "_DICT_VAL":
"""Assert that supplied dictionary conaines specified key.

njzjz added a commit to njzjz/deepmd-kit that referenced this issue May 24, 2024
github-merge-queue bot pushed a commit that referenced this issue May 24, 2024
…ted keys (#3816)

Fix #3523.

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit


- **Refactor**
- Simplified code by removing the `j_must_have` function and directly
accessing dictionary keys in various test files.
- Replaced `j_must_have` with direct dictionary access for improved code
readability and maintenance.

- **Chores**
- Updated test files to directly access dictionary values, enhancing
code readability and maintainability.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Signed-off-by: Jinzhe Zeng <[email protected]>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Copy link
Author

Closed in commit 6aac9f8

mtaillefumier pushed a commit to mtaillefumier/deepmd-kit that referenced this issue Sep 18, 2024
…ted keys (deepmodeling#3816)

Fix deepmodeling#3523.

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit


- **Refactor**
- Simplified code by removing the `j_must_have` function and directly
accessing dictionary keys in various test files.
- Replaced `j_must_have` with direct dictionary access for improved code
readability and maintenance.

- **Chores**
- Updated test files to directly access dictionary values, enhancing
code readability and maintainability.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Signed-off-by: Jinzhe Zeng <[email protected]>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Archived in project
Development

Successfully merging a pull request may close this issue.

0 participants