AlertaDengue / PySUS

Library to download, clean and analyze openly available datasets from Brazilian Universal health system, SUS.
GNU General Public License v3.0
175 stars 68 forks source link

cannot import name 'last_update' from 'pysus.online_data' #121

Closed denisecammarota closed 1 year ago

denisecammarota commented 1 year ago

Good afternoon, I was trying to run the code on the Wiki Notebook for working with SINAN Data (https://github.com/AlertaDengue/PySUS/blob/master/docs/source/SINAN.ipynb), but the following error came up: ImportError: cannot import name 'last_update' from 'pysus.online_data' (/usr/local/lib/python3.9/dist-packages/pysus/online_data/__init__.py) when I try to import the function last_update as done in the tutorial. I did this in a Colab Notebook like the one in the tutorial after having installed the package. However, I also tried in my computer using WSL and got the same error. The rest seems to be working fine. For example, doing: SINAN.get_available_years('Dengue') tells me there are data available from 2000 to 2021, which I assume are the FINAL files (Apparently I can't see any preliminars for 2022 in that case, which I don't know if it's normal). Thank you, Denise.

fccoelho commented 1 year ago

Hi @denisecammarota, This is a small regression that escaped our eyes in the last release, when we made many changes to the online_data package. Thanks for reporting. I am pinging @luabida, who is responsible for this release, and I think he will be able to provide a workaround for this functionality.

fccoelho commented 1 year ago

meanwhile, You may choose to install a previous version of PySUS.

luabida commented 1 year ago

Hello @denisecammarota, thank you for reporting this issue, indeed the notebooks are outdated and I'll update them in the sequence. If you choose to use this version, you could change lu = last_update('SINAN') to lu = FTP_Inspect('SINAN').last_update_df() and you should receive the correct dataframe.

SINAN.get_available_years('Dengue') tells me there are data available from 2000 to 2021

Yes, 2022 is not current available on DataSUS server, so it is not possible to download it.

denisecammarota commented 1 year ago

Thanks @fccoelho and @luabida! I could use the workaround well

github-actions[bot] commented 1 year ago

:tada: This issue has been resolved in version 0.9.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: