Source code for RCAIDE.Framework.Optimization.Common.print_optimization_results

# RCAIDE/Framework/Optimization/Common/print_optimization_results.py

# -----------------------------------------------------------------------------------------------------------------
#  IMPORT
# -----------------------------------------------------------------------------------------------------------------
from .helper_functions import get_values

# ----------------------------------------------------------------------------------------------------------------------
#  print_optimization_results
# ----------------------------------------------------------------------------------------------------------------------




def _fmt(tag):
    return tag.replace('_', ' ').title()


def _is_feasible(value, sense, edge):
    if sense == '>':
        return value >= edge
    if sense == '<':
        return value <= edge
    return abs(value - edge) < 1e-6