Skip to content
Merged
Show file tree
Hide file tree
Changes from 12 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
5 changes: 4 additions & 1 deletion examples/05-file-IO/02-hdf5_serialize_and_read.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,10 @@

###############################################################################
# compare first result at second time set:
fc_all_steps_first_step_first_res = res_deser_all_times_list[0].get_field_by_time_id(2) # set 1
position_result = result_names_on_all_time_steps.index("result_U")
fc_all_steps_first_step_first_res = res_deser_all_times_list[position_result].get_field_by_time_id(
2
) # set 2
mesh_deser_all_times.plot(fc_all_steps_first_step_first_res)

mesh_deser_set_per_set.plot(res_deser_set_per_set_list[num_res * 1 + 0])
Expand Down
2 changes: 1 addition & 1 deletion src/ansys/dpf/core/available_result.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ class AvailableResult:
>>> transient = examples.download_transient_result()
>>> model = dpf.Model(transient)
>>> result_info = model.metadata.result_info
>>> res = result_info.available_results[0]
>>> res = result_info.available_results[1]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@PProfizi Do we check docstrings in retro tests in CI Release? If we do that, this will fail. @oparreno alternatively we could get result by name here, and that would always work

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rafacanton, I will verify once my PR is merged as I deleted that part in the first one

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rafacanton yes we do. And we have ways of making them retro-compatible, such as with a big ugly if on server.meets_version :).

>>> res.name
'displacement'
>>> res.homogeneity
Expand Down
4 changes: 2 additions & 2 deletions src/ansys/dpf/core/result_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,9 @@ class ResultInfo:
>>> model = dpf.Model(transient)
>>> result_info = model.metadata.result_info # printable result_info

>>> result_info.available_results[0].name
>>> result_info.available_results[1].name
'displacement'
>>> result_info.available_results[0].homogeneity
>>> result_info.available_results[1].homogeneity
'length'

"""
Expand Down
5 changes: 4 additions & 1 deletion tests/test_resultinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,10 @@ def test_byitem_resultinfo(model):


def test_get_result_resultinfo_from_index(model):
res = model.metadata.result_info[2]
if not SERVERS_VERSION_GREATER_THAN_OR_EQUAL_TO_11_0:
res = model.metadata.result_info[3]
else:
res = model.metadata.result_info[2]
assert res.name == "acceleration"
assert res.n_components == 3
assert res.dimensionality == "vector"
Expand Down
Loading