Skip to content
Merged
Show file tree
Hide file tree
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
13 changes: 0 additions & 13 deletions flow360/component/simulation/outputs/outputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -449,19 +449,6 @@ def validate_imported_surface_output_fields(self, param_info: ParamsValidationIn
)
return self

@pd.model_validator(mode="after")
def ensure_write_single_file_supported(self):
"""Ensure write_single_file is supported for chosen output format"""
if self.write_single_file:
if self.output_format == "paraview":
raise ValueError("write_single_file is only supported for Tecplot output format.")
if self.output_format == "both":
add_validation_warning(
"write_single_file is only supported for Tecplot output format. "
+ "Paraview files will be still saved separately."
)
return self


class TimeAverageSurfaceOutput(SurfaceOutput):
"""
Expand Down
17 changes: 7 additions & 10 deletions tests/simulation/params/test_validators_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -1526,16 +1526,13 @@ def test_force_distribution_output_requires_wall_bc(mock_validation_context):


def test_surface_output_write_single_file_validator():
with pytest.raises(
ValueError,
match=re.escape("write_single_file is only supported for Tecplot output format."),
):
SurfaceOutput(
write_single_file=True,
entities=[Surface(name="noSlipWall")],
output_fields=["Cp"],
output_format="paraview",
)
# write_single_file is now supported for all output formats
SurfaceOutput(
write_single_file=True,
entities=[Surface(name="noSlipWall")],
output_fields=["Cp"],
output_format="paraview",
)

SurfaceOutput(
write_single_file=True,
Expand Down
Loading