data_interpolator_builder.py

data_interpolator_builder.py#

aviary.utils.data_interpolator_builder.build_data_interpolator(interpolator_data=None, interpolator_outputs=None, num_nodes=1, method='slinear', extrapolate=True, structured=None, connect_training_data=False)[source]

Builder for openMDAO metamodel components using data provided via data file, directly provided as an argument, or training data passed through openMDAO connections. Data is converted to a structured grid format if possible, otherwise a semistructured grid is assumed.

Parameters:
  • num_nodes (int) – Number of points that will be simultaneously interpolated during model execution.

  • interpolator_data ((str, Path, NamedValues)) – Path to the Aviary csv file containing all data required for interpolation, or the data directly given as a NamedValues object.

  • interpolator_outputs (list, dict, optional) –

    if connect_training_data is true, a dictionary describing the names of dependent variables (keys) and their units (values). This dictionary describes the names and units for training data that will be provided via openMDAO connections during model execution.

    If connect_training_data is False, a list of the names of dependent variables in interpolator_data. These variable names should reference variables in interpolator_data, and are ignored otherwise.

    Required if interpolator_data is a NamedValues object.

  • num_nodes – Number of points that will be simultaneously interpolated during model executuion.

  • method (str, optional) – Interpolation method for metamodel. See openMDAO documentation for valid options.

  • extrapolate (bool, optional) – Flag that sets if metamodel should allow extrapolation

  • structured (bool, optional) – Flag to set if interpolation data is a structure grid. If True, the structured metamodel component is used, if False, the semistructured metamodel is used. If None, the builder chooses based on provided data structure.

  • connect_training_data (bool, optional) – Flag that sets if dependent data for interpolation will be passed via openMDAO connections. If True, any provided values for dependent variables will be ignored.

Returns:

interp_comp – OpenMDAO metamodel component using the provided data and flags

Return type:

om.MetaModelSemiStructuredComp, om.MetaModelStructuredComp