Skip to content

Commit 048cbee

Browse files
authored
Merge branch 'master' into dependabot/pip/requirements/ansys-sphinx-theme-1.1.2
2 parents 93fed84 + 31636f1 commit 048cbee

File tree

8 files changed

+83
-26
lines changed

8 files changed

+83
-26
lines changed

.github/workflows/test_docker.yml

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ jobs:
115115
echo "RERUNS=--reruns 2 --reruns-delay 1" >> $GITHUB_ENV
116116
117117
- name: "Test API"
118-
uses: nick-fields/retry@v2
118+
uses: nick-fields/retry@v3
119119
with:
120120
timeout_minutes: 10
121121
max_attempts: 2
@@ -124,7 +124,7 @@ jobs:
124124
pytest $DEBUG $COVERAGE $RERUNS --junitxml=tests/junit/test-results.xml tests/.
125125
126126
- name: "Test API test_launcher"
127-
uses: nick-fields/retry@v2
127+
uses: nick-fields/retry@v3
128128
with:
129129
timeout_minutes: 2
130130
max_attempts: 2
@@ -133,7 +133,7 @@ jobs:
133133
pytest $DEBUG $COVERAGE $RERUNS --junitxml=tests/junit/test-results2.xml test_launcher/.
134134
135135
- name: "Test API test_server"
136-
uses: nick-fields/retry@v2
136+
uses: nick-fields/retry@v3
137137
with:
138138
timeout_minutes: 5
139139
max_attempts: 2
@@ -142,7 +142,7 @@ jobs:
142142
pytest $DEBUG $COVERAGE $RERUNS --junitxml=tests/junit/test-results3.xml test_server/.
143143
144144
- name: "Test API test_local_server"
145-
uses: nick-fields/retry@v2
145+
uses: nick-fields/retry@v3
146146
with:
147147
timeout_minutes: 2
148148
max_attempts: 2
@@ -151,7 +151,7 @@ jobs:
151151
pytest $DEBUG $COVERAGE $RERUNS --junitxml=tests/junit/test-results4.xml test_local_server/.
152152
153153
- name: "Test API test_multi_server"
154-
uses: nick-fields/retry@v2
154+
uses: nick-fields/retry@v3
155155
with:
156156
timeout_minutes: 5
157157
max_attempts: 2
@@ -160,7 +160,7 @@ jobs:
160160
pytest $DEBUG $COVERAGE $RERUNS --junitxml=tests/junit/test-results5.xml test_multi_server/.
161161
162162
- name: "Test API test_remote_workflow"
163-
uses: nick-fields/retry@v2
163+
uses: nick-fields/retry@v3
164164
with:
165165
timeout_minutes: 2
166166
max_attempts: 3
@@ -169,7 +169,7 @@ jobs:
169169
pytest $DEBUG $COVERAGE $RERUNS --junitxml=tests/junit/test-results6.xml test_remote_workflow/.
170170
171171
- name: "Test API test_remote_operator"
172-
uses: nick-fields/retry@v2
172+
uses: nick-fields/retry@v3
173173
with:
174174
timeout_minutes: 2
175175
max_attempts: 2
@@ -178,7 +178,7 @@ jobs:
178178
pytest $DEBUG $COVERAGE $RERUNS --junitxml=tests/junit/test-results7.xml test_remote_operator/.
179179
180180
- name: "Test API test_workflow"
181-
uses: nick-fields/retry@v2
181+
uses: nick-fields/retry@v3
182182
with:
183183
timeout_minutes: 3
184184
max_attempts: 3
@@ -187,7 +187,7 @@ jobs:
187187
pytest $DEBUG $COVERAGE $RERUNS --junitxml=tests/junit/test-results8.xml test_workflow/.
188188
189189
- name: "Test API test_service"
190-
uses: nick-fields/retry@v2
190+
uses: nick-fields/retry@v3
191191
with:
192192
timeout_minutes: 3
193193
max_attempts: 2
@@ -196,7 +196,7 @@ jobs:
196196
pytest $DEBUG $COVERAGE $RERUNS --junitxml=tests/junit/test-results9.xml test_service/.
197197
198198
- name: "Test Operators"
199-
uses: nick-fields/retry@v2
199+
uses: nick-fields/retry@v3
200200
with:
201201
timeout_minutes: 3
202202
max_attempts: 2
@@ -221,4 +221,8 @@ jobs:
221221
timeout-minutes: 5
222222

