Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions doc/source/_static/dpf_operators.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/ansys/dpf/core/operators/logic/identical_fc.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def __init__(
config=None,
server=None,
):
super().__init__(name="AreFieldsIdentical_fc", config=config, server=server)
super().__init__(name="compare::fields_container", config=config, server=server)
self._inputs = InputsIdenticalFc(self)
self._outputs = OutputsIdenticalFc(self)
if fields_containerA is not None:
Expand Down Expand Up @@ -160,7 +160,7 @@ def default_config(server=None):
Server with channel connected to the remote or local instance. When
``None``, attempts to use the global server.
"""
return Operator.default_config(name="AreFieldsIdentical_fc", server=server)
return Operator.default_config(name="compare::fields_container", server=server)

@property
def inputs(self):
Expand Down
4 changes: 2 additions & 2 deletions src/ansys/dpf/core/operators/logic/identical_fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def __init__(
config=None,
server=None,
):
super().__init__(name="AreFieldsIdentical", config=config, server=server)
super().__init__(name="compare::field", config=config, server=server)
self._inputs = InputsIdenticalFields(self)
self._outputs = OutputsIdenticalFields(self)
if fieldA is not None:
Expand Down Expand Up @@ -162,7 +162,7 @@ def default_config(server=None):
Server with channel connected to the remote or local instance. When
``None``, attempts to use the global server.
"""
return Operator.default_config(name="AreFieldsIdentical", server=server)
return Operator.default_config(name="compare::field", server=server)

@property
def inputs(self):
Expand Down
49 changes: 31 additions & 18 deletions src/ansys/dpf/core/operators/math/accumulate.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class accumulate(Operator):
fieldA : Field or FieldsContainer
Field or fields container with only one field
is expected
ponderation : Field, optional
weights : Field, optional
Field containing weights, one weight per
entity
time_scoping : Scoping, optional
Expand All @@ -42,15 +42,15 @@ class accumulate(Operator):
>>> # Make input connections
>>> my_fieldA = dpf.Field()
>>> op.inputs.fieldA.connect(my_fieldA)
>>> my_ponderation = dpf.Field()
>>> op.inputs.ponderation.connect(my_ponderation)
>>> my_weights = dpf.Field()
>>> op.inputs.weights.connect(my_weights)
>>> my_time_scoping = dpf.Scoping()
>>> op.inputs.time_scoping.connect(my_time_scoping)

>>> # Instantiate operator and connect inputs in one line
>>> op = dpf.operators.math.accumulate(
... fieldA=my_fieldA,
... ponderation=my_ponderation,
... weights=my_weights,
... time_scoping=my_time_scoping,
... )

