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

UnboundLocalError #160

Closed
BiomedicLJZ opened this issue May 25, 2022 · 5 comments
Closed

UnboundLocalError #160

BiomedicLJZ opened this issue May 25, 2022 · 5 comments
Labels
bug Something isn't working

Comments

@BiomedicLJZ
Copy link

Describe the bug
`UnboundLocalError Traceback (most recent call last)
Input In [7], in <cell line: 3>()
1 from pysradb import SRAweb
2 db = SRAweb()
----> 3 df = db.sra_metadata('SRP098789')
4 df.head()

File ~\PycharmProjects\Tools\venv\lib\site-packages\pysradb\sraweb.py:516, in SRAweb.sra_metadata(self, srp, sample_attribute, detailed, expand_sample_attributes, output_read_lengths, **kwargs)
514 experiment_record["sample_title"] = exp_sample_name
515 experiment_record["instrument"] = exp_instrument
--> 516 experiment_record["instrument_model"] = exp_platform_model
517 experiment_record["instrument_model_desc"] = exp_platform_desc
518 experiment_record["total_spots"] = exp_total_spots

`
To Reproduce
from pysradb import SRAweb
db = SRAweb()
df = db.sra_metadata('any data')
df.

Desktop (please complete the following information):

  • OS: [Windows11]
  • Python version [e.g. 3.10]
  • Platform [Pycharm]

Additional context
I just used this oackage a week ago with this exact structure and worked fine
imagen_2022-05-24_222235489

@BiomedicLJZ BiomedicLJZ added the bug Something isn't working label May 25, 2022
@BiomedicLJZ
Copy link
Author

Also important to Report that the python env ist completely clean and that the code works in Google colab but i need it to be able to run in local

@saketkc
Copy link
Owner

saketkc commented May 27, 2022

Thanks, we should have caught this (seems to be coming from a change at the NCBI end though). Can you try pulling from the master branch and retry?

pip install git+https:://github.com/saketkc/pysradb

@jbmorlot
Copy link

Works for me, thanks!

@phyden
Copy link

phyden commented Jun 2, 2022

Hi. Thanks for fixing this problem. We also encountered it just today and wanted to report this..

Not neccessary at this point anymore. But here's our solution: it seems like xmltodict 0.13.0 is causing the problem. Downgrading it to 0.12.0 solved it for us.

edit: xmltodict 0.13.0 uses dict instead of OrderedDict now (as reported in the issue tracker of xmltodict)

@saketkc
Copy link
Owner

saketkc commented Jun 5, 2022

Thanks. This should now be fixed in v.1.4.

@saketkc saketkc closed this as completed Jun 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants