Skip to content

yaml_argparse

YamlArgparse

Source code in src/compass/utils/yaml_argparse.py
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
class YamlArgparse():
    def __init__(self, add_grid_type=False):
        '''Initialize YamlArgparse class and parse CLI arguments for COMPASS.'''
        parser = argparse.ArgumentParser(description='', formatter_class=argparse.ArgumentDefaultsHelpFormatter)
        parser.add_argument('run_config_path', type=str, nargs='?', default=None, help='Path to run config file')

        # additional arguments for s1_cslc.py
        if add_grid_type:
            parser.add_argument('-g','--grid','--grid-type', dest='grid_type', type=str,
                                default='geo', choices=['geo', 'radar'],
                                help='Grid (coordinates) type of the output CSLC')

        # parse arguments
        self.args = parser.parse_args()

    @property
    def run_config_path(self) -> str:
        return self.args.run_config_path

__init__(add_grid_type=False)

Initialize YamlArgparse class and parse CLI arguments for COMPASS.

Source code in src/compass/utils/yaml_argparse.py
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
def __init__(self, add_grid_type=False):
    '''Initialize YamlArgparse class and parse CLI arguments for COMPASS.'''
    parser = argparse.ArgumentParser(description='', formatter_class=argparse.ArgumentDefaultsHelpFormatter)
    parser.add_argument('run_config_path', type=str, nargs='?', default=None, help='Path to run config file')

    # additional arguments for s1_cslc.py
    if add_grid_type:
        parser.add_argument('-g','--grid','--grid-type', dest='grid_type', type=str,
                            default='geo', choices=['geo', 'radar'],
                            help='Grid (coordinates) type of the output CSLC')

    # parse arguments
    self.args = parser.parse_args()