Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add jwst_download.py script #32

Merged
merged 4 commits into from
Mar 23, 2023
Merged

Conversation

bhilbert4
Copy link
Collaborator

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.

@bhilbert4 bhilbert4 self-assigned this Mar 10, 2023
@bhilbert4
Copy link
Collaborator Author

@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.

@bhilbert4
Copy link
Collaborator Author

Talked about this offline with Armin, and we decided it's ok to merge.

@bhilbert4 bhilbert4 merged commit 44b81de into spacetelescope:main Mar 23, 2023
@bhilbert4 bhilbert4 deleted the create-script branch March 23, 2023 17:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant