Skip to content

Commit

Permalink
[FL-226] TimeAverageProbeOutput supports frequency=-1 (#738)
Browse files Browse the repository at this point in the history
* Fix frequency for timeaverage monitors

* fix unit test

* Address comments
  • Loading branch information
angranl-flex authored Feb 18, 2025
1 parent 4e0aa69 commit 3e34f1d
Showing 1 changed file with 25 additions and 4 deletions.
29 changes: 25 additions & 4 deletions flow360/component/simulation/outputs/outputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -613,8 +613,19 @@ class TimeAverageProbeOutput(ProbeOutput):
"""

frequency: int = pd.Field(default=1, ge=1)
frequency_offset: int = pd.Field(default=0, ge=0)
# pylint: disable=abstract-method
frequency: int = pd.Field(
default=1,
ge=-1,
description="Frequency (in number of physical time steps) at which output is saved. "
+ "-1 is at end of simulation.",
)
frequency_offset: int = pd.Field(
default=0,
ge=0,
description="Offset (in number of physical time steps) at which output animation is started."
+ " 0 is at beginning of simulation.",
)
start_step: Union[pd.NonNegativeInt, Literal[-1]] = pd.Field(
default=-1, description="Physical time step to start calculating averaging"
)
Expand Down Expand Up @@ -691,8 +702,18 @@ class TimeAverageSurfaceProbeOutput(SurfaceProbeOutput):
"""

# pylint: disable=abstract-method
frequency: int = pd.Field(default=1, ge=1)
frequency_offset: int = pd.Field(default=0, ge=0)
frequency: int = pd.Field(
default=1,
ge=-1,
description="Frequency (in number of physical time steps) at which output is saved. "
+ "-1 is at end of simulation.",
)
frequency_offset: int = pd.Field(
default=0,
ge=0,
description="Offset (in number of physical time steps) at which output animation is started."
+ " 0 is at beginning of simulation.",
)
start_step: Union[pd.NonNegativeInt, Literal[-1]] = pd.Field(
default=-1, description="Physical time step to start calculating averaging"
)
Expand Down

0 comments on commit 3e34f1d

Please sign in to comment.