Skip to content

Commit

Permalink
refactor(methods): speed up edgps calc
Browse files Browse the repository at this point in the history
  • Loading branch information
taoning committed Oct 30, 2024
1 parent a2261aa commit 35ba1f8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions frads/methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -1232,7 +1232,7 @@ def calculate_edgps(
time: datetime,
dni: float,
dhi: float,
ambient_bounce: int = 1,
ambient_bounce: int = 0,
save_hdr: Optional[Union[str, Path]] = None,
) -> float:
"""Calculate enhanced simplified daylight glare probability (EDGPs) for a view.
Expand Down Expand Up @@ -1293,8 +1293,8 @@ def calculate_edgps(
if save_hdr is not None:
with open(save_hdr, "wb") as f:
f.write(hdr)
res = pr.evalglare(hdr, ev=ev.item())
edgps = float(res.split(b":")[1].split()[0])
res = pr.evalglare(hdr, fast=1, correction_mode="-l-", ev=ev.item())
edgps = float(res)
os.remove(octree)
return edgps

Expand Down
2 changes: 1 addition & 1 deletion frads/window.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ class Layer:
ir_transmittance: float
rgb: PaneRGB


@dataclass
class Gas:
"""Gas data object.
Expand Down Expand Up @@ -247,6 +246,7 @@ def get_layers(input: List[pwc.ProductData]) -> List[Layer]:
return layers



def create_pwc_gaps(gaps: List[Gap]):
"""Create a list of pwc gaps from a list of gaps."""
pwc_gaps = []
Expand Down

0 comments on commit 35ba1f8

Please sign in to comment.