Skip to content

Commit 52b49b7

Browse files
koubaaMohamed Koubaapyansys-ci-bot
authored
fix: Rework defaults (#730)
Co-authored-by: Mohamed Koubaa <[email protected]> Co-authored-by: pyansys-ci-bot <[email protected]>
1 parent 25736b0 commit 52b49b7

File tree

3,170 files changed

+82598
-62798
lines changed

Some content is hidden

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

3,170 files changed

+82598
-62798
lines changed

codegen/templates/keyword.j2

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ from ansys.dyna.core.lib.cards_.special.{{mixin_import.source}} import{% for nam
1111

1212
{% endif %}
1313
from ansys.dyna.core.lib.card import Card, Field, Flag
14-
from ansys.dyna.core.lib.config import use_lspp_defaults
1514
{% if keyword_data.duplicate %}
1615
from ansys.dyna.core.lib.duplicate_card import DuplicateCard
1716
{% endif %}

codegen/templates/keyword/card.j2

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,13 @@
9494
{{field.width}},
9595
{% if field.default is not none %}
9696
{% if field.readonly %}
97-
{{field.default}}
97+
Field.ReadOnlyValue({{field.default}}),
9898
{% else %}
99-
kwargs.get("{{field.name}}", {{field.default}} if use_lspp_defaults() else None)
99+
{{field.default}},
100100
{% endif %}
101+
**kwargs,
101102
{% else %}
102-
kwargs.get("{{field.name}}")
103+
**kwargs,
103104
{% endif %}
104105
),
105106
{% endfor %}

doc/changelog/730.documentation.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
fix: Rework defaults

src/ansys/dyna/core/keywords/keyword_classes/auto/airbag_adiabatic_gas_model.py

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222

2323
import typing
2424
from ansys.dyna.core.lib.card import Card, Field, Flag
25-
from ansys.dyna.core.lib.config import use_lspp_defaults
2625
from ansys.dyna.core.lib.keyword_base import KeywordBase
2726

2827
class AirbagAdiabaticGasModel(KeywordBase):
@@ -41,56 +40,63 @@ def __init__(self, **kwargs):
4140
int,
4241
0,
4342
10,
44-
kwargs.get("sid")
43+
**kwargs,
4544
),
4645
Field(
4746
"sidtyp",
4847
int,
4948
10,
5049
10,
51-
kwargs.get("sidtyp", 0 if use_lspp_defaults() else None)
50+
0,
51+
**kwargs,
5252
),
5353
Field(
5454
"rbid",
5555
int,
5656
20,
5757
10,
58-
kwargs.get("rbid", 0 if use_lspp_defaults() else None)
58+
0,
59+
**kwargs,
5960
),
6061
Field(
6162
"vsca",
6263
float,
6364
30,
6465
10,
65-
kwargs.get("vsca", 1.0 if use_lspp_defaults() else None)
66+
1.0,
67+
**kwargs,
6668
),
6769
Field(
6870
"psca",
6971
float,
7072
40,
7173
10,
72-
kwargs.get("psca", 1.0 if use_lspp_defaults() else None)
74+
1.0,
75+
**kwargs,
7376
),
7477
Field(
7578
"vini",
7679
float,
7780
50,
7881
10,
79-
kwargs.get("vini", 0.0 if use_lspp_defaults() else None)
82+
0.0,
83+
**kwargs,
8084
),
8185
Field(
8286
"mwd",
8387
float,
8488
60,
8589
10,
86-
kwargs.get("mwd", 0.0 if use_lspp_defaults() else None)
90+
0.0,
91+
**kwargs,
8792
),
8893
Field(
8994
"spsf",
9095
float,
9196
70,
9297
10,
93-
kwargs.get("spsf", 0.0 if use_lspp_defaults() else None)
98+
0.0,
99+
**kwargs,
94100
),
95101
],
96102
),
@@ -101,42 +107,43 @@ def __init__(self, **kwargs):
101107
float,
102108
0,
103109
10,
104-
kwargs.get("psf", 1.0 if use_lspp_defaults() else None)
110+
1.0,
111+
**kwargs,
105112
),
106113
Field(
107114
"lcid",
108115
int,
109116
10,
110117
10,
111-
kwargs.get("lcid")
118+
**kwargs,
112119
),
113120
Field(
114121
"gamma",
115122
float,
116123
20,
117124
10,
118-
kwargs.get("gamma")
125+
**kwargs,
119126
),
120127
Field(
121128
"po",
122129
float,
123130
30,
124131
10,
125-
kwargs.get("po")
132+
**kwargs,
126133
),
127134
Field(
128135
"pe",
129136
float,
130137
40,
131138
10,
132-
kwargs.get("pe")
139+
**kwargs,
133140
),
134141
Field(
135142
"ro",
136143
float,
137144
50,
138145
10,
139-
kwargs.get("ro")
146+
**kwargs,
140147
),
141148
],
142149
),

