Skip to content

Commit bfc37f2

Browse files
authored
Merge branch 'main' into dependabot/pip/requirements/pytest-rerunfailures-16.1
2 parents 731790c + c125927 commit bfc37f2

File tree

61 files changed

+2385
-214
lines changed

Some content is hidden

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

61 files changed

+2385
-214
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -206,39 +206,3 @@ jobs:
206206
DOCSTRING: false
207207
standalone_suffix: ${{ matrix.version == '241' && '.sp01' || '' }}
208208
secrets: inherit
209-
210-
sync-main-with-master:
211-
name: "Sync main with master"
212-
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
213-
runs-on: ubuntu-latest
214-
steps:
215-
- name: "Install Git and clone project"
216-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
217-
with:
218-
token: ${{ secrets.MIGRATION_PAT }}
219-
fetch-depth: 0
220-
221-
- name: "Verify that main is the default branch"
222-
shell: bash
223-
run: |
224-
head_branch=$(git remote show origin | grep "HEAD branch:")
225-
main_branch=${head_branch#*: }
226-
227-
if [[ $main_branch != "main" ]]; then
228-
echo "The default branch is not 'main'. It is set to '$main_branch'."
229-
echo "Please set 'main' as the default branch in the repository settings."
230-
exit 1
231-
fi
232-
233-
- name: "Configure git username and email"
234-
shell: bash
235-
run: |
236-
git config --global user.name "${{ secrets.PYANSYS_CI_BOT_USERNAME }}"
237-
git config --global user.email "${{ secrets.PYANSYS_CI_BOT_EMAIL }}"
238-
239-
- name: "Sync main to master"
240-
shell: bash
241-
run: |
242-
git checkout master
243-
git reset --hard main
244-
git push

.github/workflows/docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ jobs:
7979
- name: "Build the wheel"
8080
shell: pwsh
8181
run: |
82-
tox -e build-wheel
82+
tox -e build-wheel -- "any"
8383
8484
- name: "Expose the wheel"
8585
shell: bash

doc/source/_static/dpf_operators.html

Lines changed: 187 additions & 131 deletions
Large diffs are not rendered by default.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ requires = ["setuptools>=61.0.0", "wheel"]
55
[project]
66
# Check https://setuptools.pypa.io/en/stable/userguide/quickstart.html for all available sections
77
name = "ansys-dpf-core"
8-
version = "0.14.2.dev0"
8+
version = "0.14.3.dev0"
99
description = "Data Processing Framework - Python Core "
1010
readme = "README.md"
1111
requires-python = ">=3.9, <4"

src/ansys/dpf/core/documentation/generate_operators_doc.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -473,9 +473,7 @@ def run_with_args(): # pragma: nocover
473473
parser.add_argument(
474474
"--ansys_path", default=None, help="Path to Ansys DPF Server installation directory"
475475
)
476-
parser.add_argument(
477-
"--output_path", default=None, help="Path to output directory", required=True
478-
)
476+
parser.add_argument("--output_path", default=".", help="Path to output directory")
479477
parser.add_argument("--include_private", action="store_true", help="Include private operators")
480478
parser.add_argument(
481479
"--include_composites", action="store_true", help="Include Composites operators"

src/ansys/dpf/core/operators/compression/quantization.py

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,21 @@
1616

1717

1818
class quantization(Operator):
19-
r"""Applies scaling to precision to all the values from field input, then
20-
rounding to the unit.
19+
r"""Scales a field to a given precision threshold, then rounds all the
20+
values to the unit.
2121
2222
2323
Parameters
2424
----------
2525
input_field: Field
26-
Input field
27-
threshold: float
28-
Threshold (precision) desired.
26+
Field to quantize.
27+
threshold: float or Field
28+
Precision threshold desired.
29+
Case double : the threshold is applied on all the input field.
30+
Case field with one value : the threshold is applied on all the input field.
31+
Case field with "numComp" values : each threhsold is applied to the corresponding component of the input field.
32+
Case field with the same number of values than the input field : quantization is performed component-wise.
33+
2934
3035
Returns
3136
-------
@@ -66,8 +71,8 @@ def __init__(self, input_field=None, threshold=None, config=None, server=None):
6671

6772
@staticmethod
6873
def _spec() -> Specification:
69-
description = r"""Applies scaling to precision to all the values from field input, then
70-
rounding to the unit.
74+
description = r"""Scales a field to a given precision threshold, then rounds all the
75+
values to the unit.
7176
"""
7277
spec = Specification(
7378
description=description,
@@ -76,13 +81,18 @@ def _spec() -> Specification:
7681
name="input_field",
7782
type_names=["field"],
7883
optional=False,
79-
document=r"""Input field""",
84+
document=r"""Field to quantize.""",
8085
),
8186
1: PinSpecification(
8287
name="threshold",
83-
type_names=["double"],
88+
type_names=["double", "field"],
8489
optional=False,
85-
document=r"""Threshold (precision) desired.""",
90+
document=r"""Precision threshold desired.
91+
Case double : the threshold is applied on all the input field.
92+
Case field with one value : the threshold is applied on all the input field.
93+
Case field with "numComp" values : each threhsold is applied to the corresponding component of the input field.
94+
Case field with the same number of values than the input field : quantization is performed component-wise.
95+
""",
8696
),
8797
},
8898
map_output_pin_spec={
@@ -165,7 +175,7 @@ def __init__(self, op: Operator):
165175
def input_field(self) -> Input:
166176
r"""Allows to connect input_field input to the operator.
167177
168-
Input field
178+
Field to quantize.
169179
170180
Returns
171181
-------
@@ -186,7 +196,12 @@ def input_field(self) -> Input:
186196
def threshold(self) -> Input:
187197
r"""Allows to connect threshold input to the operator.
188198
189-
Threshold (precision) desired.
199+
Precision threshold desired.
200+
Case double : the threshold is applied on all the input field.
201+
Case field with one value : the threshold is applied on all the input field.
202+
Case field with "numComp" values : each threhsold is applied to the corresponding component of the input field.
203+
Case field with the same number of values than the input field : quantization is performed component-wise.
204+
190205
191206
Returns
192207
-------

src/ansys/dpf/core/operators/compression/quantization_fc.py

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,25 @@
1616

1717

1818
class quantization_fc(Operator):
19-
r"""Applies scaling to precision to all the values from fields container
20-
input, then rounding to the unit.
19+
r"""Scales all the fields of a fields container to a given precision
20+
threshold, then rounds all the values to the unit.
2121
2222
2323
Parameters
2424
----------
2525
input_fc: FieldsContainer
26-
Input fields container
26+
Fields container to be quantized.
2727
threshold: float or Field or FieldsContainer
28-
Threshold (precision) desired.
28+
Precision threshold desired.
29+
Case double : the threshold is applied on all the fields of the input fields container.
30+
Case field with one, numComp or input size values : the threshold is used for each field of the input fields container.
31+
Case fields container : the corresponding threshold field is found by matching label.
32+
2933
3034
Returns
3135
-------
3236
output_fc: FieldsContainer
33-
Scaled and rounded fields container
37+
Quantized fields container.
3438
3539
Examples
3640
--------
@@ -66,8 +70,8 @@ def __init__(self, input_fc=None, threshold=None, config=None, server=None):
6670

6771
@staticmethod
6872
def _spec() -> Specification:
69-
description = r"""Applies scaling to precision to all the values from fields container
70-
input, then rounding to the unit.
73+
description = r"""Scales all the fields of a fields container to a given precision
74+
threshold, then rounds all the values to the unit.
7175
"""
7276
spec = Specification(
7377
description=description,
@@ -76,21 +80,25 @@ def _spec() -> Specification:
7680
name="input_fc",
7781
type_names=["fields_container"],
7882
optional=False,
79-
document=r"""Input fields container""",
83+
document=r"""Fields container to be quantized.""",
8084
),
8185
1: PinSpecification(
8286
name="threshold",
8387
type_names=["double", "field", "fields_container"],
8488
optional=False,
85-
document=r"""Threshold (precision) desired.""",
89+
document=r"""Precision threshold desired.
90+
Case double : the threshold is applied on all the fields of the input fields container.
91+
Case field with one, numComp or input size values : the threshold is used for each field of the input fields container.
92+
Case fields container : the corresponding threshold field is found by matching label.
93+
""",
8694
),
8795
},
8896
map_output_pin_spec={
8997
0: PinSpecification(
9098
name="output_fc",
9199
type_names=["fields_container"],
92100
optional=False,
93-
document=r"""Scaled and rounded fields container""",
101+
document=r"""Quantized fields container.""",
94102
),
95103
},
96104
)
@@ -165,7 +173,7 @@ def __init__(self, op: Operator):
165173
def input_fc(self) -> Input:
166174
r"""Allows to connect input_fc input to the operator.
167175
168-
Input fields container
176+
Fields container to be quantized.
169177
170178
Returns
171179
-------
@@ -186,7 +194,11 @@ def input_fc(self) -> Input:
186194
def threshold(self) -> Input:
187195
r"""Allows to connect threshold input to the operator.
188196
189-
Threshold (precision) desired.
197+
Precision threshold desired.
198+
Case double : the threshold is applied on all the fields of the input fields container.
199+
Case field with one, numComp or input size values : the threshold is used for each field of the input fields container.
200+
Case fields container : the corresponding threshold field is found by matching label.
201+
190202
191203
Returns
192204
-------
@@ -225,7 +237,7 @@ def __init__(self, op: Operator):
225237
def output_fc(self) -> Output:
226238
r"""Allows to get output_fc output of the operator
227239
228-
Scaled and rounded fields container
240+
Quantized fields container.
229241
230242
Returns
231243
-------

src/ansys/dpf/core/operators/metadata/time_freq_support_get_attribute.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,16 @@ class time_freq_support_get_attribute(Operator):
2525
----------
2626
time_freq_support: TimeFreqSupport
2727
property_name: str
28-
Supported property names are: "time_freqs", "imaginary_freqs", "frequency_tolerance", "set_id", "cummulative_index", "sets_freqs".
29-
property_identifier: int, optional
30-
Additional pin for properties "set_id" and "cummulative_index": the step id, for "sets_freqs": the sets scoping.
28+
Supported property names are: "time_freqs", "imaginary_freqs", "frequency_tolerance", "set_id", "cummulative_index", "sets_freqs", "step_id_from_harmonic_index".
29+
property_identifier: int or Scoping, optional
30+
Additional pin for properties "set_id" and "cummulative_index": the step id, for "sets_freqs": the sets scoping, for "step_id_from_harmonic_index" : the harmonic index.
3131
property_identifier_2: int, optional
3232
Additional pin for properties "set_id" and "cummulative_index": the substep id (if none, last substep is considered).
3333
3434
Returns
3535
-------
3636
property: float or Field or Scoping
37-
Returns a double for property: "frequency_tolerance", a single-value Scoping for properties for "set_id" and "cummulative_index", and a Field otherwise.
37+
Returns a double for property: "frequency_tolerance", a single-value Scoping for properties for "set_id" and "cummulative_index", an int for "step_id_from_harmonic_index" and a Field otherwise.
3838
3939
Examples
4040
--------
@@ -106,13 +106,13 @@ def _spec() -> Specification:
106106
name="property_name",
107107
type_names=["string"],
108108
optional=False,
109-
document=r"""Supported property names are: "time_freqs", "imaginary_freqs", "frequency_tolerance", "set_id", "cummulative_index", "sets_freqs".""",
109+
document=r"""Supported property names are: "time_freqs", "imaginary_freqs", "frequency_tolerance", "set_id", "cummulative_index", "sets_freqs", "step_id_from_harmonic_index".""",
110110
),
111111
2: PinSpecification(
112112
name="property_identifier",
113-
type_names=["int32"],
113+
type_names=["int32", "scoping"],
114114
optional=True,
115-
document=r"""Additional pin for properties "set_id" and "cummulative_index": the step id, for "sets_freqs": the sets scoping.""",
115+
document=r"""Additional pin for properties "set_id" and "cummulative_index": the step id, for "sets_freqs": the sets scoping, for "step_id_from_harmonic_index" : the harmonic index.""",
116116
),
117117
3: PinSpecification(
118118
name="property_identifier_2",
@@ -126,7 +126,7 @@ def _spec() -> Specification:
126126
name="property",
127127
type_names=["double", "field", "scoping"],
128128
optional=False,
129-
document=r"""Returns a double for property: "frequency_tolerance", a single-value Scoping for properties for "set_id" and "cummulative_index", and a Field otherwise.""",
129+
document=r"""Returns a double for property: "frequency_tolerance", a single-value Scoping for properties for "set_id" and "cummulative_index", an int for "step_id_from_harmonic_index" and a Field otherwise.""",
130130
),
131131
},
132132
)
@@ -238,7 +238,7 @@ def time_freq_support(self) -> Input:
238238
def property_name(self) -> Input:
239239
r"""Allows to connect property_name input to the operator.
240240
241-
Supported property names are: "time_freqs", "imaginary_freqs", "frequency_tolerance", "set_id", "cummulative_index", "sets_freqs".
241+
Supported property names are: "time_freqs", "imaginary_freqs", "frequency_tolerance", "set_id", "cummulative_index", "sets_freqs", "step_id_from_harmonic_index".
242242
243243
Returns
244244
-------
@@ -259,7 +259,7 @@ def property_name(self) -> Input:
259259
def property_identifier(self) -> Input:
260260
r"""Allows to connect property_identifier input to the operator.
261261
262-
Additional pin for properties "set_id" and "cummulative_index": the step id, for "sets_freqs": the sets scoping.
262+
Additional pin for properties "set_id" and "cummulative_index": the step id, for "sets_freqs": the sets scoping, for "step_id_from_harmonic_index" : the harmonic index.
263263
264264
Returns
265265
-------

0 commit comments

Comments
 (0)