architecture-building-systems / CityEnergyAnalyst

The City Energy Analyst (CEA)
https://www.cityenergyanalyst.com/
MIT License
195 stars 65 forks source link

As a Developer, I want to split the use_types databases into a .csv and a .json component to make data validation easier #2642

Closed daren-thomas closed 3 years ago

daren-thomas commented 4 years ago

As part of the effort to make schemas.yml a single point of truth for information about the contents of the files used by the CEA (schemas, descriptions etc.), the following files pose a problem:

e.g. cea/databases/CH/archetypes/use_types/COOLROOM.csv

You see, they're supposed to be .csv files, but they're not. They're a Frankenfiletype, with some header data before the actual schedule data. Take a look at the first few lines:

METADATA,CH-SIA-2014,COOLROOM
MONTHLY_MULTIPLIER,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0
DAY,HOUR,OCCUPANCY,APPLIANCES,LIGHTING,WATER,HEATING,COOLING,PROCESSES,SERVERS,ELECTROMOBILITY
WEEKDAY,1,0.0,0.4,0.4,0.0,SETPOINT,SETPOINT,1.0,0.0,0.0
WEEKDAY,2,0.0,0.4,0.4,0.0,SETPOINT,SETPOINT,1.0,0.0,0.0
WEEKDAY,3,0.0,0.4,0.4,0.0,SETPOINT,SETPOINT,1.0,0.0,0.0

I suggest we split these into two files:

DAY,HOUR,OCCUPANCY,APPLIANCES,LIGHTING,WATER,HEATING,COOLING,PROCESSES,SERVERS,ELECTROMOBILITY
WEEKDAY,1,0.0,0.4,0.4,0.0,SETPOINT,SETPOINT,1.0,0.0,0.0
WEEKDAY,2,0.0,0.4,0.4,0.0,SETPOINT,SETPOINT,1.0,0.0,0.0
WEEKDAY,3,0.0,0.4,0.4,0.0,SETPOINT,SETPOINT,1.0,0.0,0.0

In fact, with this change, the file USE_TYPE_PROPERTIES.xlsx can be replaced, as the information would easily fit into the YAML file!

The conversion of the databases can be done automatically. The existence of "USE_TYPE_PROPERTIES.xlsx" can be used as a database migrator trigger and the result would be a cleaner input data specification.

jimenofonseca commented 4 years ago

we decided to not go for this in the last meeting. many more files does not seem like a solution. any other alternative @gabriel-happle @martin-mosteiro @daren-thomas @shanshanhsieh @reyery ideas?