Skip to content

Commit

Permalink
Support single building DES templates (#670)
Browse files Browse the repository at this point in the history
* support single building des

* cleanup

* update lock
  • Loading branch information
nllong authored Oct 25, 2024
1 parent 7a0f370 commit 1ae5ae8
Show file tree
Hide file tree
Showing 5 changed files with 137 additions and 82 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,12 @@ def build_from_template(self, output_dir: Path, project_name: str) -> None:
files_to_copy = []

# 1: grab all of the time series files and place them in the proper location
for building in self.system_parameters.get_param("$.buildings[?load_model=time_series]"):
time_series = self.system_parameters.get_param("$.buildings[?load_model=time_series]")
# If this is a dict, then there is only one building
if isinstance(time_series, dict):
time_series = [time_series]

for building in time_series:
building_load_file = Path(building["load_model_parameters"]["time_series"]["filepath"])
files_to_copy.append(
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,12 @@ def build_from_template(self, output_dir: Path, project_name: str) -> None:
files_to_copy = []

# 1: grab all of the time series files and place them in the proper location
for building in self.system_parameters.get_param("$.buildings[?load_model=time_series]"):
# If this is a dict, then there is only one building
time_series = self.system_parameters.get_param("$.buildings[?load_model=time_series]")
if isinstance(time_series, dict):
time_series = [time_series]

for building in time_series:
building_load_file = Path(building["load_model_parameters"]["time_series"]["filepath"])
files_to_copy.append(
{
Expand Down
Loading

0 comments on commit 1ae5ae8

Please sign in to comment.