Skip to content

Commit

Permalink
fix(daylight): Add output handler for grid metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
mikkelkp committed Jul 20, 2023
1 parent 6195796 commit d9b88a4
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions pollination_handlers/outputs/daylight.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Handlers for daylight simulation."""
import os
import json
import csv

from ladybug.datacollection import HourlyContinuousCollection
from .helper import read_sensor_grid_result, read_grid_results
Expand Down Expand Up @@ -144,3 +145,17 @@ def read_leed_shade_transmittance_schedule(shd_json):
results.append(datacollection)

return results


def read_grid_metrics(gr_metrics):
"""Read the grid metrics summary file."""
grid_metrics = []
with open(gr_metrics, 'r') as file:
gr_m = list(csv.DictReader(file))
for row in gr_m:
_gr_m = []
for key, value in row.items():
_gr_m.append('{}: {}'.format(key, value))
grid_metrics.append(_gr_m)

return grid_metrics

0 comments on commit d9b88a4

Please sign in to comment.