def main(args=None): # # Top-level command that executes everything # # # Import plugins # import pyomo.environ # # Parse command-line options. # options = PySPConfigBlock() convertddsip_register_options(options) # # Prevent the compile_scenario_instances option from # appearing on the command line. This script relies on # the original constraints being present on the model # argparse_val = options.get('compile_scenario_instances')._argparse options.get('compile_scenario_instances')._argparse = None try: ap = argparse.ArgumentParser(prog='pyomo.pysp.convert.ddsip') options.initialize_argparse(ap) # restore the option so the class validation does not # raise an exception options.get('compile_scenario_instances')._argparse = argparse_val options.import_argparse(ap.parse_args(args=args)) except SystemExit as _exc: # the parser throws a system exit if "-h" is specified # - catch it to exit gracefully. return _exc.code return launch_command(run_convertddsip, options, error_label="pyomo.pysp.convert.ddsip: ", disable_gc=options.disable_gc, profile_count=options.profile, traceback=options.traceback)
def main(args=None): # # Top-level command that executes everything # # # Import plugins # import pyomo.environ # # Parse command-line options. # options = PySPConfigBlock() pysp2smps_register_options(options) # # Prevent the compile_scenario_instances option from # appearing on the command line. This script relies on # the original constraints being present on the model # argparse_val = options.get('compile_scenario_instances')._argparse options.get('compile_scenario_instances')._argparse = None try: ap = argparse.ArgumentParser(prog='pysp2smps') options.initialize_argparse(ap) # restore the option so the class validation does not # raise an exception options.get('compile_scenario_instances')._argparse = argparse_val options.import_argparse(ap.parse_args(args=args)) except SystemExit as _exc: # the parser throws a system exit if "-h" is specified # - catch it to exit gracefully. return _exc.code return launch_command(run_pysp2smps, options, error_label="pysp2smps: ", disable_gc=options.disable_gc, profile_count=options.profile, traceback=options.traceback)