# 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
    args_ref = ['MLI_in', 'MLI_in_par', 'MLI_out', 'MLI_out_par', 'azlks', 'loff',
                'logpath', 'nlines', 'outdir', 'rlks', 'scale', 'shellscript']
    comp = [x in args for x in args_ref]
    assert sum(comp) == len(args_ref)
    
    assert getargs(isp.par_ASAR) == ['ASAR_ERS_file', 'K_dB', 'logpath', 'outdir', 'output_name', 'shellscript']
    assert getargs(isp.par_EORC_PALSAR) == ['CEOS_data', 'CEOS_leader', 'SLC', 'SLC_par',
                                            'logpath', 'outdir', 'shellscript']
    assert getargs(isp.par_ESA_ERS) == ['CEOS_DAT', 'CEOS_SAR_leader', 'SLC', 'SLC_par', 'inlist',
                                        'logpath', 'outdir', 'shellscript']
    
    args = getargs(isp.par_S1_GRD)
    args_ref = ['GRD', 'GRD_par', 'GeoTIFF', 'MLI', 'MLI_par', 'annotation_XML',
                'calibration_XML', 'eflg', 'logpath', 'noise_XML', 'noise_pwr',
                'outdir', 'rps', 'shellscript']
    comp = [x in args for x in args_ref]
    assert sum(comp) == len(args_ref)
    
    assert getargs(isp.par_S1_SLC) == ['GeoTIFF', 'SLC', 'SLC_par', 'TOPS_par', 'annotation_XML', 'calibration_XML',
                                       'dtype', 'logpath', 'noise_XML', 'noise_pwr', 'outdir', 'sc_dB', 'shellscript']
    assert getargs(isp.par_TX_GRD) == ['GRD', 'GRD_par', 'GeoTIFF', 'annotation_XML', 'logpath',
                                       'outdir', 'pol', 'shellscript']
    assert getargs(isp.par_TX_SLC) == ['COSAR', 'SLC', 'SLC_par', 'annotation_XML', 'logpath',
                                       'outdir', 'pol', 'shellscript']
    assert getargs(isp.radcal_MLI) == ['CMLI', 'K_dB', 'MLI', 'MLI_par', 'OFF_par', 'ant_flag', 'antenna', 'logpath',
                                       'outdir', 'pix_area', 'refarea_flag', 'rloss_flag', 'sc_dB', 'shellscript']
    assert getargs(isp.radcal_PRI) == ['GRD', 'GRD_par', 'K_dB', 'PRI', 'PRI_par',
                                       'inc_ref', 'loff', 'logpath', 'nl', 'nr',
                                       'outdir', 'roff', 'shellscript']
    assert getargs(isp.radcal_SLC) == ['CSLC', 'CSLC_par', 'K_dB', 'SLC', 'SLC_par',

# 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

    args_ref = ['MLI_in', 'MLI_in_par', 'MLI_out', 'MLI_out_par', 'azlks', 'loff',
                'logpath', 'nlines', 'outdir', 'rlks', 'scale', 'shellscript']
    comp = [x in args for x in args_ref]
    assert sum(comp) == len(args_ref)
    
    assert getargs(isp.par_ASAR) == ['ASAR_ERS_file', 'K_dB', 'logpath', 'outdir', 'output_name', 'shellscript']
    assert getargs(isp.par_EORC_PALSAR) == ['CEOS_data', 'CEOS_leader', 'SLC', 'SLC_par',
                                            'logpath', 'outdir', 'shellscript']
    assert getargs(isp.par_ESA_ERS) == ['CEOS_DAT', 'CEOS_SAR_leader', 'SLC', 'SLC_par', 'inlist',
                                        'logpath', 'outdir', 'shellscript']
    
    args = getargs(isp.par_S1_GRD)
    args_ref = ['GRD', 'GRD_par', 'GeoTIFF', 'MLI', 'MLI_par', 'annotation_XML',
                'calibration_XML', 'eflg', 'logpath', 'noise_XML', 'noise_pwr',
                'outdir', 'rps', 'shellscript']
    comp = [x in args for x in args_ref]
    assert sum(comp) == len(args_ref)
    
    assert getargs(isp.par_S1_SLC) == ['GeoTIFF', 'SLC', 'SLC_par', 'TOPS_par', 'annotation_XML', 'calibration_XML',
                                       'dtype', 'logpath', 'noise_XML', 'noise_pwr', 'outdir', 'sc_dB', 'shellscript']
    assert getargs(isp.par_TX_GRD) == ['GRD', 'GRD_par', 'GeoTIFF', 'annotation_XML', 'logpath',
                                       'outdir', 'pol', 'shellscript']
    assert getargs(isp.par_TX_SLC) == ['COSAR', 'SLC', 'SLC_par', 'annotation_XML', 'logpath',
                                       'outdir', 'pol', 'shellscript']
    assert getargs(isp.radcal_MLI) == ['CMLI', 'K_dB', 'MLI', 'MLI_par', 'OFF_par', 'ant_flag', 'antenna', 'logpath',
                                       'outdir', 'pix_area', 'refarea_flag', 'rloss_flag', 'sc_dB', 'shellscript']
    assert getargs(isp.radcal_PRI) == ['GRD', 'GRD_par', 'K_dB', 'PRI', 'PRI_par',
                                       'inc_ref', 'loff', 'logpath', 'nl', 'nr',
                                       'outdir', 'roff', 'shellscript']
    assert getargs(isp.radcal_SLC) == ['CSLC', 'CSLC_par', 'K_dB', 'SLC', 'SLC_par',

                                       'ant_flag', 'antenna', 'fcase', 'logpath', 'outdir',