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"]}],
... )

Attributes

group_by: str | list[str] | list[None], optional#

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

buckets: Union[dict[str, List], List[Optional[dict[str, List]]], NoneType]#

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.

Default:

None

Additional Constructors

classmethod from_file(filename)#

Load a Flow360BaseModel from a .json file.

Parameters:

filename (str)

Return type:

Flow360BaseModel

Methods

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.

help(methods=False)#

Print fields and methods of a Flow360BaseModel using rich.

Parameters:

methods (bool)

Return type:

None

to_file(filename, **kwargs)#

Export Flow360BaseModel instance to a .json file.

Parameters:
Return type:

None