-
Notifications
You must be signed in to change notification settings - Fork 607
feat(show): add serialization-tree via DeepEval.serialize #5316
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
Open
njzjz-bot
wants to merge
11
commits into
deepmodeling:master
Choose a base branch
from
njzjz-bot:feat/deepeval-serialize
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
c8de6a6
feat(show): add serialization-tree via DeepEval.serialize
njzjz-bot b695aaa
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 1694360
refactor(deepeval): implement backend serialize via model.serialize
njzjz-bot 7675388
fix(show): align backend serialize output contracts
njzjz-bot a8a80f4
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] c18814c
refactor(show): decouple serialization tree from deep eval wrapper
njzjz-bot 5678d78
refactor(deepeval): serialize model tree only
njzjz-bot 8b48f46
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 5e97073
test(io): cover deep eval serialization in consistent io
njzjz-bot 8bf3176
fix(review): handle paddle static serialize and io assert
njzjz-bot 6cf9dbf
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 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
Some comments aren't visible on the classic Files Changed page.
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
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
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
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
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
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
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| # SPDX-License-Identifier: LGPL-3.0-or-later | ||
| import unittest | ||
| from unittest.mock import ( | ||
| patch, | ||
| ) | ||
|
|
||
| from deepmd.entrypoints.show import ( | ||
| show, | ||
| ) | ||
|
|
||
|
|
||
| class TestShowSerializationTree(unittest.TestCase): | ||
| def test_serialization_tree_uses_deep_eval_model_payload(self) -> None: | ||
| with ( | ||
| patch("deepmd.entrypoints.show.DeepEval") as mock_deep_eval, | ||
| patch("deepmd.entrypoints.show.Node.deserialize") as mock_deserialize, | ||
| patch("deepmd.entrypoints.show.log.info") as mock_log_info, | ||
| ): | ||
| model = mock_deep_eval.return_value | ||
| model.get_model_def_script.return_value = {"type_map": ["H", "O"]} | ||
| model.get_model_size.return_value = {} | ||
| model.serialize.return_value = {"@class": "MockModel"} | ||
| mock_deserialize.return_value = "ROOT" | ||
|
|
||
| show(INPUT="mock.pte", ATTRIBUTES=["serialization-tree"]) | ||
|
|
||
| model.serialize.assert_called_once_with() | ||
| mock_deserialize.assert_called_once_with({"@class": "MockModel"}) | ||
| mock_log_info.assert_any_call("Model serialization tree:\nROOT") |
Oops, something went wrong.
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.