report.Delta#

class Delta#

Bases: Flow360BaseModel

Represents a delta calculation between a reference case and a target case based on specified data.

Attributes

data: DataItem | str#

Path to the data item used for delta calculation.

ref_index: int, optional#

Index of the reference case in the list of cases for comparison.

Default:

0

Properties

include#

Returns the include filter from the underlying DataItem, or None if data is not a DataItem.

exclude#

Returns the exclude filter from the underlying DataItem, or None if data is not a DataItem.

Additional Constructors

classmethod from_file(filename)#

Loads a Flow360BaseModel from .json, or .yaml file.

Parameters:

filename (str) – Full path to the .yaml or .json file to load the Flow360BaseModel from.

Returns:

An instance of the component class calling load.

Return type:

Flow360BaseModel

Example

>>> params = Flow360BaseModel.from_file(filename='folder/sim.json') 

Methods

calculate(case, cases)#

Calculates the delta between the specified case and the reference case.

Parameters:
  • case (Case) – The target case for which the delta is calculated.

  • cases (List[Case]) – A list of available cases, including the reference case.

Returns:

The computed delta value between the case and reference case data.

Return type:

float

Raises:

ValueError – If ref_index is out of bounds or None, indicating a missing reference.

help(methods=False)#

Prints message describing the fields and methods of a Flow360BaseModel.

Parameters:

methods (bool = False) – Whether to also print out information about object’s methods.

Return type:

None

Example

>>> params.help(methods=True) 
to_file(filename, **kwargs)#

Exports Flow360BaseModel instance to .json or .yaml file

Parameters:

filename (str) – Full path to the .json or .yaml or file to save the Flow360BaseModel to.

Return type:

None

Example

>>> params.to_file(filename='folder/flow360.json')