Skip to content

Commit

Permalink
feat(README): Add from_param_args model init method. (#144)
Browse files Browse the repository at this point in the history
  • Loading branch information
saeranv authored Nov 16, 2020
1 parent 98cc684 commit f8182ec
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,18 @@ Here is a Python example that shows how to create and run an Urban Weather Gener
```python
from uwg import UWG

# Define the .epw, .uwg filenames to create an uwg object.
# The initialize_singapore.uwg file referenced here is available in the
# resources directory.
epw_filename = "resources/SGP_Singapore.486980_IWEC.epw" # .epw file name
param_filename = "initialize_singapore.uwg" # .uwg file name

# Initialize the UWG object and run the simulation
model = UWG.from_param_file(param_filename, epw_filename)
# Define the .epw, .uwg paths to create an uwg object.
epw_path = "SGP_Singapore.486980_IWEC.epw"


# Initialize the UWG model by passing parameters as arguments, or relying on defaults
model = UWG.from_param_args(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 the resources directory.
# model = UWG.from_param_file(param_path, epw_path=epw_path)

model.generate()
model.simulate()

Expand Down

0 comments on commit f8182ec

Please sign in to comment.