Skip to content

Commit

Permalink
code style checks
Browse files Browse the repository at this point in the history
  • Loading branch information
roosre committed Sep 25, 2023
1 parent e8c91f7 commit c4bb351
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
8 changes: 5 additions & 3 deletions src/ansys/dpf/composites/_composite_model_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,11 @@ def material_names(self) -> Dict[str, int]:
try:
helper_op = dpf.Operator("composite::materials_container_helper")
except Exception as exc:
raise RuntimeError(f"Operator composite::materials_container_helper doesn't exist. "
f"This could be because the server version is 2024 R1-pre0. Please use "
f"the latest preview or the unified installer. Error: {exc}") from exc
raise RuntimeError(
f"Operator composite::materials_container_helper doesn't exist. "
f"This could be because the server version is 2024 R1-pre0. Please use "
f"the latest preview or the unified installer. Error: {exc}"
) from exc

helper_op.inputs.materials_container(self._material_operators.material_provider.outputs)
string_field = helper_op.outputs.material_names()
Expand Down
16 changes: 8 additions & 8 deletions tests/composite_model_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,16 +83,16 @@ def test_basic_functionality_of_composite_model(dpf_server, data_files, distribu

assert [ply["id"] for ply in sampling_point.analysis_plies] == analysis_ply_ids

ref_material_names = {
"Epoxy Carbon UD (230 GPa) Prepreg": 3,
"Epoxy Carbon Woven (230 GPa) Wet": 2,
"Honeycomb": 4,
"Structural Steel": 1,
}
ref_material_names = [
"Epoxy Carbon UD (230 GPa) Prepreg",
"Epoxy Carbon Woven (230 GPa) Wet",
"Honeycomb",
"Structural Steel",
]
mat_names = composite_model.material_names
assert len(mat_names) == len(ref_material_names)
for mat_name, dpf_mat_id in ref_material_names.items():
assert mat_names[mat_name] == dpf_mat_id
for mat_name in ref_material_names:
assert mat_name in mat_names.keys()

timer.add("After getting properties")

Expand Down

0 comments on commit c4bb351

Please sign in to comment.