Reports#
The reports built in the WebUI can also be created, loaded, updated and
reapplied from Python with the flexcompute-flow-report package. It is a companion package,
published separately from flow360, and it operates on the same report resources as the WebUI: a
report created from Python opens in the browser at Report.web_url and can be edited there, and
a report saved in the browser can be loaded from Python with Report.from_cloud().
The client covers the content of a report: its resources, sections and their settings. Exporting a report to PDF, exporting views as PNG, exporting chart data as CSV and deleting a report remain WebUI operations; see GUI Guide: Reports. The README shipped with the package adds task-oriented guides on saved scenes, visualization capabilities and residual or CFL charts; read it on the PyPI project page.
Installation#
pip install flexcompute-flow-report
The package depends on flow360 25.10.4 or later and installs a compatible client. It uses the
active Flow360 environment and credentials, so the setup described in
Installation and Setup is all that is required.
Import the client from the shared flexcompute namespace:
from flexcompute.flow_report import Report
Minimal example#
import flow360 as fl
from flexcompute.flow_report import Report
baseline = fl.Case(id="case-11111111-1111-1111-1111-111111111111")
variant = fl.Case(id="case-22222222-2222-2222-2222-222222222222")
report = Report.create(
name="Wing comparison",
resources=[baseline, variant],
reference=baseline,
sections=[
Report.Summary(resource_type="case"),
Report.Visualization(),
Report.Chart(y=["CL", "CD"], comparison="delta"),
],
)
print(report.id)
print(report.web_url)
Resources are passed as lightweight references built from their cloud IDs: fl.Case(id=...),
fl.Geometry(id=...), fl.SurfaceMesh(id=...) and fl.VolumeMesh(id=...). The client reads the
metadata it needs through these references, so calling from_cloud() on them first is unnecessary.
Wherever a parameter accepts a resource, it also accepts the resource ID as a string.
Report lifecycle#
- class Report[source]#
An interactive Report resource created on the Flow360 platform.
All properties are read-only.
configis a deep copy: changing it does not change the cloud report. The section classes used bycreate()andupdate()are available as nested aliases,Report.Summary,Report.Chart,Report.ChartVariable,Report.Visualization,Report.VisualizationSetup,Report.VisualizationView,Report.CameraandReport.Scene; see Section API.- property associated_resources: list[ReportAssociatedResource]#
Resources associated with this report.
- property config: ReportConfig#
A defensive copy of the configuration persisted for this Report.
- classmethod Report.create(*, name, resources, sections=None, reference=None, aliases=None, description='', tags=None, parent_folder_id='ROOT.FLOW360')[source]#
Create an interactive report and return its cloud resource.
AI-generated workflows should load
get_agent_guide()before constructing sections. For visualizations, discover every resource’s capabilities and runcheck_visualization_setup(...)before calling this method.The four summary sections (one per asset type) are always present;
sectionsadds visualization and chart sections and customizes the summaries.Parameter
Meaning
nameNon-empty report name.
resourcesThe assets of the report, between 1 and 50:
Case,Geometry,SurfaceMeshorVolumeMeshobjects or IDs.sectionsAdditional or customized sections, see Section API.
referenceReference case. If omitted, the first case is used.
aliasesReport-only display names, keyed by resource ID.
descriptionReport description.
tagsTags, trimmed and deduplicated in input order.
parent_folder_idDestination folder ID.
- Parameters:
- Return type:
- classmethod Report.from_cloud(report_id)[source]#
Load an interactive Report from the active Flow360 environment.
Loads an existing report, whether it was created in the WebUI or from Python. The returned object stays bound to the environment that was active when it was loaded.
- Report.update(*, resources=None, sections=None, reference=None, aliases=None, name=None, description=None, tags=None, parent_folder_id=None)[source]#
Update this Report in place while preserving its cloud ID and URL.
Returns the same object; the report ID and
web_urldo not change. Metadata (name,description,tags,parent_folder_id) can be updated on its own. Updating the content requiresresourcesandsectionstogether: the configuration is rebuilt from them rather than patched field by field.Parameter
Meaning
resourcesNew complete resource set. Requires
sections.sectionsNew complete section specification. Requires
resources.referenceReference case of the rebuilt configuration.
aliasesAliases of the rebuilt configuration.
nameNew name;
Noneleaves it unchanged.descriptionNew description;
Noneleaves it unchanged,""clears it.tagsNew complete tag list;
Noneleaves it unchanged,[]clears it.parent_folder_idNew folder ID;
Noneleaves it unchanged.- Parameters:
resources (Iterable[Case | Geometry | SurfaceMeshV2 | VolumeMeshV2] | None)
sections (Iterable[ReportSummary | ReportVisualization | ReportChart] | None)
name (str | None)
description (str | None)
parent_folder_id (str | None)
- Return type:
- Report.refresh()[source]#
Reload this Report’s metadata and persisted configuration.
Use it when the report may have changed in the WebUI or in another process. It is not needed after a successful
update().- Return type:
- Report.apply_to_new(*, name, resources, reference=None, aliases=None, description='', tags=None, parent_folder_id=None)[source]#
Create a new Report by applying this Report to new cloud resources.
The Python counterpart of the Apply to new header action: the new report has the same sections, layout and display settings applied to a new set of resources. Visualization sections take the first eight matching resources and chart sections the first ten cases, in the order supplied; a per-resource force scope is reset to total because face and body-group IDs cannot be reused across cases.
Parameter
Meaning
nameName of the new report.
resourcesResource pool of the new report.
referenceReference case in the new pool.
aliasesDisplay names for the new resources.
descriptionDescription of the new report.
tagsTags of the new report.
parent_folder_idDestination folder;
Nonereuses the source report’s folder.
Section API#
Section objects map one to one onto the sections described in the
GUI Guide. Each class below is also reachable as a nested
alias of Report (Report.Summary is ReportSummary,
and so on), which is the spelling used in the examples.
- class ReportSummary[source]#
Customize one of the four summary tables included in every report.
Alias:
Report.Summary.supported_fields()returns the accepted field names for a resource type.Parameter
Meaning
resource_typeThe summary table to customize:
"case","geometry","surface_mesh"or"volume_mesh".titleCustom title.
fieldsVisible rows. For cases
Noneshows the standard subset (the General tab); for the other types it shows every field.force_scopeForce scope of the case summary (
"total","faces"or"body_groups"); cases only.force_scope_idsFace or body-group IDs; required with
"faces"or"body_groups".- resource_type: SummaryResourceType [Required]#
- classmethod supported_fields(resource_type)[source]#
Return the accepted field names for one summary resource type.
- Parameters:
resource_type (Literal['geometry', 'surface_mesh', 'volume_mesh', 'case'])
- Return type:
tuple[Literal[‘bodies’, ‘patches’, ‘edges’, ‘max_edge_length’, ‘nodes’, ‘triangles’, ‘quadrilaterals’, ‘first_layer_thickness’, ‘tetrahedrons’, ‘prisms’, ‘pyramids’, ‘hexahedrons’, ‘velocity’, ‘alpha’, ‘beta’, ‘turbulence_model’, ‘transition_model’, ‘pseudo_steps’, ‘physical_steps’, ‘area’, ‘oal’, ‘oah’, ‘oaw’, ‘wb’, ‘cl’, ‘cd’, ‘clf’, ‘clr’, ‘cs’, ‘cd_area’], …]
- class ReportChart[source]#
Add a 2D chart section using the controls available in the Report UI.
Alias:
Report.Chart.supported_x_variables()andsupported_y_variables()list the built-in variables;supported_y_variables()returns only the fixed force and moment coefficients (total, pressure and skin-friction parts), never residuals, CFL or result-file columns, which go throughReportChartVariable.Parameter
Meaning
titleSection title.
resourcesCases to plot;
Noneselects up to 10 report cases.xX-axis variable:
"alpha","beta","velocity","first_layer_thickness","surface_max_edge_length","pseudo_step","physical_step","coordinate_x"or"coordinate_y".yOne to five Y axes, one chart per variable: built-in Y variables or
ReportChartVariablevalues.comparison"delta"plots differences to the reference case and cannot be combined withlog_scale.x_range,y_rangesManual axis ranges:
(min, max)for X, a mapping from Y variable to(min, max)for Y.Noneis the global auto scaling.log_scaleLogarithmic Y axes.
style"case"colors by case and varies the line style by variable;"variable"the reverse.background_viewGeometry outline behind coordinate charts:
"coordinate_x"with"left"or"top","coordinate_y"with"back"or"top".force_scope,force_scope_idsForce scope of history charts (pseudo or physical step with a force variable), as in
ReportSummary.seriesMembers of a metadata-defined series group to show, such as residual components.
series_displayHow the selected series are drawn:
"individual","cumulative"or"summed".Sweep variables (
alphatosurface_max_edge_length) accept the total force coefficients;pseudo_stepandphysical_stepaccept force-history variables andReportChartVariablevalues;coordinate_xandcoordinate_yaccept onlyReportChartVariablevalues.- x: BuiltInChartXVariable = 'alpha'#
- y: list[BuiltInChartYVariable | ReportChartVariable] [Optional]#
- Constraints:
min_length = 1
max_length = 5
- comparison: ChartComparison = 'absolute'#
- style: ChartStyle = 'case'#
- classmethod supported_y_variables()[source]#
Return the built-in y-axis variables.
- Return type:
tuple[Literal[‘CL’, ‘CD’, ‘CFx’, ‘CFy’, ‘CFz’, ‘CMx’, ‘CMy’, ‘CMz’, ‘CLPressure’, ‘CDPressure’, ‘CFxPressure’, ‘CFyPressure’, ‘CFzPressure’, ‘CMxPressure’, ‘CMyPressure’, ‘CMzPressure’, ‘CLSkinFriction’, ‘CDSkinFriction’, ‘CFxSkinFriction’, ‘CFySkinFriction’, ‘CFzSkinFriction’, ‘CMxSkinFriction’, ‘CMySkinFriction’, ‘CMzSkinFriction’], …]
- class ReportChartVariable[source]#
A CSV or user-defined-dynamics variable selected in the Report UI.
Alias:
Report.ChartVariable. A Y-axis variable defined by the result metadata of the cases rather than by the fixed list of force coefficients. Prefer the factories over the constructor:csv()andudd()select one column of a result CSV file or of a user-defined dynamics output as one Y axis;csv_series()andudd_series()select the whole series group of such a file, whose members are then picked withReport.Chart(series=[...]). A leading/orresults/infile_nameis removed.- source: Literal['csv', 'udd'] = 'csv'#
- classmethod udd(file_name, column)[source]#
Select a user-defined-dynamics output column.
- Parameters:
- Return type:
- classmethod csv_series(file_name)[source]#
Select a metadata-defined series group from a CSV output.
- Parameters:
file_name (str)
- Return type:
- class ReportVisualization[source]#
Add a configured 3D resource comparison section to a report.
AI-generated workflows should first load
get_agent_guide(). Before reusing one setup across resources, obtain each resource’s capabilities and callcheck_visualization_setupbefore creating or updating the Report.Alias:
Report.Visualization. One 3D visualization section over resources of a single type.Parameter
Meaning
titleSection title.
resourcesUp to eight resources of one type.
Noneselects the first eight cases, or the first eight resources of the report’s first type when there are no cases.layoutGrid view or
"single"view with one tab per resource.resolutionRendering resolution of cases,
"low"(default) or"high". Meshes and geometries always render at high resolution and reject"low".setupThe linked-view visualization set-up shared by all views: a
ReportVisualizationSetup, a list of them, or thevisualization_settingof a savedScene. At most one manual set-up per output.cameraThe shared camera of the linked views: a
ReportCameraor theviewpointof a saved scene.viewsPer-resource overrides, keyed by resource ID: a
ReportVisualizationViewor a{"setup": ..., "camera": ...}mapping. An overridden view is unlinked from the shared state, like Independent Settings in the WebUI.The set-up types available per resource type are
surface,slice,isosurfaceandstreamlinefor cases,surfacefor surface meshes andslicefor volume meshes. Geometry views have no set-up controls.- layout: VisualizationLayout = 'grid'#
- setup: list[ReportVisualizationSetup] | SceneVisualizationSetting [Optional]#
- camera: ReportCamera | SceneViewpoint | None = None#
- views: dict[str, ReportVisualizationView] [Optional]#
- class ReportVisualizationSetup[source]#
Configure one surface, slice, isosurface, or streamline output.
Use exact IDs returned by
get_capabilities(resource)and check this setup against that resource before creating or updating a Report. Name normalization can suggest candidates but does not produce authoritative IDs.Alias:
Report.VisualizationSetup. Which output to show, how to color it and which entities to display. Output, field and entity names must match the resource’s visualization metadata exactly; use Capability discovery to read them.Parameter
Meaning
output,typeRequired. Exact output name from the resource metadata, and its category:
"surface","slice","isosurface"or"streamline".fieldField to color by. Required for the field-display parameters below.
show,hideEntity IDs to show or hide; an ID cannot appear in both.
log_scale,range,color_range,theme,solid_color,show_color_map,visualizer,unit,use_local_value,time_frameField display: logarithmic scale, rendering range and color-scale bounds (each defaults to the other when only one is given), color theme, solid color, color-map visibility, the
"lic"visualizer, display unit, resource-local range and time-frame index.clip,clip_value,clip_rangeClipping:
"none","above","below"or"range"; the threshold for above or below; the(min, max)required by"range".contour_mode,contour_steps,contour_line_colorContours,
surfaceandsliceonly:"surface","contours"or"both"; number of steps; line color.streamline_direction,render_type,tube_width,tube_width_unit,ribbon_width,ribbon_width_unit,ribbon_angle_scalestreamlineonly:"upstream","downstream"or"both";"ribbon"or"line"; tube and ribbon sizing.slice_variantsSlice rendering per entity ID,
"flat"or"crinkled";sliceonly.wireframesWireframe state per entity ID.
custom_colorsCustom color map as
(position, "#RRGGBB")pairs, at least two positions between 0 and 100; only one set-up per section may define it.- type: VisualizationFieldType [Required]#
- class ReportVisualizationView[source]#
Validated independent state stored for one visualization resource view.
Alias:
Report.VisualizationView. Thesetupandcameraoverride of one resource inside aReportVisualization.- setup: list[ReportVisualizationSetup] | SceneVisualizationSetting [Optional]#
- camera: ReportCamera | SceneViewpoint | None = None#
- class ReportCamera[source]#
Camera used by linked views, with optional input units for length values.
Alias:
Report.Camera.Parameter
Meaning
position,look_at,pan_target,upCamera position, target, pan target and up vector, each a 3-tuple of numbers.
dimension,dimension_dirFraming dimension (positive number) and its meaning:
"width","height"or"diagonal".unitUnit of the lengths:
"m","cm","mm","inch"or"ft". For the shared cameraNonemeans metres; for a per-resource cameraNonemeans the resource’s model coordinates. A per-resource camera with an explicit unit is converted to model coordinates using the resource’s simulation settings.
Capability discovery#
The client does not translate names or validate a set-up against the resource when the report is
created, so check them first. All three helpers are importable from flexcompute.flow_report.
- get_capabilities(resource)[source]#
Return Manifest-declared visualization capabilities for one resource.
AI-generated workflows should call this function for every selected resource before choosing exact output, field, or visibility-target IDs. See
get_agent_guide()for the required cross-resource selection workflow.
- check_visualization_setup(setup, capabilities)[source]#
Check exact setup references against one resource’s visualization capabilities.
Run this check for every selected resource before
Report.create(...)or a configuration-changingreport.update(...). This function performs no network requests and does not mutate or translate the setup. Obtaincapabilitiesseparately withget_capabilities()and reuse them for configuration decisions. AI-generated workflows should follow the complete sequence inget_agent_guide().- Parameters:
setup (ReportVisualizationSetup | Sequence[ReportVisualizationSetup] | SceneVisualizationSetting)
capabilities (ResourceVisualizationCapabilities)
- Return type:
VisualizationSetupCheckResult
- class Scene[source]#
A read-only visualization Scene loaded from the active Flow360 environment.
Alias:
Report.Scene. A scene saved in the workbench; itsvisualization_settingandviewpointcan be passed as thesetupandcameraof aReportVisualizationor of one of itsviews.- classmethod from_cloud(scene_id)[source]#
Load a Scene and its visualization setting and viewpoint.
Before applying
visualization_settingto multiple resources, obtain each resource’s capabilities and callcheck_visualization_setupbefore creating or updating the Report.
- property resource_type: Literal['Case', 'Geometry', 'SurfaceMesh', 'VolumeMesh']#
Resource type from which the Scene setting was captured.
- property visualization_setting: SceneVisualizationSetting#
A defensive copy of the Scene’s Workbench visualization setting.
- property viewpoint: SceneViewpoint#
A defensive copy of the Scene’s canonical-metre viewpoint.
- get_agent_guide()[source]#
Return the authoritative guide to inject before an AI agent uses this package.
Agent runners should add the returned Markdown to their system or developer instructions before sending the user’s task to the model. Calling this function is deterministic; installing the wheel alone does not make an agent read its docs.
The same guide is printed by the
flexcompute-flow-report-guidecommand.- Return type:
Limits#
The limits are those of the WebUI: 1 to 50 resources per report, at most 8 resources of one type per visualization section, at most 10 cases and 1 to 5 Y axes per chart, and a reference that is a case included in the report. Unsupported combinations are rejected before any request is sent.
See also
User Guide: Reports for when to use a report, and GUI Guide: Reports for the controls each section maps to.