Skip to content

Commit

Permalink
Add in required gen outputs for solar
Browse files Browse the repository at this point in the history
  • Loading branch information
ppinchuk committed Jun 5, 2024
1 parent c2a4e0c commit 9090f2a
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions reV/generation/generation.py
Original file line number Diff line number Diff line change
Expand Up @@ -956,6 +956,14 @@ def _parse_output_request(self, req):
if "cf_mean" not in output_request:
output_request.append("cf_mean")

if _is_solar_run_with_ac_outputs(self.tech):
if "dc_ac_ratio" not in output_request:
output_request.append("dc_ac_ratio")
for dset in ["cf_mean", "cf_profile"]:
ac_dset = f"{dset}_ac"
if dset in output_request and ac_dset not in output_request:
output_request.append(ac_dset)

for request in output_request:
if request not in self.OUT_ATTRS:
msg = (
Expand Down Expand Up @@ -1100,3 +1108,10 @@ def run(self, out_fpath=None, max_workers=1, timeout=1800, pool_size=None):
raise e

return self._out_fpath


def _is_solar_run_with_ac_outputs(tech):
"""True if tech is pvwattsv8+"""
if "pvwatts" not in tech.casefold():
return False
return tech.casefold() not in {f"pvwattsv{i}" for i in range(8)}

0 comments on commit 9090f2a

Please sign in to comment.