flow360.report.Grouper#

class Grouper#

Bases: Flow360BaseModel

Class for objects responsible for grouping data into series in Chart2D.

Example

  • Data will be grouped by each turbulence model and then by the first tag,

    if the first tag is “a” or “b” the data point will be assigned to group “bucket0”, if the first tag is “c” the data point will be assigned to “bucket1”

>>> Grouper(
...     group_by=["params/models/Fluid/turbulence_model_solver/type_name", "info/tags/0"],
...     buckets=[None, {"bucket0": ["a", "b"], "bucket1": ["c"]}],
... )

group_by: str | List[str] | None | List[None] [Required]#

The path to the data attribute (or paths to attributes in case of multi-level grouping) by which the grouping should be done.

buckets: dict[str, List] | List[dict[str, List] | None] | None = None#

Dictionaries where key represents the name of the group and value is the list of values, that belong to the group. If all the values should be unique, enter None for the corresponding bucket.

initialize_arrays(cases, y_variables)#

Initializes data structures for x_data and y_data.

arrange_data(case, x_data, y_data, x_data_point, y_data_point, y_variable)#

Sorts the data into appropriate series based on the case.

arrange_legend()#

Creates the legend for the defined grouping.