Skip to content

[Hotfix 25.2]: adjusted report related docstrings and added report init #1163

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

Closed
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
10 changes: 10 additions & 0 deletions flow360/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@
from flow360.component.surface_mesh_v2 import SurfaceMeshV2 as SurfaceMesh
from flow360.component.volume_mesh import VolumeMeshV2 as VolumeMesh
from flow360.environment import Env
from flow360.plugins import report
from flow360.version import __solver_version__, __version__

__all__ = [
Expand Down Expand Up @@ -253,4 +254,13 @@
"SurfaceSliceOutput",
"SlaterPorousBleed",
"migration",
<<<<<<< HEAD
=======
"Water",
"PointArray2D",
"StreamlineOutput",
"Transformation",
"WallRotation",
"report",
>>>>>>> 8ba5fb3b (adjusted report related docstrings and added report init (#1159))
]
67 changes: 67 additions & 0 deletions flow360/plugins/report/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
"""Utilities for creating reports"""

from flow360.plugins.report.report import ReportTemplate
from flow360.plugins.report.report_items import (
Chart2D,
Chart3D,
FixedRangeLimit,
ManualLimit,
NonlinearResiduals,
PatternCaption,
Settings,
SubsetLimit,
Summary,
Table,
)
from flow360.plugins.report.utils import (
Average,
DataItem,
Delta,
Expression,
GetAttribute,
Grouper,
Variable,
)
from flow360.plugins.report.uvf_shutter import (
BottomCamera,
Camera,
FrontCamera,
FrontLeftBottomCamera,
FrontLeftTopCamera,
LeftCamera,
RearCamera,
RearLeftTopCamera,
RearRightBottomCamera,
TopCamera,
)

__all__ = [
"Average",
"BottomCamera",
"Camera",
"Chart2D",
"Chart3D",
"DataItem",
"Delta",
"Expression",
"FixedRangeLimit",
"FrontCamera",
"FrontLeftBottomCamera",
"FrontLeftTopCamera",
"GetAttribute",
"Grouper",
"LeftCamera",
"ManualLimit",
"NonlinearResiduals",
"PatternCaption",
"RearCamera",
"RearLeftTopCamera",
"RearRightBottomCamera",
"ReportTemplate",
"Settings",
"SubsetLimit",
"Summary",
"Table",
"TopCamera",
"Variable",
]
21 changes: 11 additions & 10 deletions flow360/plugins/report/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,23 +135,24 @@ class ReportTemplate(Flow360BaseModel):
"""
A model representing a report containing various components such as summaries, inputs, tables,
and charts in both 2D and 3D.

Parameters
----------
title: str, optional
Title of report, shown on the first page
items : List[Union[Summary, Inputs, Table, Chart2D, Chart3D]]
A list of report items, each of which can be a summary, input data, table, 2D chart, or 3D chart.
The `type` field acts as a discriminator for differentiating item types.
include_case_by_case : bool, default=True
Flag indicating whether to include a case-by-case analysis in the report.
"""

<<<<<<< HEAD
title: Optional[str] = None
items: List[Union[Summary, Inputs, Table, Chart2D, Chart3D]] = pd.Field(
discriminator="type_name"
)
include_case_by_case: bool = False
=======
title: Optional[str] = pd.Field(None, description="Title of report, shown on the first page.")
items: List[ReportItemTypes] = pd.Field(
description="A list of report items, each of which can be a summary, input data, table, 2D chart, or 3D chart."
)
include_case_by_case: bool = pd.Field(
False,
description="Flag indicating whether to include a case-by-case analysis in the report.",
)
>>>>>>> 8ba5fb3b (adjusted report related docstrings and added report init (#1159))
settings: Optional[Settings] = Settings()

@pd.model_validator(mode="after")
Expand Down
Loading