import argparse
import astropy.io.fits as fits
import numpy as np

import calc
import combine

if __name__=="__main__":
    argparser = argparse.ArgumentParser()
    subparsers = argparser.add_subparsers(help="sub-command help")
    calc.create_parser(subparsers)
    combine.create_parser(subparsers)
    args = argparser.parse_args()
    print(args)
    args.func(args)


import argparse

import calc
import combine

from combine import stack_fits_data
from calc import load_fits_data

def _argparse():
    argparser = argparse.ArgumentParser()
    subparsers = argparser.add_subparsers(help="sub-command help")
    calc.create_parser(subparsers)
    combine.create_parser(subparsers)
    return argparser.parse_args()

def main():
    args = _argparse()
    args.func(args)

if __name__=="__main__":
    main()

Create main() entry point for final script
Create main() entry point for final script

Signed-off-by: Lizhou Sha <d6acb26e253550574bc1141efa0eb5e6de15daeb@mit.edu>

  import argparse
- import astropy.io.fits as fits
- import numpy as np
  
  import calc
  import combine
  
- if __name__=="__main__":
+ from combine import stack_fits_data
+ from calc import load_fits_data
+ 
+ def _argparse():
      argparser = argparse.ArgumentParser()
      subparsers = argparser.add_subparsers(help="sub-command help")
      calc.create_parser(subparsers)
      combine.create_parser(subparsers)
-     args = argparser.parse_args()
+     return argparser.parse_args()
-     print(args)
+ 
+ def main():
+     args = _argparse()
      args.func(args)
  
+ if __name__=="__main__":
+     main()
  
Create main() entry point for final script
## Code Before:
import argparse
import astropy.io.fits as fits
import numpy as np

import calc
import combine

if __name__=="__main__":
    argparser = argparse.ArgumentParser()
    subparsers = argparser.add_subparsers(help="sub-command help")
    calc.create_parser(subparsers)
    combine.create_parser(subparsers)
    args = argparser.parse_args()
    print(args)
    args.func(args)


## Instruction:
Create main() entry point for final script
## Code After:
import argparse

import calc
import combine

from combine import stack_fits_data
from calc import load_fits_data

def _argparse():
    argparser = argparse.ArgumentParser()
    subparsers = argparser.add_subparsers(help="sub-command help")
    calc.create_parser(subparsers)
    combine.create_parser(subparsers)
    return argparser.parse_args()

def main():
    args = _argparse()
    args.func(args)

if __name__=="__main__":
    main()
