-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
optimize
SequenceExpression
feature extraction
* fix: searching operation def list (#58) * bump versions * fix(stxhash): optimize for SequenceExpression * bump version --------- Co-authored-by: JamzumSum <[email protected]>
- Loading branch information
1 parent
4fe6e16
commit 5202a4b
Showing
7 changed files
with
237 additions
and
170 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[tool.poetry] | ||
name = "pychaosvm" | ||
version = "0.4.0" | ||
version = "0.4.1" | ||
description = "A Python envirionment for Tencent ChaosVM." | ||
authors = ["aioqzone <[email protected]>"] | ||
license = "AGPL-3.0-or-later" | ||
|
@@ -14,7 +14,7 @@ typing-extensions = ">=4.6.0" | |
lxml = "^5.3.0" | ||
|
||
[tool.poetry.group.test.dependencies] | ||
pytest = "^7.4.2" | ||
pytest = "^8.2.1" | ||
|
||
[tool.poetry.group.dev] | ||
optional = true | ||
|
This file contains 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 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 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 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,40 @@ | ||
from collections import defaultdict | ||
|
||
from pyjsparser import parse | ||
|
||
from chaosvm.stxhash import syntax_hash | ||
|
||
|
||
def test_tuple(): | ||
G1 = dict(C="p", y="P", Q="window", H="S") | ||
G2 = dict(k="p", B="P", Q="window", Y="S") | ||
s1 = """ | ||
var B = y[C++] | ||
, g = B ? H.slice(-B) : [] | ||
, B = (H.length -= B, | ||
g.unshift(null), | ||
H.pop()); | ||
H.push(A(B[0][B[1]], g)) | ||
""" | ||
s2 = """ | ||
var R = B[k++] | ||
, F = R ? Y.slice(-R) : []; | ||
Y.length -= R, | ||
F.unshift(null); | ||
R = Y.pop(); | ||
Y.push(A(R[0][R[1]], F)) | ||
""" | ||
ast1 = parse(s1) | ||
ast2 = parse(s2) | ||
|
||
assert isinstance(ast1, dict) | ||
assert isinstance(ast2, dict) | ||
|
||
c = defaultdict(lambda: f"t{len(c)-4}", G1) | ||
f1 = syntax_hash(ast1["body"], c) | ||
|
||
c = defaultdict(lambda: f"t{len(c)-4}", G2) | ||
f2 = syntax_hash(ast2["body"], c) | ||
|
||
assert f1 | ||
assert f1 == f2 |
This file contains 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