Skip to content

Commit 433ba3c

Browse files
update generated code (#2129)
Co-authored-by: PProfizi <[email protected]>
1 parent 1b7b619 commit 433ba3c

File tree

8 files changed

+148
-3
lines changed

8 files changed

+148
-3
lines changed

src/ansys/dpf/core/operators/math/accumulate.py

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,13 @@ class accumulate(Operator):
6161
"""
6262

6363
def __init__(
64-
self, fieldA=None, weights=None, time_scoping=None, config=None, server=None
64+
self,
65+
fieldA=None,
66+
weights=None,
67+
time_scoping=None,
68+
config=None,
69+
server=None,
70+
ponderation=None,
6571
):
6672
super().__init__(name="accumulate", config=config, server=server)
6773
self._inputs = InputsAccumulate(self)
@@ -70,6 +76,8 @@ def __init__(
7076
self.inputs.fieldA.connect(fieldA)
7177
if weights is not None:
7278
self.inputs.weights.connect(weights)
79+
elif ponderation is not None:
80+
self.inputs.weights.connect(ponderation)
7381
if time_scoping is not None:
7482
self.inputs.time_scoping.connect(time_scoping)
7583

@@ -92,6 +100,7 @@ def _spec() -> Specification:
92100
type_names=["field"],
93101
optional=True,
94102
document=r"""Field containing weights, one weight per entity""",
103+
aliases=["ponderation"],
95104
),
96105
2: PinSpecification(
97106
name="time_scoping",
@@ -243,6 +252,18 @@ def time_scoping(self) -> Input:
243252
"""
244253
return self._time_scoping
245254

255+
def __getattr__(self, name):
256+
if name in ["ponderation"]:
257+
warn(
258+
DeprecationWarning(
259+
f'Operator accumulate: Input name "{name}" is deprecated in favor of "weights".'
260+
)
261+
)
262+
return self.weights
263+
raise AttributeError(
264+
f"'{self.__class__.__name__}' object has no attribute '{name}'."
265+
)
266+
246267

247268
class OutputsAccumulate(_Outputs):
248269
"""Intermediate class used to get outputs from

src/ansys/dpf/core/operators/math/accumulate_fc.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ def __init__(
6767
time_scoping=None,
6868
config=None,
6969
server=None,
70+
ponderation=None,
7071
):
7172
super().__init__(name="accumulate_fc", config=config, server=server)
7273
self._inputs = InputsAccumulateFc(self)
@@ -75,6 +76,8 @@ def __init__(
7576
self.inputs.fields_container.connect(fields_container)
7677
if weights is not None:
7778
self.inputs.weights.connect(weights)
79+
elif ponderation is not None:
80+
self.inputs.weights.connect(ponderation)
7881
if time_scoping is not None:
7982
self.inputs.time_scoping.connect(time_scoping)
8083

@@ -97,6 +100,7 @@ def _spec() -> Specification:
97100
type_names=["field"],
98101
optional=True,
99102
document=r"""Field containing weights, one weight per entity""",
103+
aliases=["ponderation"],
100104
),
101105
2: PinSpecification(
102106
name="time_scoping",
@@ -248,6 +252,18 @@ def time_scoping(self) -> Input:
248252
"""
249253
return self._time_scoping
250254

255+
def __getattr__(self, name):
256+
if name in ["ponderation"]:
257+
warn(
258+
DeprecationWarning(
259+
f'Operator accumulate_fc: Input name "{name}" is deprecated in favor of "weights".'
260+
)
261+
)
262+
return self.weights
263+
raise AttributeError(
264+
f"'{self.__class__.__name__}' object has no attribute '{name}'."
265+
)
266+
251267

252268
class OutputsAccumulateFc(_Outputs):
253269
"""Intermediate class used to get outputs from

src/ansys/dpf/core/operators/math/add_constant.py

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,23 @@ class add_constant(Operator):
5353
>>> result_field = op.outputs.field()
5454
"""
5555

56-
def __init__(self, field=None, weights=None, config=None, server=None):
56+
def __init__(
57+
self,
58+
field=None,
59+
weights=None,
60+
config=None,
61+
server=None,
62+
ponderation=None,
63+
):
5764
super().__init__(name="add_constant", config=config, server=server)
5865
self._inputs = InputsAddConstant(self)
5966
self._outputs = OutputsAddConstant(self)
6067
if field is not None:
6168
self.inputs.field.connect(field)
6269
if weights is not None:
6370
self.inputs.weights.connect(weights)
71+
elif ponderation is not None:
72+
self.inputs.weights.connect(ponderation)
6473

6574
@staticmethod
6675
def _spec() -> Specification:
@@ -80,6 +89,7 @@ def _spec() -> Specification:
8089
type_names=["double", "vector<double>"],
8190
optional=False,
8291
document=r"""double or vector of double""",
92+
aliases=["ponderation"],
8393
),
8494
},
8595
map_output_pin_spec={
@@ -200,6 +210,18 @@ def weights(self) -> Input:
200210
"""
201211
return self._weights
202212

213+
def __getattr__(self, name):
214+
if name in ["ponderation"]:
215+
warn(
216+
DeprecationWarning(
217+
f'Operator add_constant: Input name "{name}" is deprecated in favor of "weights".'
218+
)
219+
)
220+
return self.weights
221+
raise AttributeError(
222+
f"'{self.__class__.__name__}' object has no attribute '{name}'."
223+
)
224+
203225

204226
class OutputsAddConstant(_Outputs):
205227
"""Intermediate class used to get outputs from

src/ansys/dpf/core/operators/math/add_constant_fc.py

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,23 @@ class add_constant_fc(Operator):
5353
>>> result_fields_container = op.outputs.fields_container()
5454
"""
5555

56-
def __init__(self, fields_container=None, weights=None, config=None, server=None):
56+
def __init__(
57+
self,
58+
fields_container=None,
59+
weights=None,
60+
config=None,
61+
server=None,
62+
ponderation=None,
63+
):
5764
super().__init__(name="add_constant_fc", config=config, server=server)
5865
self._inputs = InputsAddConstantFc(self)
5966
self._outputs = OutputsAddConstantFc(self)
6067
if fields_container is not None:
6168
self.inputs.fields_container.connect(fields_container)
6269
if weights is not None:
6370
self.inputs.weights.connect(weights)
71+
elif ponderation is not None:
72+
self.inputs.weights.connect(ponderation)
6473

6574
@staticmethod
6675
def _spec() -> Specification:
@@ -80,6 +89,7 @@ def _spec() -> Specification:
8089
type_names=["double", "vector<double>"],
8190
optional=False,
8291
document=r"""double or vector of double""",
92+
aliases=["ponderation"],
8393
),
8494
},
8595
map_output_pin_spec={
@@ -200,6 +210,18 @@ def weights(self) -> Input:
200210
"""
201211
return self._weights
202212

213+
def __getattr__(self, name):
214+
if name in ["ponderation"]:
215+
warn(
216+
DeprecationWarning(
217+
f'Operator add_constant_fc: Input name "{name}" is deprecated in favor of "weights".'
218+
)
219+
)
220+
return self.weights
221+
raise AttributeError(
222+
f"'{self.__class__.__name__}' object has no attribute '{name}'."
223+
)
224+
203225

204226
class OutputsAddConstantFc(_Outputs):
205227
"""Intermediate class used to get outputs from

src/ansys/dpf/core/operators/math/correlation.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ def __init__(
7777
absoluteValue=None,
7878
config=None,
7979
server=None,
80+
ponderation=None,
8081
):
8182
super().__init__(name="correlation", config=config, server=server)
8283
self._inputs = InputsCorrelation(self)
@@ -87,6 +88,8 @@ def __init__(
8788
self.inputs.fieldB.connect(fieldB)
8889
if weights is not None:
8990
self.inputs.weights.connect(weights)
91+
elif ponderation is not None:
92+
self.inputs.weights.connect(ponderation)
9093
if absoluteValue is not None:
9194
self.inputs.absoluteValue.connect(absoluteValue)
9295

@@ -116,6 +119,7 @@ def _spec() -> Specification:
116119
type_names=["field", "fields_container"],
117120
optional=False,
118121
document=r"""Field M, optional weighting for correlation computation.""",
122+
aliases=["ponderation"],
119123
),
120124
3: PinSpecification(
121125
name="absoluteValue",
@@ -298,6 +302,18 @@ def absoluteValue(self) -> Input:
298302
"""
299303
return self._absoluteValue
300304

305+
def __getattr__(self, name):
306+
if name in ["ponderation"]:
307+
warn(
308+
DeprecationWarning(
309+
f'Operator correlation: Input name "{name}" is deprecated in favor of "weights".'
310+
)
311+
)
312+
return self.weights
313+
raise AttributeError(
314+
f"'{self.__class__.__name__}' object has no attribute '{name}'."
315+
)
316+
301317

302318
class OutputsCorrelation(_Outputs):
303319
"""Intermediate class used to get outputs from

src/ansys/dpf/core/operators/math/mac.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ def __init__(
6969
weights=None,
7070
config=None,
7171
server=None,
72+
ponderation=None,
7273
):
7374
super().__init__(name="mac", config=config, server=server)
7475
self._inputs = InputsMac(self)
@@ -79,6 +80,8 @@ def __init__(
7980
self.inputs.fields_containerB.connect(fields_containerB)
8081
if weights is not None:
8182
self.inputs.weights.connect(weights)
83+
elif ponderation is not None:
84+
self.inputs.weights.connect(ponderation)
8285

8386
@staticmethod
8487
def _spec() -> Specification:
@@ -107,6 +110,7 @@ def _spec() -> Specification:
107110
type_names=["field"],
108111
optional=False,
109112
document=r"""Field M, optional weighting for MAC Matrix computation.""",
113+
aliases=["ponderation"],
110114
),
111115
},
112116
map_output_pin_spec={
@@ -252,6 +256,18 @@ def weights(self) -> Input:
252256
"""
253257
return self._weights
254258

259+
def __getattr__(self, name):
260+
if name in ["ponderation"]:
261+
warn(
262+
DeprecationWarning(
263+
f'Operator mac: Input name "{name}" is deprecated in favor of "weights".'
264+
)
265+
)
266+
return self.weights
267+
raise AttributeError(
268+
f"'{self.__class__.__name__}' object has no attribute '{name}'."
269+
)
270+
255271

256272
class OutputsMac(_Outputs):
257273
"""Intermediate class used to get outputs from

src/ansys/dpf/core/operators/math/scale.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ def __init__(
7474
algorithm=None,
7575
config=None,
7676
server=None,
77+
ponderation=None,
7778
):
7879
super().__init__(name="scale", config=config, server=server)
7980
self._inputs = InputsScale(self)
@@ -82,6 +83,8 @@ def __init__(
8283
self.inputs.field.connect(field)
8384
if weights is not None:
8485
self.inputs.weights.connect(weights)
86+
elif ponderation is not None:
87+
self.inputs.weights.connect(ponderation)
8588
if boolean is not None:
8689
self.inputs.boolean.connect(boolean)
8790
if algorithm is not None:
@@ -108,6 +111,7 @@ def _spec() -> Specification:
108111
type_names=["double", "field", "vector<double>"],
109112
optional=False,
110113
document=r"""Double/Field/Vector of doubles. When scoped on overall, same value(s) applied on all the data, when scoped elsewhere, corresponding values will be multiplied due to the scoping""",
114+
aliases=["ponderation"],
111115
),
112116
2: PinSpecification(
113117
name="boolean",
@@ -290,6 +294,18 @@ def algorithm(self) -> Input:
290294
"""
291295
return self._algorithm
292296

297+
def __getattr__(self, name):
298+
if name in ["ponderation"]:
299+
warn(
300+
DeprecationWarning(
301+
f'Operator scale: Input name "{name}" is deprecated in favor of "weights".'
302+
)
303+
)
304+
return self.weights
305+
raise AttributeError(
306+
f"'{self.__class__.__name__}' object has no attribute '{name}'."
307+
)
308+
293309

294310
class OutputsScale(_Outputs):
295311
"""Intermediate class used to get outputs from

src/ansys/dpf/core/operators/math/scale_fc.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ def __init__(
7474
algorithm=None,
7575
config=None,
7676
server=None,
77+
ponderation=None,
7778
):
7879
super().__init__(name="scale_fc", config=config, server=server)
7980
self._inputs = InputsScaleFc(self)
@@ -82,6 +83,8 @@ def __init__(
8283
self.inputs.fields_container.connect(fields_container)
8384
if weights is not None:
8485
self.inputs.weights.connect(weights)
86+
elif ponderation is not None:
87+
self.inputs.weights.connect(ponderation)
8588
if boolean is not None:
8689
self.inputs.boolean.connect(boolean)
8790
if algorithm is not None:
@@ -113,6 +116,7 @@ def _spec() -> Specification:
113116
],
114117
optional=False,
115118
document=r"""Double/Vector of doubles/Field/FieldsContainer. When scoped on overall, same value(s) applied on all the data, when scoped elsewhere, corresponding values will be multiplied due to the scoping""",
119+
aliases=["ponderation"],
116120
),
117121
2: PinSpecification(
118122
name="boolean",
@@ -295,6 +299,18 @@ def algorithm(self) -> Input:
295299
"""
296300
return self._algorithm
297301

302+
def __getattr__(self, name):
303+
if name in ["ponderation"]:
304+
warn(
305+
DeprecationWarning(
306+
f'Operator scale_fc: Input name "{name}" is deprecated in favor of "weights".'
307+
)
308+
)
309+
return self.weights
310+
raise AttributeError(
311+
f"'{self.__class__.__name__}' object has no attribute '{name}'."
312+
)
313+
298314

299315
class OutputsScaleFc(_Outputs):
300316
"""Intermediate class used to get outputs from

0 commit comments

Comments
 (0)