Skip to content

Commit 615ce5b

Browse files
committed
refine examples
1 parent 675c688 commit 615ce5b

File tree

2 files changed

+33
-14
lines changed

2 files changed

+33
-14
lines changed

tests/dpmdargs.py

Lines changed: 31 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,14 @@ def descrpt_hybrid_args():
170170
doc_list = f'A list of descriptor definitions'
171171

172172
return [
173-
Argument("list", list, optional = False, doc = doc_list)
173+
Argument("list", list, [], [
174+
Variant("type", [
175+
Argument("loc_frame", dict, descrpt_local_frame_args()),
176+
Argument("se_a", dict, descrpt_se_a_args()),
177+
Argument("se_r", dict, descrpt_se_r_args()),
178+
Argument("se_a_3be", dict, descrpt_se_a_3be_args(), alias = ['se_at']),
179+
Argument("se_a_tpe", dict, descrpt_se_a_tpe_args(), alias = ['se_a_ebd'])])],
180+
repeat=True, optional = False, doc = doc_list, fold_subdoc=True)
174181
]
175182

176183

@@ -526,17 +533,29 @@ def normalize(data):
526533
"_comment": " model parameters",
527534
"model": {
528535
"type_map": ["O", "H"],
529-
"descriptor" :{
530-
"type": "se_a",
531-
"sel": [46, 92],
532-
"rcut_smth": 5.80,
533-
"rcut": 6.00,
534-
"neuron": [25, 50, 100],
535-
"resnet_dt": false,
536-
"axis_neuron": 16,
537-
"seed": 1,
538-
"_comment": " that's all"
539-
},
536+
"descriptor" : {
537+
"type": "hybrid",
538+
"list": [{
539+
"type": "se_a",
540+
"sel": [46, 92],
541+
"rcut_smth": 5.80,
542+
"rcut": 6.00,
543+
"neuron": [25, 50, 100],
544+
"resnet_dt": false,
545+
"axis_neuron": 16,
546+
"seed": 1,
547+
"_comment": " that's all"
548+
},{
549+
"type": "se_r",
550+
"sel": [46, 92],
551+
"rcut_smth": 5.80,
552+
"rcut": 6.00,
553+
"neuron": [25, 50, 100],
554+
"resnet_dt": false,
555+
"seed": 1,
556+
"_comment": " that's all"
557+
}]
558+
},
540559
"fitting_net" : {
541560
"neuron": [240, 240, 240],
542561
"resnet_dt": true,

tests/test_docgen.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ def test_sub_fields(self):
1919
# print("\n\n"+docstr)
2020

2121
def test_sub_repeat(self):
22-
ca = Argument("base", dict, [
22+
ca = Argument("base", list, [
2323
Argument("sub1", int, doc="sub doc." * 5),
2424
Argument("sub2", [None, str, dict], [
2525
Argument("subsub1", int, doc="subsub doc." * 5, optional=True),
26-
Argument("subsub2", dict, [
26+
Argument("subsub2", list, [
2727
Argument("subsubsub1", int, doc="subsubsub doc." * 5)
2828
], doc="subsub doc." * 5, repeat=True)
2929
], doc="sub doc." * 5)

0 commit comments

Comments
 (0)