Skip to content

Commit

Permalink
feat: Option to disable LSPP defaults (#649)
Browse files Browse the repository at this point in the history
Co-authored-by: Mohamed Koubaa <[email protected]>
Co-authored-by: pyansys-ci-bot <[email protected]>
  • Loading branch information
3 people authored Jan 3, 2025
1 parent 7a76547 commit 183e787
Show file tree
Hide file tree
Showing 3,171 changed files with 26,182 additions and 22,963 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
1 change: 1 addition & 0 deletions codegen/templates/keyword.j2
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import typing
{# TODO - only do this if there's a keyword without a default #}
from ansys.dyna.core.lib.card import Card, Field, Flag
from ansys.dyna.core.lib.config import use_lspp_defaults
{% if keyword_data.duplicate %}
from ansys.dyna.core.lib.duplicate_card import DuplicateCard
{% endif %}
Expand Down
2 changes: 1 addition & 1 deletion codegen/templates/keyword/card.j2
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
{% if field.readonly %}
{{field.default}}
{% else %}
kwargs.get("{{field.name}}", {{field.default}})
kwargs.get("{{field.name}}", {{field.default}} if use_lspp_defaults() else None)
{% endif %}
{% else %}
kwargs.get("{{field.name}}")
Expand Down
1 change: 1 addition & 0 deletions doc/changelog/649.miscellaneous.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
feat: Option to disable LSPP defaults
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

import typing
from ansys.dyna.core.lib.card import Card, Field, Flag
from ansys.dyna.core.lib.config import use_lspp_defaults
from ansys.dyna.core.lib.keyword_base import KeywordBase

class AirbagAdiabaticGasModel(KeywordBase):
Expand All @@ -47,49 +48,49 @@ def __init__(self, **kwargs):
int,
10,
10,
kwargs.get("sidtyp", 0)
kwargs.get("sidtyp", 0 if use_lspp_defaults() else None)
),
Field(
"rbid",
int,
20,
10,
kwargs.get("rbid", 0)
kwargs.get("rbid", 0 if use_lspp_defaults() else None)
),
Field(
"vsca",
float,
30,
10,
kwargs.get("vsca", 1.0)
kwargs.get("vsca", 1.0 if use_lspp_defaults() else None)
),
Field(
"psca",
float,
40,
10,
kwargs.get("psca", 1.0)
kwargs.get("psca", 1.0 if use_lspp_defaults() else None)
),
Field(
"vini",
float,
50,
10,
kwargs.get("vini", 0.0)
kwargs.get("vini", 0.0 if use_lspp_defaults() else None)
),
Field(
"mwd",
float,
60,
10,
kwargs.get("mwd", 0.0)
kwargs.get("mwd", 0.0 if use_lspp_defaults() else None)
),
Field(
"spsf",
float,
70,
10,
kwargs.get("spsf", 0.0)
kwargs.get("spsf", 0.0 if use_lspp_defaults() else None)
),
],
),
Expand All @@ -100,7 +101,7 @@ def __init__(self, **kwargs):
float,
0,
10,
kwargs.get("psf", 1.0)
kwargs.get("psf", 1.0 if use_lspp_defaults() else None)
),
Field(
"lcid",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

import typing
from ansys.dyna.core.lib.card import Card, Field, Flag
from ansys.dyna.core.lib.config import use_lspp_defaults
from ansys.dyna.core.lib.keyword_base import KeywordBase

class AirbagAdiabaticGasModelId(KeywordBase):
Expand Down Expand Up @@ -65,49 +66,49 @@ def __init__(self, **kwargs):
int,
10,
10,
kwargs.get("sidtyp", 0)
kwargs.get("sidtyp", 0 if use_lspp_defaults() else None)
),
Field(
"rbid",
int,
20,
10,
kwargs.get("rbid", 0)
kwargs.get("rbid", 0 if use_lspp_defaults() else None)
),
Field(
"vsca",
float,
30,
10,
kwargs.get("vsca", 1.0)
kwargs.get("vsca", 1.0 if use_lspp_defaults() else None)
),
Field(
"psca",
float,
40,
10,
kwargs.get("psca", 1.0)
kwargs.get("psca", 1.0 if use_lspp_defaults() else None)
),
Field(
"vini",
float,
50,
10,
kwargs.get("vini", 0.0)
kwargs.get("vini", 0.0 if use_lspp_defaults() else None)
),
Field(
"mwd",
float,
60,
10,
kwargs.get("mwd", 0.0)
kwargs.get("mwd", 0.0 if use_lspp_defaults() else None)
),
Field(
"spsf",
float,
70,
10,
kwargs.get("spsf", 0.0)
kwargs.get("spsf", 0.0 if use_lspp_defaults() else None)
),
],
),
Expand All @@ -118,7 +119,7 @@ def __init__(self, **kwargs):
float,
0,
10,
kwargs.get("psf", 1.0)
kwargs.get("psf", 1.0 if use_lspp_defaults() else None)
),
Field(
"lcid",
Expand Down
Loading

0 comments on commit 183e787

Please sign in to comment.