AlexsLemonade / AlexsLemonade/refinebio-py
`extract` argument didn't work as expected
- Dominant language
- Python
- Stars
- 1
- Forks
- 3
- PR merge metrics
- No merged PRs in 30d
Description
### Problem:
I've been having fun with the refinebio python client. :tada: (Not sure if you guys are looking for people to test this yet but too late).
I ran this kinda thing and hoped to download and extract data to a folder called `data`:
```
os.mkdir("data", mode = 0o777)
pyrefinebio.create_token(agree_to_terms=True, save_token=False)
pyrefinebio.download_dataset(
"data/dataset.zip",
"cansav09@gmail.com",
experiments=["SRP070849"],
extract=True
)
```
Based on this [description from the quickstart](https://alexslemonade.github.io/refinebio-py/quickstart.html#downloading-datasets)
> extract can be used to choose whether the downloaded zip file should be automatically extracted. It will automatically extract to the same location that you passed in as path. So if path is a zip file: ./path/to/dataset.zip it will be extracted to the dir ./path/to/dataset/, if path is a dir: ./path/to/dir/ it will be extracted to ./path/to/dir/[generated-file-name]/. By default, extract is False.
I expected to find the files inside my `data` directory if I used `extract=True`.
But instead my files did not go into my `data` directory, only the original zip file went there.

### Solution (I think):
I think this needs to use the `extract_dir` based on the from the `path` that's passed in. But I'm not 100% sure. https://github.com/AlexsLemonade/refinebio-py/blob/6a16ef9d2b886196547b074da091ccb45d1f774c/pyrefinebio/dataset.py#L295
Contributor guide
No contributing guide indexed for this repository
Research direction
Start in pyrefinebio/dataset.py around the linked line and trace download_dataset with extract=True and a zip path under data/. Reproduce the quickstart example, inspect where extraction is directed, and verify that the downloaded files appear in the expected data directory while retaining the zip file.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100