Skip to content

Commit 5f28773

Browse files
committed
Merge branch 'master' into rcanton/test_get_header
2 parents 47d46db + 2f9761e commit 5f28773

File tree

4 files changed

+44
-11
lines changed

4 files changed

+44
-11
lines changed

.github/workflows/ci.yml

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: CI
22

33
on:
44
pull_request:
5-
types: [opened, synchronize, reopened, ready_for_review]
5+
types: [opened, synchronize, reopened, ready_for_review, closed]
66
branches-ignore:
77
- '*no-ci*'
88
push:
@@ -31,6 +31,7 @@ env:
3131
jobs:
3232
debug:
3333
runs-on: ubuntu-latest
34+
if: github.event.action != 'closed'
3435
steps:
3536
- name: Show the Github context for the triggered event
3637
run: echo "$GITHUB_CONTEXT"
@@ -39,6 +40,7 @@ jobs:
3940

4041
pick_server_suffix:
4142
runs-on: ubuntu-latest
43+
if: github.event.action != 'closed'
4244
outputs:
4345
suffix: ${{ steps.step1.outputs.suffix }}
4446
steps:
@@ -69,6 +71,7 @@ jobs:
6971
style:
7072
name: "Style Check"
7173
runs-on: ubuntu-latest
74+
if: github.event.action != 'closed'
7275
steps:
7376
- uses: ansys/actions/code-style@v8
7477
with:
@@ -77,6 +80,7 @@ jobs:
7780
build_linux1:
7881
name: "Build linux1 wheel"
7982
runs-on: ubuntu-latest
83+
if: github.event.action != 'closed'
8084
steps:
8185
- uses: actions/checkout@v4
8286

@@ -107,6 +111,7 @@ jobs:
107111
matrix:
108112
test-any: ['false', 'true']
109113
uses: ./.github/workflows/tests.yml
114+
if: github.event.action != 'closed'
110115
needs: pick_server_suffix
111116
with:
112117
ANSYS_VERSION: ${{ inputs.ansys_version || vars.ANSYS_VERSION_DEFAULT }}
@@ -121,6 +126,7 @@ jobs:
121126
docker_tests:
122127
name: "Build and Test on Docker"
123128
uses: ./.github/workflows/test_docker.yml
129+
if: github.event.action != 'closed'
124130
needs: pick_server_suffix
125131
with:
126132
ANSYS_VERSION: ${{ inputs.ansys_version || vars.ANSYS_VERSION_DEFAULT }}
@@ -130,6 +136,7 @@ jobs:
130136
docker_examples:
131137
name: "Run examples on Docker"
132138
uses: ./.github/workflows/examples_docker.yml
139+
if: github.event.action != 'closed'
133140
needs: pick_server_suffix
134141
with:
135142
ANSYS_VERSION: ${{ inputs.ansys_version || vars.ANSYS_VERSION_DEFAULT }}
@@ -138,7 +145,7 @@ jobs:
138145
secrets: inherit
139146

140147
docs:
141-
if: startsWith(github.head_ref, 'master') || github.event.action == 'ready_for_review' || !github.event.pull_request.draft
148+
if: github.event.action != 'closed' && (startsWith(github.head_ref, 'master') || github.event.action == 'ready_for_review' || !github.event.pull_request.draft)
142149
uses: ./.github/workflows/docs.yml
143150
needs: pick_server_suffix
144151
with:
@@ -148,9 +155,25 @@ jobs:
148155
python_version: "3.11"
149156
secrets: inherit
150157

158+
doc-deploy-pr:
159+
name: "Deploy PR documentation"
160+
runs-on: ubuntu-latest
161+
needs: docs
162+
if: always() && (needs.docs.result == 'success' || needs.docs.result == 'skipped')
163+
steps:
164+
- uses: ansys/actions/doc-deploy-pr@v10
165+
with:
166+
cname: ${{ env.DOCUMENTATION_CNAME }}
167+
token: ${{ secrets.GITHUB_TOKEN }}
168+
doc-artifact-name: HTML-doc-ansys-dpf-core.zip
169+
decompress-artifact: true
170+
bot-user: ${{ secrets.PYANSYS_CI_BOT_USERNAME }}
171+
bot-email: ${{ secrets.PYANSYS_CI_BOT_EMAIL }}
172+
maximum-pr-doc-deployments: 10
173+
151174
upload-development-docs:
152175
runs-on: ubuntu-latest
153-
if: ${{ github.ref == 'refs/heads/master' && github.event_name == 'push' }}
176+
if: ${{ github.event.action != 'closed' && (github.ref == 'refs/heads/master' && github.event_name == 'push') }}
154177
needs: [docs]
155178
steps:
156179
- name: "Upload development documentation"
@@ -164,7 +187,7 @@ jobs:
164187
bot-email: ${{ secrets.PYANSYS_CI_BOT_EMAIL }}
165188

