INNER CODE UNIT · Python

_postprocess_scalar

QianyeSu/Skyborn · src/skyborn/calc/GPI/core.py:64

def _postprocess_scalar(value: Union[float, np.floating]) -> float:
    """Convert scalar UNDEF output to NaN."""
    value = float(value)
    return np.nan if np.isclose(value, UNDEF) else value


def _detect_temperature_kind(temperature: Any) -> str:
    """Map thermodynamic input dimensionality to the supported API kind."""
    temp_ndim = np.ndim(temperature)
    try:
        return _TEMPERATURE_KIND_BY_NDIM[temp_ndim]
    except KeyError as exc:
        raise ValueError(
            f"Unsupported temperature dimensions: {temp_ndim}. Expected 1, 3, or 4 dimensions."
        ) from exc


def _normalize_outflow_source(outflow_source: str) -> int:

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…