Skip to content

Commit be3283b

Browse files
committed
fix drop_none and attach_children
1 parent 2a7354c commit be3283b

File tree

114 files changed

+1122
-2
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

114 files changed

+1122
-2
lines changed

spec/dfn2toml.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def _attach_children(d: Any):
1818
if isinstance(d, Mapping):
1919
if "children" in d:
2020
for n, c in d["children"].items():
21-
d[n] = Shim._attach_children(c)
21+
d[n] = c
2222
del d["children"]
2323
d = {k: Shim._attach_children(v) for k, v in d.items()}
2424
return d
@@ -29,7 +29,7 @@ def _drop_none(d: Any):
2929
return {
3030
k: Shim._drop_none(v)
3131
for k, v in d.items()
32-
if (v or isinstance(v, bool))
32+
if v is not None
3333
}
3434
else:
3535
return d

spec/toml/chf-cdb.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,13 @@ name = "stress_period_data"
5656
type = "list"
5757
shape = "(maxbound)"
5858
block = "period"
59+
description = ""
5960

6061
[period.stress_period_data.stress_period_data]
6162
name = "stress_period_data"
6263
type = "record"
6364
block = "period"
65+
description = ""
6466

6567
[period.stress_period_data.stress_period_data.cellid]
6668
block = "period"
@@ -77,6 +79,7 @@ description = "is the cell identifier, and depends on the type of grid that is u
7779
block = "period"
7880
name = "idcxs"
7981
type = "integer"
82+
shape = ""
8083
tagged = "false"
8184
in_record = "true"
8285
reader = "urword"
@@ -89,6 +92,7 @@ numeric_index = "true"
8992
block = "period"
9093
name = "width"
9194
type = "double precision"
95+
shape = ""
9296
tagged = "false"
9397
in_record = "true"
9498
reader = "urword"
@@ -114,6 +118,7 @@ mf6internal = "auxvar"
114118
block = "period"
115119
name = "boundname"
116120
type = "string"
121+
shape = ""
117122
tagged = "false"
118123
in_record = "true"
119124
reader = "urword"

spec/toml/chf-chd.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,13 @@ name = "stress_period_data"
7676
type = "list"
7777
shape = "(maxbound)"
7878
block = "period"
79+
description = ""
7980

8081
[period.stress_period_data.stress_period_data]
8182
name = "stress_period_data"
8283
type = "record"
8384
block = "period"
85+
description = ""
8486

8587
[period.stress_period_data.stress_period_data.cellid]
8688
block = "period"
@@ -97,6 +99,7 @@ description = "is the cell identifier, and depends on the type of grid that is u
9799
block = "period"
98100
name = "head"
99101
type = "double precision"
102+
shape = ""
100103
tagged = "false"
101104
in_record = "true"
102105
reader = "urword"
@@ -121,6 +124,7 @@ description = "represents the values of the auxiliary variables for each constan
121124
block = "period"
122125
name = "boundname"
123126
type = "string"
127+
shape = ""
124128
tagged = "false"
125129
in_record = "true"
126130
reader = "urword"

spec/toml/chf-cxs.toml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,19 @@ name = "packagedata"
2424
type = "list"
2525
shape = "(nsections)"
2626
block = "packagedata"
27+
description = ""
2728

2829
[packagedata.packagedata.packagedata]
2930
name = "packagedata"
3031
type = "record"
3132
block = "packagedata"
33+
description = ""
3234

3335
[packagedata.packagedata.packagedata.idcxs]
3436
block = "packagedata"
3537
name = "idcxs"
3638
type = "integer"
39+
shape = ""
3740
tagged = "false"
3841
in_record = "true"
3942
reader = "urword"
@@ -45,6 +48,7 @@ numeric_index = "true"
4548
block = "packagedata"
4649
name = "nxspoints"
4750
type = "integer"
51+
shape = ""
4852
tagged = "false"
4953
in_record = "true"
5054
reader = "urword"
@@ -56,16 +60,19 @@ name = "crosssectiondata"
5660
type = "list"
5761
shape = "(npoints)"
5862
block = "crosssectiondata"
63+
description = ""
5964

6065
[crosssectiondata.crosssectiondata.crosssectiondata]
6166
name = "crosssectiondata"
6267
type = "record"
6368
block = "crosssectiondata"
69+
description = ""
6470

