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

Streamlit is broken! #135

Closed
ryansurf opened this issue Aug 20, 2024 · 7 comments
Closed

Streamlit is broken! #135

ryansurf opened this issue Aug 20, 2024 · 7 comments
Assignees
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed

Comments

@ryansurf
Copy link
Owner

When querying a surf report on streamlit, we get the following error:

KeyError: 'height'
Traceback:
File "/home/ryan/.cache/pypoetry/virtualenvs/cli-surf-WsVlPvL3-py3.11/lib/python3.11/site-packages/streamlit/runtime/scriptrunner/exec_code.py", line 75, in exec_func_with_error_handling
    result = func()
             ^^^^^^
File "/home/ryan/.cache/pypoetry/virtualenvs/cli-surf-WsVlPvL3-py3.11/lib/python3.11/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 574, in code_to_exec
    exec(code, module.__dict__)
File "/home/ryan/ryan/code/cli-surf/src/dev_streamlit.py", line 85, in <module>
    df = sl_help.graph_data(report_dict, graph_type)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/ryan/ryan/code/cli-surf/src/streamlit_helper.py", line 68, in graph_data
    forecasted_heights = [
                         ^
File "/home/ryan/ryan/code/cli-surf/src/streamlit_helper.py", line 69, in <listcomp>
    forecast["height"] for forecast in report_dict["Forecast"]
    ~~~~~~~~^^^^^^^^^^

Apparently there's a key error. Recently, the names of the forecast keys have been changed. Look at the graph_data() function in streamlit_helper.py and the forecast_to_json function in helper.py to get an idea of the updated key names!

Note: This is meant to be a beginner-friendly issue. I've solved this myself, if you need help please ping me! To run streamlit, please refer to the README

@ryansurf ryansurf added bug Something isn't working help wanted Extra attention is needed good first issue Good for newcomers labels Aug 20, 2024
@balugans
Copy link
Contributor

Hi

I would like to help.

@balugans
Copy link
Contributor

balugans commented Aug 21, 2024

I tried running streamlit run src/dev_dreamlit.py and i get following error: ModuleNotFoundError: No module named 'streamlit_folium'. How do i resolve the error?

@balugans
Copy link
Contributor

I tried running streamlit run src/dev_dreamlit.py and i get following error: ModuleNotFoundError: No module named 'streamlit_folium'. How do i resolve the error?

I did pip install streamlit-folium. The best way would be to add streamlit-folium to pyproject.toml

@ryansurf
Copy link
Owner Author

I tried running streamlit run src/dev_dreamlit.py and i get following error: ModuleNotFoundError: No module named 'streamlit_folium'. How do i resolve the error?

I did pip install streamlit-folium. The best way would be to add streamlit-folium to pyproject.toml

Did you run make install?

@balugans
Copy link
Contributor

I tried running streamlit run src/dev_dreamlit.py and i get following error: ModuleNotFoundError: No module named 'streamlit_folium'. How do i resolve the error?

I did pip install streamlit-folium. The best way would be to add streamlit-folium to pyproject.toml

Did you run make install?

yes and i think streamlit-folium is not present in the toml file

@balugans
Copy link
Contributor

balugans commented Aug 21, 2024

i just did a PR for the fix PR#136 please review the changes

@ryansurf
Copy link
Owner Author

#136

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 help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants