# Path: pyroSAR/ancillary.py
# def getargs(func):
#     """
#     get the arguments of a function
#     
#     Parameters
#     ----------
#     func: function
#         the function to be checked
# 
#     Returns
#     -------
#     list or str
#         the argument names
#     """
#     return sorted(inspect.getfullargspec(func).args)
# 
# Path: pyroSAR/gamma/api.py



import pytest
from pyroSAR.ancillary import getargs
from pyroSAR.gamma import api
    from pyroSAR.gamma.api import diff
    from pyroSAR.gamma.api import disp
    from pyroSAR.gamma.api import isp
    from pyroSAR.gamma.api import lat
    
    assert getargs(diff.par_EORC_PALSAR_geo) == ['CEOS_data', 'CEOS_leader', 'DEM_par', 'MLI',
                                                 'MLI_par', 'cal', 'logpath', 'outdir', 'shellscript']
    assert getargs(diff.par_TX_geo) == ['DEM_par', 'GEO', 'GeoTIFF', 'MLI_par', 'annotation_XML',
                                        'logpath', 'outdir', 'pol', 'shellscript']
    
    args = getargs(diff.pixel_area)
    args_ref = ['DEM', 'DEM_par', 'MLI_par', 'area_fact', 'inc_map', 'logpath', 'lookup_table',
                           'ls_map', 'nstep', 'outdir', 'pix_gamma0', 'pix_sigma0', 'shellscript']
    comp = [x in args for x in args_ref]
    assert sum(comp) == len(args_ref)


@pytest.mark.skipif('disp' not in dir(api), reason='requires GAMMA installation with module DISP')
def test_args_disp():
    
    args = getargs(disp.data2geotiff)
    args_ref = ['DEM_par', 'GeoTIFF', 'data', 'logpath', 'no_data', 'outdir', 'shellscript',
                             'type']
    comp = [x in args for x in args_ref]
    assert sum(comp) == len(args_ref)


@pytest.mark.skipif('isp' not in dir(api), reason='requires GAMMA installation with module ISP')
def test_args_isp():
    assert getargs(isp.multi_look) == ['MLI', 'MLI_par', 'SLC', 'SLC_par', 'azlks', 'exp', 'loff', 'logpath',
                                       'nlines', 'outdir', 'rlks', 'scale', 'shellscript']
    
    args = getargs(isp.multi_look_MLI)
    args_ref = ['MLI_in', 'MLI_in_par', 'MLI_out', 'MLI_out_par', 'azlks', 'loff',

# Path: pyroSAR/ancillary.py
# def getargs(func):
#     """
#     get the arguments of a function
#     
#     Parameters
#     ----------
#     func: function
#         the function to be checked
# 
#     Returns
#     -------
#     list or str
#         the argument names
#     """
#     return sorted(inspect.getfullargspec(func).args)
# 
# Path: pyroSAR/gamma/api.py



# Path: tests/test_gamma_args.py
import pytest
from pyroSAR.ancillary import getargs
from pyroSAR.gamma import api
    from pyroSAR.gamma.api import diff
    from pyroSAR.gamma.api import disp
    from pyroSAR.gamma.api import isp
    from pyroSAR.gamma.api import lat

    
    assert getargs(diff.par_EORC_PALSAR_geo) == ['CEOS_data', 'CEOS_leader', 'DEM_par', 'MLI',
                                                 'MLI_par', 'cal', 'logpath', 'outdir', 'shellscript']
    assert getargs(diff.par_TX_geo) == ['DEM_par', 'GEO', 'GeoTIFF', 'MLI_par', 'annotation_XML',
                                        'logpath', 'outdir', 'pol', 'shellscript']
    
    args = getargs(diff.pixel_area)
    args_ref = ['DEM', 'DEM_par', 'MLI_par', 'area_fact', 'inc_map', 'logpath', 'lookup_table',
                           'ls_map', 'nstep', 'outdir', 'pix_gamma0', 'pix_sigma0', 'shellscript']
    comp = [x in args for x in args_ref]
    assert sum(comp) == len(args_ref)


@pytest.mark.skipif('disp' not in dir(api), reason='requires GAMMA installation with module DISP')
def test_args_disp():
    
    args = getargs(disp.data2geotiff)
    args_ref = ['DEM_par', 'GeoTIFF', 'data', 'logpath', 'no_data', 'outdir', 'shellscript',
                             'type']
    comp = [x in args for x in args_ref]
    assert sum(comp) == len(args_ref)


@pytest.mark.skipif('isp' not in dir(api), reason='requires GAMMA installation with module ISP')
def test_args_isp():
    assert getargs(isp.multi_look) == ['MLI', 'MLI_par', 'SLC', 'SLC_par', 'azlks', 'exp', 'loff', 'logpath',
                                       'nlines', 'outdir', 'rlks', 'scale', 'shellscript']
    
    args = getargs(isp.multi_look_MLI)
    args_ref = ['MLI_in', 'MLI_in_par', 'MLI_out', 'MLI_out_par', 'azlks', 'loff',

                'logpath', 'nlines', 'outdir', 'rlks', 'scale', 'shellscript']