Skip to content

Commit

Permalink
Merge branch 'master' into dependabot/github_actions/robinraju/releas…
Browse files Browse the repository at this point in the history
…e-downloader-1.11
  • Loading branch information
PProfizi authored Jul 16, 2024
2 parents c07845c + f8f57e8 commit 179dfdd
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 5 deletions.
4 changes: 4 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,10 @@ def grpc_server():
server.shutdown()


SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_9_0 = meets_version(
get_server_version(core._global_server()), "9.0"
)

SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_8_0 = meets_version(
get_server_version(core._global_server()), "8.0"
)
Expand Down
21 changes: 17 additions & 4 deletions tests/test_dpfresultwithkeywords.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

from ansys import dpf
from ansys.dpf import post
from conftest import SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_9_0


def test_displacement_with_scoping_verbose_api(allkindofcomplexity):
Expand Down Expand Up @@ -261,7 +262,10 @@ def test_groupingelshape_nodallocation_verbose_api(allkindofcomplexity):
assert disp.result_fields_container.get_label_space(3) == {"elshape": 3, "time": 1}
assert len(disp.get_data_at_field(0)) == 14826
assert len(disp.get_data_at_field(1)) == 1486
assert len(disp.get_data_at_field(2)) == 19
if SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_9_0:
assert len(disp.get_data_at_field(2)) == 21
else:
assert len(disp.get_data_at_field(2)) == 19
assert len(disp.get_data_at_field(3)) == 4
assert np.isclose(disp.get_data_at_field(2)[0][0], 5.523488975819807e-20)
assert disp[0].location == locations.nodal
Expand All @@ -275,7 +279,10 @@ def test_groupingelshape_nodallocation(allkindofcomplexity):
assert disp.result_fields_container.get_label_space(3) == {"elshape": 3, "time": 1}
assert len(disp.get_data_at_field(0)) == 14826
assert len(disp.get_data_at_field(1)) == 1486
assert len(disp.get_data_at_field(2)) == 19
if SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_9_0:
assert len(disp.get_data_at_field(2)) == 21
else:
assert len(disp.get_data_at_field(2)) == 19
assert len(disp.get_data_at_field(3)) == 4
assert np.isclose(disp.get_data_at_field(2)[0][0], 5.523488975819807e-20)
assert disp[0].location == locations.nodal
Expand Down Expand Up @@ -367,7 +374,10 @@ def test_groupingelshape_elemlocation(allkindofcomplexity):
def test_groupingmat_nodallocation_verbose_api(allkindofcomplexity):
result = post.load_solution(allkindofcomplexity)
disp = result.misc.nodal_displacement(grouping=post.grouping.by_material)
assert disp.num_fields == 11
if SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_9_0:
assert disp.num_fields == 13
else:
assert disp.num_fields == 11
assert len(disp[0]) == 6288
assert len(disp[2]) == 744
assert np.isclose(disp.get_data_at_field(2)[0][2], -6.649053654123576e-07)
Expand All @@ -381,7 +391,10 @@ def test_groupingmat_nodallocation(allkindofcomplexity):
result = post.load_solution(allkindofcomplexity)
d = result.displacement(grouping=post.grouping.by_material)
disp = d.vector
assert disp.num_fields == 11
if SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_9_0:
assert disp.num_fields == 13
else:
assert disp.num_fields == 11
assert len(disp[0]) == 6288
assert len(disp[2]) == 744
assert np.isclose(disp.get_data_at_field(2)[0][2], -6.649053654123576e-07)
Expand Down
6 changes: 5 additions & 1 deletion tests/test_simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_4_0,
SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_6_2,
SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_7_1,
SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_9_0,
)


Expand Down Expand Up @@ -112,7 +113,10 @@ def test_simulation_split_mesh_by_properties(allkindofcomplexity):
]
)
assert isinstance(meshes, Meshes)
assert len(meshes) == 16
if SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_9_0:
assert len(meshes) == 18
else:
assert len(meshes) == 16
meshes = simulation.split_mesh_by_properties(
properties={
elemental_properties.material: 1,
Expand Down

0 comments on commit 179dfdd

Please sign in to comment.