Skip to content

Commit 183e787

Browse files
koubaaMohamed Koubaapyansys-ci-bot
authored
feat: Option to disable LSPP defaults (#649)
Co-authored-by: Mohamed Koubaa <[email protected]> Co-authored-by: pyansys-ci-bot <[email protected]>
1 parent 7a76547 commit 183e787

File tree

3,171 files changed

+26182
-22963
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,171 files changed

+26182
-22963
lines changed

codegen/templates/keyword.j2

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import typing
33
{# TODO - only do this if there's a keyword without a default #}
44
from ansys.dyna.core.lib.card import Card, Field, Flag
5+
from ansys.dyna.core.lib.config import use_lspp_defaults
56
{% if keyword_data.duplicate %}
67
from ansys.dyna.core.lib.duplicate_card import DuplicateCard
78
{% endif %}

codegen/templates/keyword/card.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
{% if field.readonly %}
8686
{{field.default}}
8787
{% else %}
88-
kwargs.get("{{field.name}}", {{field.default}})
88+
kwargs.get("{{field.name}}", {{field.default}} if use_lspp_defaults() else None)
8989
{% endif %}
9090
{% else %}
9191
kwargs.get("{{field.name}}")

doc/changelog/649.miscellaneous.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
feat: Option to disable LSPP defaults

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

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
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
2526
from ansys.dyna.core.lib.keyword_base import KeywordBase
2627

2728
class AirbagAdiabaticGasModel(KeywordBase):
@@ -47,49 +48,49 @@ def __init__(self, **kwargs):
4748
int,
4849
10,
4950
10,
50-
kwargs.get("sidtyp", 0)
51+
kwargs.get("sidtyp", 0 if use_lspp_defaults() else None)
5152
),
5253
Field(
5354
"rbid",
5455
int,
5556
20,
5657
10,
57-
kwargs.get("rbid", 0)
58+
kwargs.get("rbid", 0 if use_lspp_defaults() else None)
5859
),
5960
Field(
6061
"vsca",
6162
float,
6263
30,
6364
10,
64-
kwargs.get("vsca", 1.0)
65+
kwargs.get("vsca", 1.0 if use_lspp_defaults() else None)
6566
),
6667
Field(
6768
"psca",
6869
float,
6970
40,
7071
10,
71-
kwargs.get("psca", 1.0)
72+
kwargs.get("psca", 1.0 if use_lspp_defaults() else None)
7273
),
7374
Field(
7475
"vini",
7576
float,
7677
50,
7778
10,
78-
kwargs.get("vini", 0.0)
79+
kwargs.get("vini", 0.0 if use_lspp_defaults() else None)
7980
),
8081
Field(
8182
"mwd",
8283
float,
8384
60,
8485
10,
85-
kwargs.get("mwd", 0.0)
86+
kwargs.get("mwd", 0.0 if use_lspp_defaults() else None)
8687
),
8788
Field(
8889
"spsf",
8990
float,
9091
70,
9192
10,
92-
kwargs.get("spsf", 0.0)
93+
kwargs.get("spsf", 0.0 if use_lspp_defaults() else None)
9394
),
9495
],
9596
),
@@ -100,7 +101,7 @@ def __init__(self, **kwargs):
100101
float,
101102
0,
102103
10,
103-
kwargs.get("psf", 1.0)
104+
kwargs.get("psf", 1.0 if use_lspp_defaults() else None)
104105
),
105106
Field(
106107
"lcid",

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

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
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
2526
from ansys.dyna.core.lib.keyword_base import KeywordBase
2627

2728
class AirbagAdiabaticGasModelId(KeywordBase):
@@ -65,49 +66,49 @@ def __init__(self, **kwargs):
6566
int,
6667
10,
6768
10,
68-
kwargs.get("sidtyp", 0)
69+
kwargs.get("sidtyp", 0 if use_lspp_defaults() else None)
6970
),
7071
Field(
7172
"rbid",
7273
int,
7374
20,
7475
10,
75-
kwargs.get("rbid", 0)
76+
kwargs.get("rbid", 0 if use_lspp_defaults() else None)
7677
),
7778
Field(
7879
"vsca",
7980
float,
8081
30,
8182
10,
82-
kwargs.get("vsca", 1.0)
83+
kwargs.get("vsca", 1.0 if use_lspp_defaults() else None)
8384
),
8485
Field(
8586
"psca",
8687
float,
8788
40,
8889
10,
89-
kwargs.get("psca", 1.0)
90+
kwargs.get("psca", 1.0 if use_lspp_defaults() else None)
9091
),
9192
Field(
9293
"vini",
9394
float,
9495
50,
9596
10,
96-
kwargs.get("vini", 0.0)
97+
kwargs.get("vini", 0.0 if use_lspp_defaults() else None)
9798
),
9899
Field(
99100
"mwd",
100101
float,
101102
60,
102103
10,
103-
kwargs.get("mwd", 0.0)
104+
kwargs.get("mwd", 0.0 if use_lspp_defaults() else None)
104105
),
105106
Field(
106107
"spsf",
107108
float,
108109
70,
109110
10,
110-
kwargs.get("spsf", 0.0)
111+
kwargs.get("spsf", 0.0 if use_lspp_defaults() else None)
111112
),
112113
],
113114
),
@@ -118,7 +119,7 @@ def __init__(self, **kwargs):
118119
float,
119120
0,
120121
10,
121-
kwargs.get("psf", 1.0)
122+
kwargs.get("psf", 1.0 if use_lspp_defaults() else None)
122123
),
123124
Field(
124125
"lcid",

0 commit comments

Comments
 (0)