Closed bhilbert4 closed 1 year ago
@arminrest I think this is what you are looking for?
Literally all I did was take the if name=='main'
part of jwst_download.py and put it in a new script file (also called jwst_download.py) in a scripts
subdirectory. The jwst_download.py module was previously set up to be installed as a script. I think it may not have worked, but only because one of the import statements was written incorrectly. That's fixed in here as well. So in theory I think we could fix that import and probably be done. Or we could keep this separate script file as well.
Talked about this offline with Armin, and we decided it's ok to merge.
This PR reorganizes things under the hood, in a way that should be invisible to users. Rather than having the jwst_download.py module installed as a script, this PR creates a scripts subdirectory and creates a jwst_download.py script. The script simply imports the jwst_download.py module and runs it. The script essentially contains what used to be in the
if name==__main__
section of the jwst_download.py module.I've checked that when jwst_mast_query is installed, jwst_download.py is available as a script from any location, and that it queries MAST and downloads files successfully.