forked from dptech-corp/dpgen2
-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
argcheck: restrict the type of elements in a list (#179)
Signed-off-by: Jinzhe Zeng <[email protected]>
- Loading branch information
Showing
6 changed files
with
53 additions
and
15 deletions.
There are no files selected for viewing
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
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,29 @@ | ||
import json | ||
import unittest | ||
from pathlib import ( | ||
Path, | ||
) | ||
|
||
from dpgen2.entrypoint.args import ( | ||
normalize, | ||
) | ||
|
||
p_examples = Path(__file__).parent.parent / "examples" | ||
|
||
input_files = ( | ||
p_examples / "almg" / "input.json", | ||
# p_examples / "almg" / "input-v005.json", | ||
# p_examples / "almg" / "dp_template.json", | ||
p_examples / "ch4" / "input_dist.json", | ||
# p_examples / "chno" / "dpa_manyi.json", | ||
p_examples / "chno" / "input.json", | ||
) | ||
|
||
|
||
class TestExamples(unittest.TestCase): | ||
def test_arguments(self): | ||
for fn in input_files: | ||
with self.subTest(fn=fn): | ||
with open(fn) as f: | ||
jdata = json.load(f) | ||
normalize(jdata) |
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