From 42d221f84d6bb16a068ad306fba3db90107f46a6 Mon Sep 17 00:00:00 2001 From: adfarth Date: Tue, 30 Jan 2024 11:02:38 -0700 Subject: [PATCH] fix wind, update reopt version in erp --- CHANGELOG.md | 7 +++++++ reoptjl/validators.py | 4 ++-- resilience_stats/api.py | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 203af3443..dee997072 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,13 @@ Classify the change according to the following categories: ### Patches +## Develop - 2024-01-30 +### Minor Updates +#### Fixed +- Fixed Wind validation code to prevent erroring when user provides `production_factor_series` for location outside of WindToolkit bounds. +#### Changed +- Updated `reopt_version` in `ERPJob` to 0.39.1 + ## v3.4.0 ### Minor Updates #### Added diff --git a/reoptjl/validators.py b/reoptjl/validators.py index bb2d18875..288842522 100644 --- a/reoptjl/validators.py +++ b/reoptjl/validators.py @@ -288,7 +288,7 @@ def update_pv_defaults_offgrid(self, pvmodel): for time_series in ["production_factor_series"] + wind_resource_inputs: self.clean_time_series("Wind", time_series) - if not all([self.models["Wind"].__getattribute__(wr) for wr in wind_resource_inputs]): + if not all([self.models["Wind"].__getattribute__(wr) for wr in wind_resource_inputs]) and not self.models["Wind"].__getattribute__("production_factor_series"): # then no wind_resource_inputs provided, so we need to get the resource from WindToolkit if not lat_lon_in_windtoolkit(self.models["Site"].__getattribute__("latitude"), self.models["Site"].__getattribute__("longitude")): @@ -663,5 +663,5 @@ def lat_lon_in_windtoolkit(lat, lon): y = int(round((point[1] - origin[1]) / 2000)) y_max, x_max = (1602, 2976) if (x < 0) or (y < 0) or (x >= x_max) or (y >= y_max): - raise ValueError("Latitude/Longitude is outside of wind resource dataset bounds.") + return None return y, x diff --git a/resilience_stats/api.py b/resilience_stats/api.py index 8894a6561..fd2978acd 100644 --- a/resilience_stats/api.py +++ b/resilience_stats/api.py @@ -62,7 +62,7 @@ def obj_create(self, bundle, **kwargs): meta_dict = { "run_uuid": erp_run_uuid, - "reopt_version": "0.30.0", + "reopt_version": "0.39.1", "status": "Validating..." }