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

extract argument didn't work as expected #71

Open
cansavvy opened this issue Oct 12, 2021 · 1 comment · May be fixed by #72
Open

extract argument didn't work as expected #71

cansavvy opened this issue Oct 12, 2021 · 1 comment · May be fixed by #72

Comments

@cansavvy
Copy link

cansavvy commented Oct 12, 2021

Problem:

I've been having fun with the refinebio python client. 🎉 (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",
    "[email protected]",
    experiments=["SRP070849"],
    extract=True
)

Based on this description from the quickstart

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.

Screen Shot 2021-10-12 at 11 29 31 AM

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.

shutil.unpack_archive(self._downloaded_path)

@cansavvy
Copy link
Author

I think whatever the issue is, you will need to do the same thing with the compendia.py.

@cansavvy cansavvy linked a pull request Oct 14, 2021 that will close this issue
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 a pull request may close this issue.

1 participant