30 lines
1.1 KiB
Python
30 lines
1.1 KiB
Python
"""
|
|
PhysicsFactory retrieve the specific physics module for the given region
|
|
SPDX - License - Identifier: LGPL - 3.0 - or -later
|
|
Copyright © 2020 Project Author Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
|
|
"""
|
|
import pandas as pd
|
|
from occupancy.occupancy_feeders.helpers.occupancy_helper import OccupancyHelper
|
|
|
|
|
|
class DemoOccupancyParameters:
|
|
|
|
def __init__(self, city, base_path):
|
|
self._city = city
|
|
self._demo_schedules_path = base_path / 'demo_schedules.xlsx'
|
|
xls = pd.ExcelFile(self._demo_schedules_path)
|
|
for building in city.buildings:
|
|
schedules = dict()
|
|
occupancy = pd.read_excel(xls, sheet_name=OccupancyHelper.pluto_occupancy_function(building.function),
|
|
skiprows=[0, 1, 2, 3], nrows=39, usecols="A:AA")
|
|
for index in range(0, 13):
|
|
row = occupancy.iloc[3 * index]
|
|
data = row[1:]
|
|
name = row[0]
|
|
for i in range(1, 3):
|
|
row = occupancy.iloc[3*index + i]
|
|
data1 = row[1:]
|
|
data = pd.concat([data, data1], axis=1)
|
|
schedules[name] = data
|
|
print(schedules)
|