6571
[crosssectiondata.crosssectiondata.crosssectiondata.xfraction]
6672
block = "crosssectiondata"
6773
name = "xfraction"
6874
type = "double precision"
75+
shape = ""
6976
tagged = "false"
7077
in_record = "true"
7178
reader = "urword"
@@ -76,6 +83,7 @@ description = "real value that defines the station (x) data for the cross-sectio
7683
block = "crosssectiondata"
7784
name = "height"
7885
type = "double precision"
86+
shape = ""
7987
tagged = "false"
8088
in_record = "true"
8189
reader = "urword"
@@ -86,6 +94,7 @@ description = "real value that is the height relative to the top of the lowest e
8694
block = "crosssectiondata"
8795
name = "manfraction"
8896
type = "double precision"
97+
shape = ""
8998
tagged = "false"
9099
in_record = "true"
91100
reader = "urword"

spec/toml/chf-dis2d.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ type = "double precision"
7373
shape = "(ncol, nrow)"
7474
block = "griddata"
7575
description = "is the bottom elevation for each cell."
76+
default = 0.0
7677

7778
[griddata.idomain]
7879
name = "idomain"

spec/toml/chf-disv1d.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,13 @@ name = "vertices"
7575
type = "list"
7676
shape = "(nvert)"
7777
block = "vertices"
78+
description = ""
7879

7980
[vertices.vertices.vertices]
8081
name = "vertices"
8182
type = "record"
8283
block = "vertices"
84+
description = ""
8385

8486
[vertices.vertices.vertices.iv]
8587
block = "vertices"
@@ -120,11 +122,13 @@ name = "cell1d"
120122
type = "list"
121123
shape = "(nodes)"
122124
block = "cell1d"
125+
description = ""
123126

124127
[cell1d.cell1d.cell1d]
125128
name = "cell1d"
126129
type = "record"
127130
block = "cell1d"
131+
description = ""
128132

129133
[cell1d.cell1d.cell1d.icell1d]
130134
block = "cell1d"

spec/toml/chf-disv2d.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,13 @@ name = "vertices"
6868
type = "list"
6969
shape = "(nvert)"
7070
block = "vertices"
71+
description = ""
7172

7273
[vertices.vertices.vertices]
7374
name = "vertices"
7475
type = "record"
7576
block = "vertices"
77+
description = ""
7678

7779
[vertices.vertices.vertices.iv]
7880
block = "vertices"
@@ -113,11 +115,13 @@ name = "cell2d"
113115
type = "list"
114116
shape = "(nodes)"
115117
block = "cell2d"
118+
description = ""
116119

117120
[cell2d.cell2d.cell2d]
118121
name = "cell2d"
119122
type = "record"
120123
block = "cell2d"
124+
description = ""
121125

122126
[cell2d.cell2d.cell2d.icell2d]
123127
block = "cell2d"

spec/toml/chf-flw.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,13 @@ name = "stress_period_data"
7676
type = "list"
7777
shape = "(maxbound)"
7878
block = "period"
79+
description = ""
7980

8081
[period.stress_period_data.stress_period_data]
8182
name = "stress_period_data"
8283
type = "record"
8384
block = "period"
85+
description = ""
8486

8587
[period.stress_period_data.stress_period_data.cellid]
8688
block = "period"
@@ -97,6 +99,7 @@ description = "is the cell identifier, and depends on the type of grid that is u
9799
block = "period"
98100
name = "q"
99101
type = "double precision"
102+
shape = ""
100103
tagged = "false"
101104
in_record = "true"
102105
reader = "urword"
@@ -121,6 +124,7 @@ description = "represents the values of the auxiliary variables for each inflow.
121124
block = "period"
122125
name = "boundname"
123126
type = "string"
127+
shape = ""
124128
tagged = "false"
125129
in_record = "true"
126130
reader = "urword"

spec/toml/chf-ic.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ type = "double precision"
1313
shape = "(nodes)"
1414
block = "griddata"
1515
description = "is the initial (starting) stage---that is, stage at the beginning of the swf model simulation. strt must be specified for all swf model simulations. one value is read for every model reach."
16+
default = 0.0

spec/toml/chf-nam.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,13 @@ description = "keyword that indicates whether the surface water stage in a reach
5454
name = "packages"
5555
type = "list"
5656
block = "packages"
57+
description = ""
5758

5859
[packages.packages.packages]
5960
name = "packages"
6061
type = "record"
6162
block = "packages"
63+
description = ""
6264

6365
[packages.packages.packages.ftype]
6466
block = "packages"

0 commit comments

Comments
 (0)