223223
- name: "Upload coverage to Codecov"
224-
uses: codecov/codecov-action@v3
224+
uses: codecov/codecov-action@v4
225+
with:
226+
token: ${{ secrets.CODECOV_TOKEN }} # required
227+
name: ${{ env.PACKAGE_NAME }}_${{ matrix.python-version }}_${{ matrix.os }}_pytest_${{ inputs.ANSYS_VERSION }}_docker.xml
228+
flags: docker,${{ inputs.ANSYS_VERSION }},${{ matrix.os }},${{ matrix.python-version }}

.github/workflows/tests.yml

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ jobs:
232232
uses: ansys/pydpf-actions/[email protected]
233233

234234
- name: "Test API test_launcher"
235-
uses: nick-fields/retry@v2
235+
uses: nick-fields/retry@v3
236236
with:
237237
timeout_minutes: 2
238238
max_attempts: 2
@@ -244,7 +244,7 @@ jobs:
244244
uses: ansys/pydpf-actions/[email protected]
245245

246246
- name: "Test API test_server"
247-
uses: nick-fields/retry@v2
247+
uses: nick-fields/retry@v3
248248
with:
249249
timeout_minutes: 5
250250
max_attempts: 2
@@ -256,7 +256,7 @@ jobs:
256256
uses: ansys/pydpf-actions/[email protected]
257257

258258
- name: "Test API test_local_server"
259-
uses: nick-fields/retry@v2
259+
uses: nick-fields/retry@v3
260260
with:
261261
timeout_minutes: 2
262262
max_attempts: 2
@@ -268,7 +268,7 @@ jobs:
268268
uses: ansys/pydpf-actions/[email protected]
269269

270270
- name: "Test API test_multi_server"
271-
uses: nick-fields/retry@v2
271+
uses: nick-fields/retry@v3
272272
with:
273273
timeout_minutes: 5
274274
max_attempts: 2
@@ -280,7 +280,7 @@ jobs:
280280
uses: ansys/pydpf-actions/[email protected]
281281

282282
- name: "Test API test_remote_workflow"
283-
uses: nick-fields/retry@v2
283+
uses: nick-fields/retry@v3
284284
with:
285285
timeout_minutes: 4
286286
max_attempts: 3
@@ -301,7 +301,7 @@ jobs:
301301
uses: ansys/pydpf-actions/[email protected]
302302

303303
- name: "Test API test_workflow"
304-
uses: nick-fields/retry@v2
304+
uses: nick-fields/retry@v3
305305
with:
306306
timeout_minutes: 3
307307
max_attempts: 4
@@ -314,7 +314,7 @@ jobs:
314314
uses: ansys/pydpf-actions/[email protected]
315315

316316
- name: "Test API test_service"
317-
uses: nick-fields/retry@v2
317+
uses: nick-fields/retry@v3
318318
with:
319319
timeout_minutes: 2
320320
max_attempts: 2
@@ -337,7 +337,7 @@ jobs:
337337
uses: ansys/pydpf-actions/[email protected]
338338

339339
- name: "Test API test_custom_type_field"
340-
uses: nick-fields/retry@v2
340+
uses: nick-fields/retry@v3
341341
with:
342342
timeout_minutes: 2
343343
max_attempts: 2
@@ -349,7 +349,7 @@ jobs:
349349
uses: ansys/pydpf-actions/[email protected]
350350

351351
- name: "Test Operators"
352-
uses: nick-fields/retry@v2
352+
uses: nick-fields/retry@v3
353353
with:
354354
timeout_minutes: 2
355355
max_attempts: 2
@@ -367,4 +367,8 @@ jobs:
367367
path: tests/junit/test-results.xml
368368

