Skip to content

Commit

Permalink
Merge pull request #38 from LBNL-ETA/use_epmodel
Browse files Browse the repository at this point in the history
Use epmodel
  • Loading branch information
taoning authored Oct 19, 2023
2 parents e83ea41 + d138cc5 commit 6cd26eb
Show file tree
Hide file tree
Showing 19 changed files with 12,522 additions and 1,885 deletions.
4 changes: 3 additions & 1 deletion docs/ref/epmodel.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
::: frads.EnergyPlusModel

::: frads.epjson2rad.epjson_to_rad
::: frads.EnergyPlusSetup

::: frads.epjson2rad.epmodel_to_radmodel
7 changes: 3 additions & 4 deletions frads/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@

import logging

from .epjson2rad import epjson_to_rad
from .ep2rad import epmodel_to_radmodel

from .eprad import EnergyPlusModel, EnergyPlusSetup, ep_datetime_parser
from .eplus import EnergyPlusModel, EnergyPlusSetup, ep_datetime_parser

from .matrix import (
load_matrix,
Expand Down Expand Up @@ -112,8 +112,7 @@
"WorkflowConfig",
"XENON",
"ep_datetime_parser",
"epjson2rad",
"epjson_to_rad",
"epmodel_to_radmodel",
"gen_grid",
"gen_perez_sky",
"genskymtx",
Expand Down
11 changes: 6 additions & 5 deletions frads/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
import pywincalc as pwc

from frads import ncp
from frads.eprad import EnergyPlusModel
from frads.epjson2rad import epjson_to_rad
from frads.eplus import load_energyplus_model
from frads.ep2rad import epmodel_to_radmodel
from frads.room import make_room
from frads.window import PaneRGB, get_glazing_primitive
from frads.matrix import (
Expand Down Expand Up @@ -150,12 +150,13 @@ def parse_mrad_config(cfg_path: Path) -> Dict[str, dict]:
}
config_dict["model"]["scene"]["files"] = config["Model"].getspaths("scene")
config_dict["model"]["materials"]["files"] = config["Model"].getspaths("material")
config_dict["model"]["materials"]["matrices"] = {k.stem: {"matrix_file":k} for k in config["Model"].getpaths("window_xmls")}
for wpath, xpath in zip(
config["Model"].getpaths("windows"), config["Model"].getpaths("window_xmls")
):
config_dict["model"]["windows"][wpath.stem] = {
"file": str(wpath),
"matrix_file": str(xpath),
"matrix_file": xpath.stem
}
if (grid_files := config["RaySender"].getspaths("grid_points")) is not None:
for gfile in grid_files:
Expand Down Expand Up @@ -469,10 +470,10 @@ def epjson2rad_cmd() -> None:
parser.add_argument("fpath", type=Path)
parser.add_argument("-run", action="store_true", default=False)
args = parser.parse_args()
epmodel = EnergyPlusModel(args.fpath)
epmodel = load_energyplus_model(args.fpath)
if "FenestrationSurface:Detailed" not in epmodel.epjs:
raise ValueError("No windows found in this model")
zones = epjson_to_rad(epmodel)
zones = epmodel_to_radmodel(epmodel)
for zone in zones:
write_ep_rad_model(f"{zone}.rad", zones[zone])

Expand Down
Loading

0 comments on commit 6cd26eb

Please sign in to comment.