DSSGxUK / s22_wmca_app

WMCA APP

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

West Midlands Combined Authority (WMCA) and Pure LeapFrog Dashboard

For a quick demo, please follow the LINK HERE

CONTENTS OF THIS FILE

  • Introduction
  • Folder Structrue
  • Requirements
  • Installation on Local Device
  • Running on Local Device
  • Deploying your Dashboard
  • Recommended Tutorials
  • Maintainers

INTRODUCTION

The project provides a dashboard for visualising and finding clean energy potential areas in the WMCA local authority. The tool acts as a frontend to the all the machine learning models build to pin point areas of interest in a local authority. The project and code is open sourced and can be used by any local authority in the U.K. and other countries, given they have the correct data.

The repository for the machine learning algorithms can be accessed here.

FOLDER STRUCTURE

.
├── data                                           
│   ├── SJ9000.geojson                             # Map shapefile data
│   ├── full_dataset_outputs.csv                   # Map tabular data
│   ├── numerical_individual_columns_data_demo.csv # EPC Ratings data
│   ├── sample_outputs_demo.csv                    # Electric Heating data
│   └── sample_outputs_old_demo.csv                # Predicted Electric Heating data
├── images
│   ├── pure_leapfrog.png
│   ├── wmca.png
├── pages
│   ├── epc_rating.py                              # EPC Rating Prediction Model Page
│   ├── heating_type.py                            # Electric Heating Prediction Model Page
│   ├── heatmap.py                                 # Mother file for all heatmaps
│   ├── home.py                                    # Homepage
│   ├── map.py                                     # Mother file for all maps               
│   ├── solar_pv.py                                # Solar PV Prediction Model Page
├── LICENSE.md
├── README.md
├── main.py                                        # Main app runner file
└── requirements.txt                               # Required packages to run the app

REQUIREMENTS

This project requires the following modules:

For specific versions, please refer to requirements file.

INSTALLATION ON LOCAL DEVICE

  • Download the entire project either using git clone or download as zip option.

  • Once the folder is on your local device, open a new terminal window check the version of python on you device using python -v and install the compatible pip version for it.

  • Now check version of pip using pip -version and navigate to your project folder

  • Install all the packages in requirements.txt using pip (links for each installation command provided above).

  • Check for correct installation in your desired folder using the following commands: $ python and it will show the follwing message:

    Python 3.8.8 (default, Apr 13 2021, 12:59:45) 
    [Clang 10.0.0 ] :: Anaconda, Inc. on darwin
    Type "help", "copyright", "credits" or "license" for more information.
    >>>
    

    Use command

    import streamlit
    

    If the respose does not provide any error you have successfully installed all the dependencies.

RUNNING ON LOCAL DEVICE

  • Open a new Terminal window and navigate to the project folder. Use command

    streamlit main.py
    

    This would provide you a localhost link where the app is running. Something like this

    You can now view your Streamlit app in your browser.
    
    Local URL: http://localhost:8501
    Network URL: http://192.168.0.24:8501
    
  • Now you can navigate the app to explore more and create your own changes. (A preferable IDE for editing could be Visual Studio Code, PyCharm or Sublime).

DEPLOYING YOUR DASHBOARD

  • Sign up to Streamlit Cloud using your GitHub account. It is invitation based so you might need to wait to get you account. It is advised to do this step in advance.

  • You will recieve an invitation to you github email and follow the steps as mentioned.

    welcome_streamlitcloud
  • If you have made any changes to the code and introduced new packages, you will need to update the requirements.txt file. For this, open a new terminal window and navigate to the project folder. Use the command pip install pipreqs which will install the pipreqs for creating the requirements.txt file. Finally, use command pipreqs --force to overwrite the old requirements.txt file.

  • Update your GitHub repository with the current code on your local machine.

  • Now sign back in to your streamlit.io account and follow the instructions provided in the video below. (Instead of using streamlit_app.py as your Main Path use main.py - same as local device)

    streamlit_sharing_silent.mp4
  • Once deployed, you should be able to share the dashboard using the url.

    Screenshot 2022-08-23 at 18 38 52

RECOMMENDED TUTORIALS

MAINTAINERS & COLLAOBRATORS

Please reach out to us if you have any questions:

This project has been sponsored by:

  • Data Science For Social Good Program at University of Warwick Visit DSSG Warwick for more information.

About

WMCA APP

License:MIT License


Languages

Language:Python 85.1%Language:Jupyter Notebook 14.9%