369369
- name: "Upload coverage to Codecov"
370-
uses: codecov/codecov-action@v3
370+
uses: codecov/codecov-action@v4
371+
with:
372+
token: ${{ secrets.CODECOV_TOKEN }} # required
373+
name: ${{ env.PACKAGE_NAME }}_${{ matrix.python-version }}_${{ matrix.os }}_pytest_${{ inputs.ANSYS_VERSION }}${{ inputs.test_any == 'true' && '_any' || '' }}.xml
374+
flags: ${{ inputs.ANSYS_VERSION }},${{ matrix.os }},${{ matrix.python-version }}${{ inputs.test_any == 'true' && ',any' || '' }}

AUTHORS

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# This is the list of PyDPF-Core's significant contributors.
2+
#
3+
# This file does not necessarily list everyone who has contributed code.
4+
#
5+
# For contributions made under a Corporate CLA, the organization is
6+
# added to this file.
7+
#
8+
# If you have contributed to the repository and want to be added to this file,
9+
# submit a request.
10+
#
11+
#
12+
ANSYS, Inc.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
black==24.8.0
2-
build==1.2.2
1+
black==24.10.0
2+
build==1.2.2.post1
33
chevron==0.14.0
44
wheel==0.44.0
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
importlib-metadata==8.5.0
2-
numpy==2.0.0
2+
numpy==2.1.1
33
packaging==24.0
44
psutil==6.0.0
55
tqdm==4.66.1

requirements/requirements_test.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ ansys-platform-instancemanagement==1.1.2
22
coverage==7.6.1
33
imageio==2.35.1
44
imageio-ffmpeg==0.5.1
5-
pytest==7.4.2
5+
pytest==8.3.3
66
pytest-cov==5.0.0
77
pytest-order==1.3.0
88
pytest-rerunfailures==14.0

src/ansys/dpf/core/streams_container.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
data_processing_capi,
3838
data_processing_grpcapi,
3939
)
40-
from ansys.dpf.core import errors
40+
from ansys.dpf.core import errors, data_sources
4141

4242

4343
class StreamsContainer:
@@ -103,6 +103,10 @@ def _server(self, value):
103103
# step3: init environment
104104
self._api.init_streams_environment(self) # creates stub when gRPC
105105

106+
@property
107+
def datasources(self):
108+
return data_sources.DataSources(data_sources=self._api.streams_get_data_sources(self))
109+
106110
def release_handles(self):
107111
"""Release the streams."""
108112
self._api.streams_release_handles(self)

tests/test_streams_container.py

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,3 +67,36 @@ def test_create_from_streams_container(server_in_process, simple_bar):
6767
streams_provider = model.metadata.streams_provider
6868
sc = streams_provider.outputs.streams_container()
6969
dpf.core.streams_container.StreamsContainer(streams_container=sc, server=server_in_process)
70+
71+
72+
def test_streams_container_datasources(server_in_process, simple_bar):
73+
ds = dpf.core.DataSources(simple_bar, server=server_in_process)
74+
streams = dpf.core.operators.metadata.streams_provider(
75+
data_sources=ds, server=server_in_process
76+
).eval()
77+
ds2 = streams.datasources
78+
assert ds.result_files[0] == ds2.result_files[0]
79+
80+
81+
def test_retrieve_ip(server_in_process):
82+
start_server = dpf.core.Operator("grpc::stream_provider", server=server_in_process)
83+
in_thread = 1
84+
should_start_server = 3
85+
86+
start_server.connect(2, in_thread)
87+
start_server.connect(3, should_start_server)
88+
89+
streams = start_server.get_output(0, dpf.core.types.streams_container)
90+
ds = streams.datasources
91+
92+
# look for ip
93+
assert len(ds.result_files) == 1
94+
assert ds.result_key == "grpc"
95+
96+
addr = ds.result_files[0]
97+
import re
98+
99+
# can match 999.999.999.999:99999, 0.0.0.0:0
100+
# but not 0.0.0:0, 9999.999.999.999:999, 0.0.0.0
101+
ip_addr_regex = r"([0-9]{1,3}\.){3}[0-9]{1,3}:[0-9]{1,5}"
102+
assert re.match(ip_addr_regex, addr) != None

0 commit comments

Comments
 (0)