src/ansys/dyna/core/keywords/keyword_classes/auto/airbag_adiabatic_gas_model_id.py

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222

2323
import typing
2424
from ansys.dyna.core.lib.card import Card, Field, Flag
25-
from ansys.dyna.core.lib.config import use_lspp_defaults
2625
from ansys.dyna.core.lib.keyword_base import KeywordBase
2726

2827
class AirbagAdiabaticGasModelId(KeywordBase):
@@ -41,14 +40,14 @@ def __init__(self, **kwargs):
4140
int,
4241
0,
4342
10,
44-
kwargs.get("id")
43+
**kwargs,
4544
),
4645
Field(
4746
"title",
4847
str,
4948
10,
5049
70,
51-
kwargs.get("title")
50+
**kwargs,
5251
),
5352
],
5453
),
@@ -59,56 +58,63 @@ def __init__(self, **kwargs):
5958
int,
6059
0,
6160
10,
62-
kwargs.get("sid")
61+
**kwargs,
6362
),
6463
Field(
6564
"sidtyp",
6665
int,
6766
10,
6867
10,
69-
kwargs.get("sidtyp", 0 if use_lspp_defaults() else None)
68+
0,
69+
**kwargs,
7070
),
7171
Field(
7272
"rbid",
7373
int,
7474
20,
7575
10,
76-
kwargs.get("rbid", 0 if use_lspp_defaults() else None)
76+
0,
77+
**kwargs,
7778
),
7879
Field(
7980
"vsca",
8081
float,
8182
30,
8283
10,
83-
kwargs.get("vsca", 1.0 if use_lspp_defaults() else None)
84+
1.0,
85+
**kwargs,
8486
),
8587
Field(
8688
"psca",
8789
float,
8890
40,
8991
10,
90-
kwargs.get("psca", 1.0 if use_lspp_defaults() else None)
92+
1.0,
93+
**kwargs,
9194
),
9295
Field(
9396
"vini",
9497
float,
9598
50,
9699
10,
97-
kwargs.get("vini", 0.0 if use_lspp_defaults() else None)
100+
0.0,
101+
**kwargs,
98102
),
99103
Field(
100104
"mwd",
101105
float,
102106
60,
103107
10,
104-
kwargs.get("mwd", 0.0 if use_lspp_defaults() else None)
108+
0.0,
109+
**kwargs,
105110
),
106111
Field(
107112
"spsf",
108113
float,
109114
70,
110115
10,
111-
kwargs.get("spsf", 0.0 if use_lspp_defaults() else None)
116+
0.0,
117+
**kwargs,
112118
),
113119
],
114120
),
@@ -119,42 +125,43 @@ def __init__(self, **kwargs):
119125
float,
120126
0,
121127
10,
122-
kwargs.get("psf", 1.0 if use_lspp_defaults() else None)
128+
1.0,
129+
**kwargs,
123130
),
124131
Field(
125132
"lcid",
126133
int,
127134
10,
128135
10,
129-
kwargs.get("lcid")
136+
**kwargs,
130137
),
131138
Field(
132139
"gamma",
133140
float,
134141
20,
135142
10,
136-
kwargs.get("gamma")
143+
**kwargs,
137144
),
138145
Field(
139146
"po",
140147
float,
141148
30,
142149
10,
143-
kwargs.get("po")
150+
**kwargs,
144151
),
145152
Field(
146153
"pe",
147154
float,
148155
40,
149156
10,
150-
kwargs.get("pe")
157+
**kwargs,
151158
),
152159
Field(
153160
"ro",
154161
float,
155162
50,
156163
10,
157-
kwargs.get("ro")
164+
**kwargs,
158165
),
159166
],
160167
),

0 commit comments

Comments
 (0)