UMEP-dev / SuPy

SUEWS that speaks Python
https://supy.readthedocs.io/
GNU General Public License v3.0
13 stars 7 forks source link

Problem with SuPy QuickStart tutorial #42

Closed rarygit closed 2 years ago

rarygit commented 2 years ago

OS: Ubuntu 20.04 Installed new conda environment to test supy with the tutorial "Quickstart of SuPy" Python v3.9 SuPy versions: supy: 2021.11.22 and supy_driver: 2021a2 SUEWS V2020a and accompanying test files (e.g. RunControl.nml) extracted to: /home/l1nux/Documents/SUEWS

Tutorial started OK in Jupyter Notebook Then threw an error at this command: df_state_init = sp.init_supy(path_runcontrol)

I do not understand the error output (exported as asciidoc; attached inside zip file). Any help much appreciated.

Looking again at the error output, I see that "None" is listed for certain python packages (e.g. pandas_datareader) Is this part of the problem?

Quickstart_SuPy.asciidoc.zip

sunt05 commented 2 years ago

Thanks @rarygit for reporting this issue. Based on the error message, it seems something wrong in the input files was causing the issue. Could you please also attach the RunControl.nml and other SUEWS input files (i.e. SUEWS_xxx.txt tables)?

rarygit commented 2 years ago

Thanks Ting for the quick reply.

Attached are the data files only, which were downloaded from Zenodo SUEWS Release 2020a https://zenodo.org/record/3828525

SUEWS_V2020a_Data.zip

rarygit commented 2 years ago

Tutorial "Set up SuPy for Your Own Site" ran very well, using dataset "US-AR1_2010_data_60.txt" https://supy.readthedocs.io/en/latest/tutorial/setup-own-site.html This tutorial aims to demonstrate how to set up SuPy for your own site to model the surface energy balance (SEB).

As you identified it, there must be an issue with decoding the characters in the .txt input files (" 'utf-8' codec can't decode byte 0xe4 in position 1330: invalid continuation byte"). I tested all the input files provided in the 2021a archive, from 2018a to 2021a. Same error occurred.

sunt05 commented 2 years ago

The issue is due to non-latin characters included in the comment of several SUEWS input files. A fix has been implemented and will be released later today.

Thanks @rarygit for reporting the issue!

rarygit commented 2 years ago

And thank you for fixing this! I have opened another Issue with the tutorial "Impact Studies Using SuPy"

sunt05 commented 2 years ago

Hi @rarygit , just to let you know the latest version of SuPy should have resolved this: https://pypi.org/project/supy/. But feel free to let me know if it persists. Thanks!

rarygit commented 2 years ago

Hi @Ting, I updated SuPy to the latest version and the Quick Start Tutorial finished OK, except for (trivial) errors, as below.

As I am learning SuPy at the same time as attempting to address the function "suews output --> epw input", I will use the Quick Start tutorial as a base case to provide suews output, where applicable, as input values for an epw file (UWG plugin). Unless that is not recommended?

Just for clarity, and if you have time, would you be able to clarify the reason for the trivial errors below? I have attached an asciidoc for the errors, and exported a pdf file for the completed Tutorial where I commented out the lines at Cells 2 and 6.

SuPy1_Trivial.Errors.asciidoc.zip SuPy1_Quickstart_OK.pdf

at Cell [2]: sp.show_version()

at Cell [6]: df_forcing=df_forcing.loc['2012'].iloc[1:]

I have included command "conda list" so that you can see what is running in the supytest environment. Previously "sp.show_version()" ran ok until I installed feather, which I regret, using pip: pip3 install feather ...... Uninstalling feather didn't help.

sunt05 commented 2 years ago

Hi @rarygit, please see below:

Hi @ting, I updated SuPy to the latest version and the Quick Start Tutorial finished OK, except for (trivial) errors, as below.

As I am learning SuPy at the same time as attempting to address the function "suews output --> epw input", I will use the Quick Start tutorial as a base case to provide suews output, where applicable, as input values for an epw file (UWG plugin). Unless that is not recommended?

I think it's good to use this as a starting point 👍🏼

Just for clarity, and if you have time, would you be able to clarify the reason for the trivial errors below? I have attached an asciidoc for the errors, and exported a pdf file for the completed Tutorial where I commented out the lines at Cells 2 and 6.

SuPy1_Trivial.Errors.asciidoc.zip SuPy1_Quickstart_OK.pdf

at Cell [2]: sp.show_version()

sorry, no idea - perhaps the feather you installed is an outdated one?.

at Cell [6]: df_forcing=df_forcing.loc['2012'].iloc[1:]

seems the year, 2012, is not in your forcing data? please double check this.

I have included command "conda list" so that you can see what is running in the supytest environment. Previously "sp.show_version()" ran ok until I installed feather, which I regret, using pip: pip3 install feather ...... Uninstalling feather didn't help.

rarygit commented 2 years ago

Thanks for replying!

seems the year, 2012, is not in your forcing data?

Correct. I should have used the data from this folder: https://github.com/UMEP-dev/SuPy/tree/master/src/supy/sample_run

And I removed modules "feather" and "feather-format"

Perfect, now everything runs OK! Many thanks for helping!