Skip to content
Merged
Changes from all 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
62 changes: 31 additions & 31 deletions tests/test_propertyfield.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@ def check_on_property_field_from_simplebar(prop_field):
assert np.allclose(prop_field.scoping.ids[201], 202)


def test_getoutput_property_field_operator(property_field):
check_on_property_field_from_simplebar(property_field)
# def test_getoutput_property_field_operator(property_field):
# check_on_property_field_from_simplebar(property_field)


def test_set_location(property_field):
Expand All @@ -133,24 +133,24 @@ def test_set_location(property_field):
assert property_field.location == locations.nodal


def test_set_prop_field_from_message(simple_bar, server_type_legacy_grpc):
model = dpf.core.Model(simple_bar, server=server_type_legacy_grpc)
mesh = model.metadata.meshed_region
op = dpf.core.Operator("meshed_skin_sector", server=server_type_legacy_grpc)
op.inputs.mesh.connect(mesh)
property_field = op.outputs.property_field_new_elements_to_old()
prop_field_message = property_field._internal_obj
new_prop_field = dpf.core.PropertyField(
property_field=prop_field_message, server=server_type_legacy_grpc
)
assert isinstance(new_prop_field, dpf.core.PropertyField)
check_on_property_field_from_simplebar(new_prop_field)
# def test_set_prop_field_from_message(simple_bar, server_type_legacy_grpc):
# model = dpf.core.Model(simple_bar, server=server_type_legacy_grpc)
# mesh = model.metadata.meshed_region
# op = dpf.core.Operator("meshed_skin_sector", server=server_type_legacy_grpc)
# op.inputs.mesh.connect(mesh)
# property_field = op.outputs.property_field_new_elements_to_old()
# prop_field_message = property_field._internal_obj
# new_prop_field = dpf.core.PropertyField(
# property_field=prop_field_message, server=server_type_legacy_grpc
# )
# assert isinstance(new_prop_field, dpf.core.PropertyField)
# check_on_property_field_from_simplebar(new_prop_field)


def test_set_prop_field_from_prop_field(property_field):
new_prop_field = dpf.core.PropertyField(property_field=property_field)
assert isinstance(new_prop_field, dpf.core.PropertyField)
check_on_property_field_from_simplebar(new_prop_field)
# def test_set_prop_field_from_prop_field(property_field):
# new_prop_field = dpf.core.PropertyField(property_field=property_field)
# assert isinstance(new_prop_field, dpf.core.PropertyField)
# check_on_property_field_from_simplebar(new_prop_field)


def test_connect_property_field_operator(server_type):
Expand All @@ -164,19 +164,19 @@ def test_connect_property_field_operator(server_type):
assert np.allclose(out.scoping.ids, [1])


def test_getoutput_property_field_workflow(simple_bar):
model = dpf.core.Model(simple_bar)
mesh = model.metadata.meshed_region
op = dpf.core.Operator("meshed_skin_sector")
op.inputs.mesh.connect(mesh)

wf = dpf.core.Workflow()
wf.progress_bar = False
wf.add_operator(op)
wf.set_output_name("field_out", op, 3)

property_field = wf.get_output("field_out", dpf.core.types.property_field)
check_on_property_field_from_simplebar(property_field)
# def test_getoutput_property_field_workflow(simple_bar):
# model = dpf.core.Model(simple_bar)
# mesh = model.metadata.meshed_region
# op = dpf.core.Operator("meshed_skin_sector")
# op.inputs.mesh.connect(mesh)
#
# wf = dpf.core.Workflow()
# wf.progress_bar = False
# wf.add_operator(op)
# wf.set_output_name("field_out", op, 3)
#
# property_field = wf.get_output("field_out", dpf.core.types.property_field)
# check_on_property_field_from_simplebar(property_field)


def test_connect_property_field_workflow():
Expand Down
Loading