166189
examples:
167-
if: startsWith(github.head_ref, 'master') || github.event.action == 'ready_for_review' || !github.event.pull_request.draft
190+
if: github.event.action != 'closed' && (startsWith(github.head_ref, 'master') || github.event.action == 'ready_for_review' || !github.event.pull_request.draft)
168191
uses: ./.github/workflows/examples.yml
169192
needs: pick_server_suffix
170193
with:
@@ -175,7 +198,7 @@ jobs:
175198

176199
pydpf-post:
177200
name: "PyDPF-Post"
178-
if: startsWith(github.head_ref, 'master') || github.event.action == 'ready_for_review' || !github.event.pull_request.draft
201+
if: github.event.action != 'closed' && (startsWith(github.head_ref, 'master') || github.event.action == 'ready_for_review' || !github.event.pull_request.draft)
179202
uses: ./.github/workflows/pydpf-post.yml
180203
needs: pick_server_suffix
181204
with:
@@ -187,7 +210,7 @@ jobs:
187210

188211
tests-retro:
189212
name: "Test DPF ${{ matrix.dpf.version }} compatibility"
190-
if: startsWith(github.head_ref, 'master') || github.event.action == 'ready_for_review' || !github.event.pull_request.draft
213+
if: github.event.action != 'closed' && (startsWith(github.head_ref, 'master') || github.event.action == 'ready_for_review' || !github.event.pull_request.draft)
191214
strategy:
192215
fail-fast: false
193216
matrix:

src/ansys/dpf/core/dpf_operator.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -816,7 +816,9 @@ def eval(self, pin=None):
816816
if output._pin == pin:
817817
return output()
818818

819-
def _find_outputs_corresponding_pins(self, type_names, inpt, pin, corresponding_pins):
819+
def _find_outputs_corresponding_pins(
820+
self, type_names, inpt, pin, corresponding_pins, input_type_name
821+
):
820822
from ansys.dpf.core.results import Result
821823

822824
for python_name in type_names:
@@ -827,7 +829,7 @@ def _find_outputs_corresponding_pins(self, type_names, inpt, pin, corresponding_
827829
python_name = "bool"
828830

829831
# Type match
830-
if type(inpt).__name__ == python_name:
832+
if input_type_name == python_name:
831833
corresponding_pins.append(pin)
832834
# if the inpt has multiple potential outputs, find which ones can match
833835
elif isinstance(inpt, (_Outputs, Operator, Result)):

src/ansys/dpf/core/inputs.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,8 @@ def connect(self, inpt):
106106
inpt = inpt.value
107107

108108
input_type_name = type(inpt).__name__
109+
if input_type_name == "list":
110+
input_type_name = f"list[{type(inpt[0]).__name__}]"
109111
if not (input_type_name in self._python_expected_types or ["Outputs", "Output", "Any"]):
110112
for types in self._python_expected_types:
111113
print(types, end=" ")
@@ -114,7 +116,7 @@ def connect(self, inpt):
114116

115117
corresponding_pins = []
116118
self._operator()._find_outputs_corresponding_pins(
117-
self._python_expected_types, inpt, self._pin, corresponding_pins
119+
self._python_expected_types, inpt, self._pin, corresponding_pins, input_type_name
118120
)
119121
if len(corresponding_pins) > 1:
120122
err_str = "Pin connection is ambiguous, specify the input to connect to with:\n"
@@ -132,7 +134,7 @@ def connect(self, inpt):
132134

133135
if len(corresponding_pins) == 0:
134136
err_str = (
135-
f"The input operator for the {self._spec.name} pin must be "
137+
f"The input for the {self._spec.name} pin is of type {input_type_name} but must be "
136138
"one of the following types:\n"
137139
)
138140
err_str += "\n".join([f"- {py_type}" for py_type in self._python_expected_types])
@@ -260,12 +262,15 @@ def connect(self, inpt):
260262
inpt = inpt.value
261263

262264
input_type_name = type(inpt).__name__
265+
if input_type_name == "list":
266+
input_type_name = f"list[{type(inpt[0]).__name__}]"
263267
for input_pin in self._inputs:
264268
self._operator()._find_outputs_corresponding_pins(
265269
input_pin._python_expected_types,
266270
inpt,
267271
input_pin._pin,
268272
corresponding_pins,
273+
input_type_name,
269274
)
270275
if len(corresponding_pins) > 1:
271276
err_str = "Pin connection is ambiguous, specify the input to connect to with:\n"

src/ansys/dpf/core/mapping_types.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,5 +71,8 @@ def __missing__(self, key):
7171
map_types_to_python = _smart_dict_snake()
7272
for k, v in map_types_to_cpp.items():
7373
map_types_to_python[v] = k
74-
map_types_to_python["vector<double>"] = "list"
74+
map_types_to_python["vector<bool>"] = "list[bool]"
75+
map_types_to_python["vector<int32>"] = "list[int]"
76+
map_types_to_python["vector<double>"] = "list[float]"
77+
map_types_to_python["vector<string>"] = "list[str]"
7578
map_types_to_python["b"] = "bool"

0 commit comments

Comments
 (0)