# 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


@pytest.mark.skipif('diff' not in dir(api), reason='requires GAMMA installation with module DIFF')
def test_args_diff():
    assert getargs(diff.gc_map) == ['DEM', 'DEM_par', 'DEM_seg', 'DEM_seg_par', 'MLI_par', 'OFF_par', 'frame',
                                    'inc', 'lat_ovr', 'logpath', 'lon_ovr', 'lookup_table', 'ls_map', 'ls_mode',
                                    'outdir', 'pix', 'psi', 'r_ovr', 'shellscript', 'sim_sar', 'u', 'v']
    assert getargs(diff.gc_map_grd) == ['DEM', 'DEM_par', 'DEM_seg', 'DEM_seg_par', 'GRD_par', 'frame', 'inc',
                                        'lat_ovr', 'logpath', 'lon_ovr', 'lookup_table', 'ls_map', 'ls_mode', 'outdir',
                                        'pix', 'psi', 'r_ovr', 'shellscript', 'sim_sar', 'u', 'v']
    
    args = getargs(diff.geocode_back)
    args_ref = ['data_in', 'data_out', 'dtype', 'interp_mode', 'logpath', 'lookup_table',
                             'lr_in', 'lr_out', 'nlines_out', 'order', 'outdir', 'shellscript',
                             'width_in', 'width_out']
    comp = [x in args for x in args_ref]
    assert sum(comp) == len(args_ref)
    
    assert getargs(diff.par_EORC_PALSAR_geo) == ['CEOS_data', 'CEOS_leader', 'DEM_par', 'MLI',
                                                 'MLI_par', 'cal', 'logpath', 'outdir', 'shellscript']

# 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



@pytest.mark.skipif('diff' not in dir(api), reason='requires GAMMA installation with module DIFF')
def test_args_diff():
    assert getargs(diff.gc_map) == ['DEM', 'DEM_par', 'DEM_seg', 'DEM_seg_par', 'MLI_par', 'OFF_par', 'frame',
                                    'inc', 'lat_ovr', 'logpath', 'lon_ovr', 'lookup_table', 'ls_map', 'ls_mode',
                                    'outdir', 'pix', 'psi', 'r_ovr', 'shellscript', 'sim_sar', 'u', 'v']
    assert getargs(diff.gc_map_grd) == ['DEM', 'DEM_par', 'DEM_seg', 'DEM_seg_par', 'GRD_par', 'frame', 'inc',
                                        'lat_ovr', 'logpath', 'lon_ovr', 'lookup_table', 'ls_map', 'ls_mode', 'outdir',
                                        'pix', 'psi', 'r_ovr', 'shellscript', 'sim_sar', 'u', 'v']
    
    args = getargs(diff.geocode_back)
    args_ref = ['data_in', 'data_out', 'dtype', 'interp_mode', 'logpath', 'lookup_table',
                             'lr_in', 'lr_out', 'nlines_out', 'order', 'outdir', 'shellscript',
                             'width_in', 'width_out']
    comp = [x in args for x in args_ref]
    assert sum(comp) == len(args_ref)
    
    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',