def get_arg_parser() -> argparse.ArgumentParser: """Returns the parser for the command-line arguments for this pipeline.""" parser = argparse.ArgumentParser() # Parse arguments add_shared_pipeline_arguments(parser, include_calculation_limit_args=True) parser.add_argument('--metric_types', dest='metric_types', type=str, nargs='+', choices=[ 'ALL', SupervisionMetricType.ASSESSMENT_CHANGE.value, SupervisionMetricType.POPULATION.value, SupervisionMetricType.REVOCATION.value, SupervisionMetricType.REVOCATION_ANALYSIS.value, SupervisionMetricType.REVOCATION_VIOLATION_TYPE_ANALYSIS.value, SupervisionMetricType.SUCCESS.value, SupervisionMetricType.SUCCESSFUL_SENTENCE_DAYS_SERVED.value ], help='A list of the types of metric to calculate.', default={'ALL'}) return parser
def parse_arguments(argv): """Parses command-line arguments.""" parser = argparse.ArgumentParser() # Parse arguments add_shared_pipeline_arguments(parser) parser.add_argument('--calculation_month_limit', dest='calculation_month_limit', type=calculation_month_limit_arg, help='The number of months (including this one) to limit the monthly calculation output to. ' 'If set to -1, does not limit the calculations.', default=1) return parser.parse_known_args(argv)
def get_arg_parser() -> argparse.ArgumentParser: """Returns the parser for the command-line arguments for this pipeline.""" parser = argparse.ArgumentParser() # Parse arguments add_shared_pipeline_arguments(parser, include_calculation_limit_args=True) parser.add_argument('--metric_types', dest='metric_types', type=str, nargs='+', choices=['ALL', ProgramMetricType.REFERRAL.value], help='A list of the types of metric to calculate.', default={'ALL'}) return parser
def get_arg_parser() -> argparse.ArgumentParser: """Returns the parser for the command-line arguments for this pipeline.""" parser = argparse.ArgumentParser() # Parse arguments add_shared_pipeline_arguments(parser) parser.add_argument('--metric_types', dest='metric_types', type=str, nargs='+', choices=[ 'ALL', ReincarcerationRecidivismMetricType.COUNT.value, ReincarcerationRecidivismMetricType.RATE.value ], help='A list of the types of metric to calculate.', default={'ALL'}) return parser
def parse_arguments(argv): """Parses command-line arguments.""" parser = argparse.ArgumentParser() # Parse arguments add_shared_pipeline_arguments(parser) parser.add_argument('--include_release_facility', dest='include_release_facility', type=bool, help='Include metrics broken down by release facility.', default=True) parser.add_argument('--include_stay_length', dest='include_stay_length', type=bool, help='Include metrics broken down by stay length.', default=True) return parser.parse_known_args(argv)
def get_arg_parser(self) -> argparse.ArgumentParser: parser = argparse.ArgumentParser() add_shared_pipeline_arguments(parser, self.include_calculation_limit_args) metric_type_options: List[str] = self._metric_type_values metric_type_options.append("ALL") parser.add_argument( "--metric_types", dest="metric_types", type=str, nargs="+", choices=metric_type_options, help="A list of the types of metric to calculate.", default={"ALL"}, ) return parser
def get_arg_parser() -> argparse.ArgumentParser: """Returns the parser for the command-line arguments for this pipeline.""" parser = argparse.ArgumentParser() # Parse arguments add_shared_pipeline_arguments(parser) parser.add_argument( "--metric_types", dest="metric_types", type=str, nargs="+", choices=[ "ALL", ReincarcerationRecidivismMetricType.REINCARCERATION_COUNT.value, ReincarcerationRecidivismMetricType.REINCARCERATION_RATE.value, ], help="A list of the types of metric to calculate.", default={"ALL"}, ) return parser
def get_arg_parser() -> argparse.ArgumentParser: """Returns the parser for the command-line arguments for this pipeline.""" parser = argparse.ArgumentParser() # Parse arguments add_shared_pipeline_arguments(parser, include_calculation_limit_args=True) metric_type_options: List[str] = [ metric_type.value for metric_type in SupervisionMetricType ] metric_type_options.append('ALL') parser.add_argument('--metric_types', dest='metric_types', type=str, nargs='+', choices=metric_type_options, help='A list of the types of metric to calculate.', default={'ALL'}) return parser
def get_arg_parser() -> argparse.ArgumentParser: """Returns the parser for the command-line arguments for this pipeline.""" parser = argparse.ArgumentParser() # Parse arguments add_shared_pipeline_arguments(parser, include_calculation_limit_args=True) metric_type_options: List[str] = [ metric_type.value for metric_type in ProgramMetricType ] metric_type_options.append("ALL") parser.add_argument( "--metric_types", dest="metric_types", type=str, nargs="+", choices=metric_type_options, help="A list of the types of metric to calculate.", default={"ALL"}, ) return parser