Skip to content

Exclude pseudo/time step related columns when computing the average of forces #1116

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 3, 2025
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
9 changes: 7 additions & 2 deletions flow360/component/results/base_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
# pylint: disable=consider-using-with
TMP_DIR = tempfile.TemporaryDirectory()


_PSEUDO_STEP = "pseudo_step"
_PHYSICAL_STEP = "physical_step"
_TIME = "time"
_TIME_UNITS = "time_units"
Expand Down Expand Up @@ -491,7 +491,12 @@ def _pseudo_step_masks(cls, df):

@classmethod
def _average_last_fraction(cls, df, average_fraction):
selected_fraction = df.tail(int(len(df) * average_fraction))
columns_filtered = [
col
for col in df.columns
if col not in [_PSEUDO_STEP, _PHYSICAL_STEP, _TIME, _TIME_UNITS]
]
selected_fraction = df[columns_filtered].tail(int(len(df) * average_fraction))
return selected_fraction.mean()

def get_averages(self, average_fraction):
Expand Down
2 changes: 1 addition & 1 deletion flow360/component/results/case_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from flow360.cloud.s3_utils import CloudFileNotFoundError
from flow360.component.results.base_results import (
_PHYSICAL_STEP,
_PSEUDO_STEP,
PerEntityResultCSVModel,
ResultBaseModel,
ResultCSVModel,
Expand All @@ -35,7 +36,6 @@
from flow360.log import log

# pylint:disable=invalid-name
_PSEUDO_STEP = "pseudo_step"
_CL = "CL"
_CD = "CD"
_CFx = "CFx"
Expand Down
Loading