Mast observations
- Dominant language
- Python
- Stars
- 791
- Forks
- 451
- Avg merge
- 1d 3h
- Merged PRs (30d)
- 4
Description
Hello,
I came across some difficulty using the download_file method in astroquery/mast/observations.py when downloading just one file. I got a better result in my tasks when I added to lines 536:
# create a local file path if none is input. Use current directory as default.
filename = os.path.basename(uri)
if not local_path:
local_path = os.path.join(os.path.abspath ('.'), filename)
else:
local_path = os.path.join(os.path.abspath (local_path), filename)
I would like to suggest a modification of these lines in the code.
Best regards
Contributor guide
Research direction
Start in astroquery/mast/observations.py around line 536 and inspect how download_file handles a single file when local_path is omitted or supplied. Confirm the intended destination uses the downloaded URI's basename, then verify that single-file downloads land in the current directory or the requested directory without changing other behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- data
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100