Expand All @@ -59,15 +59,15 @@ class accumulate(Operator):
"""

def __init__(
self, fieldA=None, ponderation=None, time_scoping=None, config=None, server=None
self, fieldA=None, weights=None, time_scoping=None, config=None, server=None
):
super().__init__(name="accumulate", config=config, server=server)
self._inputs = InputsAccumulate(self)
self._outputs = OutputsAccumulate(self)
if fieldA is not None:
self.inputs.fieldA.connect(fieldA)
if ponderation is not None:
self.inputs.ponderation.connect(ponderation)
if weights is not None:
self.inputs.weights.connect(weights)
if time_scoping is not None:
self.inputs.time_scoping.connect(time_scoping)

Expand All @@ -86,11 +86,12 @@ def _spec():
is expected""",
),
1: PinSpecification(
name="ponderation",
name="weights",
type_names=["field"],
optional=True,
document="""Field containing weights, one weight per
entity""",
aliases=["ponderation"],
),
2: PinSpecification(
name="time_scoping",
Expand Down Expand Up @@ -158,8 +159,8 @@ class InputsAccumulate(_Inputs):
>>> op = dpf.operators.math.accumulate()
>>> my_fieldA = dpf.Field()
>>> op.inputs.fieldA.connect(my_fieldA)
>>> my_ponderation = dpf.Field()
>>> op.inputs.ponderation.connect(my_ponderation)
>>> my_weights = dpf.Field()
>>> op.inputs.weights.connect(my_weights)
>>> my_time_scoping = dpf.Scoping()
>>> op.inputs.time_scoping.connect(my_time_scoping)
"""
Expand All @@ -168,8 +169,8 @@ def __init__(self, op: Operator):
super().__init__(accumulate._spec().inputs, op)
self._fieldA = Input(accumulate._spec().input_pin(0), 0, op, -1)
self._inputs.append(self._fieldA)
self._ponderation = Input(accumulate._spec().input_pin(1), 1, op, -1)
self._inputs.append(self._ponderation)
self._weights = Input(accumulate._spec().input_pin(1), 1, op, -1)
self._inputs.append(self._weights)
self._time_scoping = Input(accumulate._spec().input_pin(2), 2, op, -1)
self._inputs.append(self._time_scoping)

Expand All @@ -195,25 +196,25 @@ def fieldA(self):
return self._fieldA

@property
def ponderation(self):
"""Allows to connect ponderation input to the operator.
def weights(self):
"""Allows to connect weights input to the operator.

Field containing weights, one weight per
entity

Parameters
----------
my_ponderation : Field
my_weights : Field

Examples
--------
>>> from ansys.dpf import core as dpf
>>> op = dpf.operators.math.accumulate()
>>> op.inputs.ponderation.connect(my_ponderation)
>>> op.inputs.weights.connect(my_weights)
>>> # or
>>> op.inputs.ponderation(my_ponderation)
>>> op.inputs.weights(my_weights)
"""
return self._ponderation
return self._weights

@property
def time_scoping(self):
Expand All @@ -235,6 +236,18 @@ def time_scoping(self):
"""
return self._time_scoping

def __getattr__(self, name):
if name in ["ponderation"]:
warn(
DeprecationWarning(
f'Operator accumulate: Input name "{name}" is deprecated in favor of "weights".'
)
)
return self.weights
raise AttributeError(
f"'{self.__class__.__name__}' object has no attribute '{name}'."
)


class OutputsAccumulate(_Outputs):
"""Intermediate class used to get outputs from
Expand Down
49 changes: 31 additions & 18 deletions src/ansys/dpf/core/operators/math/accumulate_fc.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class accumulate_fc(Operator):
fields_container : FieldsContainer
Field or fields container with only one field
is expected
ponderation : Field, optional
weights : Field, optional
Field containing weights, one weight per
entity
time_scoping : Scoping, optional
Expand All @@ -42,15 +42,15 @@ class accumulate_fc(Operator):
>>> # Make input connections
>>> my_fields_container = dpf.FieldsContainer()
>>> op.inputs.fields_container.connect(my_fields_container)
>>> my_ponderation = dpf.Field()
>>> op.inputs.ponderation.connect(my_ponderation)
>>> my_weights = dpf.Field()
>>> op.inputs.weights.connect(my_weights)
>>> my_time_scoping = dpf.Scoping()
>>> op.inputs.time_scoping.connect(my_time_scoping)

>>> # Instantiate operator and connect inputs in one line
>>> op = dpf.operators.math.accumulate_fc(
... fields_container=my_fields_container,
... ponderation=my_ponderation,
... weights=my_weights,
... time_scoping=my_time_scoping,
... )

Expand All @@ -61,7 +61,7 @@ class accumulate_fc(Operator):
def __init__(
self,
fields_container=None,
ponderation=None,
weights=None,
time_scoping=None,
config=None,
server=None,
Expand All @@ -71,8 +71,8 @@ def __init__(
self._outputs = OutputsAccumulateFc(self)
if fields_container is not None:
self.inputs.fields_container.connect(fields_container)
if ponderation is not None:
self.inputs.ponderation.connect(ponderation)
if weights is not None:
self.inputs.weights.connect(weights)
if time_scoping is not None:
self.inputs.time_scoping.connect(time_scoping)

Expand All @@ -91,11 +91,12 @@ def _spec():
is expected""",
),
1: PinSpecification(
name="ponderation",
name="weights",
type_names=["field"],
optional=True,
document="""Field containing weights, one weight per
entity""",
aliases=["ponderation"],
),
2: PinSpecification(
name="time_scoping",
Expand Down Expand Up @@ -163,8 +164,8 @@ class InputsAccumulateFc(_Inputs):
>>> op = dpf.operators.math.accumulate_fc()
>>> my_fields_container = dpf.FieldsContainer()
>>> op.inputs.fields_container.connect(my_fields_container)
>>> my_ponderation = dpf.Field()
>>> op.inputs.ponderation.connect(my_ponderation)
>>> my_weights = dpf.Field()
>>> op.inputs.weights.connect(my_weights)
>>> my_time_scoping = dpf.Scoping()
>>> op.inputs.time_scoping.connect(my_time_scoping)
"""
Expand All @@ -173,8 +174,8 @@ def __init__(self, op: Operator):
super().__init__(accumulate_fc._spec().inputs, op)
self._fields_container = Input(accumulate_fc._spec().input_pin(0), 0, op, -1)
self._inputs.append(self._fields_container)
self._ponderation = Input(accumulate_fc._spec().input_pin(1), 1, op, -1)
self._inputs.append(self._ponderation)
self._weights = Input(accumulate_fc._spec().input_pin(1), 1, op, -1)
self._inputs.append(self._weights)
self._time_scoping = Input(accumulate_fc._spec().input_pin(2), 2, op, -1)
self._inputs.append(self._time_scoping)

Expand All @@ -200,25 +201,25 @@ def fields_container(self):
return self._fields_container

@property
def ponderation(self):
"""Allows to connect ponderation input to the operator.
def weights(self):
"""Allows to connect weights input to the operator.

Field containing weights, one weight per
entity

Parameters
----------
my_ponderation : Field
my_weights : Field

Examples
--------
>>> from ansys.dpf import core as dpf
>>> op = dpf.operators.math.accumulate_fc()
>>> op.inputs.ponderation.connect(my_ponderation)
>>> op.inputs.weights.connect(my_weights)
>>> # or
>>> op.inputs.ponderation(my_ponderation)
>>> op.inputs.weights(my_weights)
"""
return self._ponderation
return self._weights

@property
def time_scoping(self):
Expand All @@ -240,6 +241,18 @@ def time_scoping(self):
"""
return self._time_scoping

def __getattr__(self, name):
if name in ["ponderation"]:
warn(
DeprecationWarning(
f'Operator accumulate_fc: Input name "{name}" is deprecated in favor of "weights".'
)
)
return self.weights
raise AttributeError(
f"'{self.__class__.__name__}' object has no attribute '{name}'."
)


class OutputsAccumulateFc(_Outputs):
"""Intermediate class used to get outputs from
Expand Down
Loading
Loading