# 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(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',
                                       'pix_area', 'refarea_flag', 'rloss_flag', 'sc_dB', 'shellscript']
    assert getargs(isp.S1_OPOD_vec) == ['OPOD', 'SLC_par', 'logpath', 'nstate', 'outdir', 'shellscript']
    
    args = getargs(isp.SLC_deramp_ScanSAR)
    args_ref = ['SLC1_tab', 'SLC2_tab', 'logpath', 'mode', 'outdir',
                'phflg', 'shellscript']
    comp = [x in args for x in args_ref]
    assert sum(comp) == len(args_ref)
    
    print(args_ref)
    args_ref = ['SLC', 'SLCR_tab', 'SLC_par', 'SLC_tab', 'azlks', 'logpath',
                'outdir', 'rlks', 'shellscript', 'bflg']
    args = getargs(isp.SLC_mosaic_S1_TOPS)
    comp = [x in args for x in args_ref]
    assert sum(comp) == len(args_ref)



# 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(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',
                                       'pix_area', 'refarea_flag', 'rloss_flag', 'sc_dB', 'shellscript']
    assert getargs(isp.S1_OPOD_vec) == ['OPOD', 'SLC_par', 'logpath', 'nstate', 'outdir', 'shellscript']
    
    args = getargs(isp.SLC_deramp_ScanSAR)
    args_ref = ['SLC1_tab', 'SLC2_tab', 'logpath', 'mode', 'outdir',
                'phflg', 'shellscript']
    comp = [x in args for x in args_ref]
    assert sum(comp) == len(args_ref)
    
    print(args_ref)
    args_ref = ['SLC', 'SLCR_tab', 'SLC_par', 'SLC_tab', 'azlks', 'logpath',
                'outdir', 'rlks', 'shellscript', 'bflg']
    args = getargs(isp.SLC_mosaic_S1_TOPS)
    comp = [x in args for x in args_ref]
    assert sum(comp) == len(args_ref)



@pytest.mark.skipif('lat' not in dir(api), reason='requires GAMMA installation with module LAT')