src/pys5p/lib/plotlib.py
def check_data2d(method: str, data) -> None:
    """
    Make sure that the input data is 2-dimensional and contains valid data
    """
    # data is stored in a numpy.ndarray
    if isinstance(data, np.ndarray):
        if data.ndim != 2:
            raise ValueError('data must be two dimensional')
        if np.all(np.isnan(data)):
            raise ValueError('data must contain valid data')
        return

    # data must be stored in a xarray.DataArray object
    if not isinstance(data, xr.DataArray):
        raise TypeError('data not a numpy.ndarray or xarray.DataArray')

    if len(data.dims) != 2:
        raise ValueError('data must be two dimensional')
    if np.all(np.isnan(data.values)):
        raise ValueError('data must contain valid data')
    if method == 'ratio_unc':
        if data.error.ndim != 2:
            raise ValueError('data must be two dimensional')
        if np.all(np.isnan(data.error)):
            raise ValueError('data must contain valid error estimates')

    Make sure that the input data is 2-dimensional and contains valid data
    
Make sure that the input data is 2-dimensional and contains valid data
Make sure that the input data is 2 - dimensional and contains valid data
def check_data2d(method: str, data) -> None:
    if isinstance(data, np.ndarray):
        if data.ndim != 2:
            raise ValueError('data must be two dimensional')
        if np.all(np.isnan(data)):
            raise ValueError('data must contain valid data')
        return
    if not isinstance(data, xr.DataArray):
        raise TypeError('data not a numpy.ndarray or xarray.DataArray')
    if len(data.dims) != 2:
        raise ValueError('data must be two dimensional')
    if np.all(np.isnan(data.values)):
        raise ValueError('data must contain valid data')
    if method == 'ratio_unc':
        if data.error.ndim != 2:
            raise ValueError('data must be two dimensional')
        if np.all(np.isnan(data.error)):
            raise ValueError('data must contain valid error estimates')
def check_data2d ( method : str , data ) -> None : if isinstance ( data , np . ndarray ) : if data . ndim != 2 : raise ValueError ( 'data must be two dimensional' ) if np . all ( np . isnan ( data ) ) : raise ValueError ( 'data must contain valid data' ) return if not isinstance ( data , xr . DataArray ) : raise TypeError ( 'data not a numpy.ndarray or xarray.DataArray' ) if len ( data . dims ) != 2 : raise ValueError ( 'data must be two dimensional' ) if np . all ( np . isnan ( data . values ) ) : raise ValueError ( 'data must contain valid data' ) if method == 'ratio_unc' : if data . error . ndim != 2 : raise ValueError ( 'data must be two dimensional' ) if np . all ( np . isnan ( data . error ) ) : raise ValueError ( 'data must contain valid error estimates' )
Make sure that the input data is 2-dimensional and contains valid data
Make sure that the input data is 2 - dimensional and contains valid data
"""
    Make sure that the input data is 2-dimensional and contains valid data
    """ # data is stored in a numpy.ndarray # data must be stored in a xarray.DataArray object
method
str
data