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

Missing example data causes gdown script to fail #308

Open
chasemc opened this issue Mar 14, 2023 · 4 comments
Open

Missing example data causes gdown script to fail #308

chasemc opened this issue Mar 14, 2023 · 4 comments
Assignees
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@chasemc
Copy link
Member

chasemc commented Mar 14, 2023

There are some files that don't exist for all of the example datasets which causes the script to fail:

Access denied with the following error:

        Cannot retrieve the public link of the file. You may need to change
        the permission to 'Anyone with the link', or have had many accesses. 

You may still be able to access the file from the browser:



Traceback (most recent call last):
  File "/home/chase/miniconda3/envs/autometa/lib/python3.10/site-packages/pandas/core/indexes/multi.py", line 3090, in _get_loc_level
    return (self._engine.get_loc(key), None)
  File "pandas/_libs/index.pyx", line 782, in pandas._libs.index.BaseMultiIndexCodesEngine.get_loc
  File "pandas/_libs/index.pyx", line 138, in pandas._libs.index.IndexEngine.get_loc
  File "pandas/_libs/index.pyx", line 165, in pandas._libs.index.IndexEngine.get_loc
  File "pandas/_libs/hashtable_class_helper.pxi", line 1920, in pandas._libs.hashtable.UInt64HashTable.get_item
  File "pandas/_libs/hashtable_class_helper.pxi", line 1930, in pandas._libs.hashtable.UInt64HashTable.get_item
KeyError: 150

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/chase/miniconda3/envs/autometa/bin/autometa-download-dataset", line 8, in <module>
    sys.exit(main())
  File "/home/chase/miniconda3/envs/autometa/lib/python3.10/site-packages/autometa/validation/datasets.py", line 197, in main
    download(
  File "/home/chase/miniconda3/envs/autometa/lib/python3.10/site-packages/autometa/validation/datasets.py", line 63, in download
    file_id = df.loc[(community_size, file_name), "file_id"]
  File "/home/chase/miniconda3/envs/autometa/lib/python3.10/site-packages/pandas/core/indexing.py", line 1067, in __getitem__
    return self._getitem_tuple(key)
  File "/home/chase/miniconda3/envs/autometa/lib/python3.10/site-packages/pandas/core/indexing.py", line 1247, in _getitem_tuple
    return self._getitem_lowerdim(tup)
  File "/home/chase/miniconda3/envs/autometa/lib/python3.10/site-packages/pandas/core/indexing.py", line 941, in _getitem_lowerdim
    return self._getitem_nested_tuple(tup)
  File "/home/chase/miniconda3/envs/autometa/lib/python3.10/site-packages/pandas/core/indexing.py", line 1047, in _getitem_nested_tuple
    obj = getattr(obj, self.name)._getitem_axis(key, axis=axis)
  File "/home/chase/miniconda3/envs/autometa/lib/python3.10/site-packages/pandas/core/indexing.py", line 1312, in _getitem_axis
    return self._get_label(key, axis=axis)
  File "/home/chase/miniconda3/envs/autometa/lib/python3.10/site-packages/pandas/core/indexing.py", line 1260, in _get_label
    return self.obj.xs(label, axis=axis)
  File "/home/chase/miniconda3/envs/autometa/lib/python3.10/site-packages/pandas/core/generic.py", line 4049, in xs
    loc, new_index = index._get_loc_level(key, level=0)
  File "/home/chase/miniconda3/envs/autometa/lib/python3.10/site-packages/pandas/core/indexes/multi.py", line 3092, in _get_loc_level
    raise KeyError(key) from err
KeyError: ('2500Mbp', 'unclustered_recruitment.tsv.gz')
@chasemc chasemc added bug Something isn't working good first issue Good for newcomers labels Mar 14, 2023
@RajnishProgrammer
Copy link
Contributor

Hey, I wanna work on this issue can you guide me?

@evanroyrees
Copy link
Collaborator

Hello Rajnish, thank you for getting involved. I see you have submitted a pull request (#307), thanks so much! Generally we prefer new changes be pushed to the dev branch and then synchronize our branches with new releases. This way we can save ourselves from accidentally introducing bugs. It looks like you may have addressed all of the issues, but @chasemc and @ajlail98 may want to weigh in on next steps. Thanks again for your contributions! Feel free to tackle more! 😄

@RajnishProgrammer
Copy link
Contributor

Well, thanks! 😅

Hello Rajnish, thank you for getting involved. I see you have submitted a pull request (#307), thanks so much! Generally we prefer new changes be pushed to the dev branch and then synchronize our branches with new releases. This way we can save ourselves from accidentally introducing bugs. It looks like you may have addressed all of the issues, but @chasemc and @ajlail98 may want to weigh in on next steps. Thanks again for your contributions! Feel free to tackle more! 😄

@chasemc
Copy link
Member Author

chasemc commented Mar 16, 2023

Probably best to wrap

file_id = df.loc[(community_size, file_name), "file_id"]
file_id_filepath = os.path.join(community_size_outdir, file_name)
url = f"https://drive.google.com/uc?id={file_id}"
gdown.download(url, file_id_filepath)
in a non-failing try/except

The amount of data the script downloads is quite large, I would suggest making the suggested change and PR but maybe not testing it on your end

@evanroyrees evanroyrees changed the title MIssing example data causes gdown script to fail Missing example data causes gdown script to fail Aug 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

4 participants