ladybug-tools / uwg

:city_sunrise: The Urban Weather Generator (uwg) is a Python application for modeling the urban heat island effect.
https://www.ladybug.tools/uwg/docs/
GNU General Public License v3.0
50 stars 24 forks source link

Build Status Coverage Status

Python 3.6 Python 2.7 IronPython

uwg

The Urban Weather Generator (uwg) is a Python application for modeling the urban heat island effect. Specifically, it morphs rural EnergyPlus weather (.epw) files to reflect average conditions within the urban canyon using a range of properties including:

The original Urban Weather Generator was developed by Bruno Bueno for his PhD thesis at MIT. Since this time, it has been validated 3 times and has been enhanced by Aiko Nakano. In 2016, Joseph Yang also improved the engine and added a range of building templates.

This repository is a Python translation of the original MATLAB Urban Weather Generator.

Example

Here is a Python example that shows how to create and run an Urban Weather Generator object.

from uwg import UWG

# Define the .epw, .uwg paths to create an uwg object.
epw_path = "resources/SGP_Singapore.486980_IWEC.epw" # available in resources directory.

# Initialize the UWG model by passing parameters as arguments, or relying on defaults
model = UWG.from_param_args(epw_path=epw_path, bldheight=10, blddensity=0.5,
                            vertohor=0.8, grasscover=0.1, treecover=0.1, zone='1A')

# Uncomment these lines to initialize the UWG model using a .uwg parameter file
# param_path = "initialize_singapore.uwg"  # available in resources directory.
# model = UWG.from_param_file(param_path, epw_path=epw_path)

model.generate()
model.simulate()

# Write the simulation result to a file.
model.write_epw()

Installation

pip install uwg

QuickStart

import uwg

API Documentation

Local Development

  1. Clone this repo locally
    
    git clone git@github.com:ladybug-tools/uwg

or

git clone https://github.com/ladybug-tools/uwg

2. Install dependencies:
```console
cd uwg
pip install -r dev-requirements.txt
pip install -r requirements.txt
  1. Run Tests:

    python -m pytest tests/
  2. Generate Documentation:

    sphinx-apidoc -f -e -d 4 -o ./docs ./uwg
    sphinx-build -b html ./docs ./docs/_build/docs