diff --git a/CHANGELOG.md b/CHANGELOG.md index c8c9839..7c0ae85 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,8 @@ downtime, wakes, etc. - Adds the UWise comparison code and the updated configuration library `IEA_49/` to support the analysis. +- Fixes a bug where floating offshore substation design and installation results cause the + the code to error out when extracting substation results in ORBIT. ## v0.7 - 12 January 2026 diff --git a/waves/project.py b/waves/project.py index a510d00..2993fd6 100644 --- a/waves/project.py +++ b/waves/project.py @@ -508,10 +508,12 @@ def check_consistent_config(self) -> None: num_substations = {} if bool(self.orbit_config_dict): + orbit_num_substation = None num_turbines["orbit"] = self.orbit_config_dict["plant"]["num_turbines"] - orbit_num_substation = self.orbit_config_dict.get("oss_design", {}).get( - "num_substations" - ) + if (oss_design := self.orbit_config_dict.get("oss_design")) is not None: + orbit_num_substation = oss_design.get("num_substations") + elif (oss_design := self.orbit_config_dict.get("substation_design")) is not None: + orbit_num_substation = oss_design.get("num_substations") if orbit_num_substation is not None: num_substations["orbit"] = orbit_num_substation @@ -1127,13 +1129,16 @@ def n_substations(self) -> int: int The number of substations in the project. """ - if self.orbit_config is not None and "OffshoreSubstationDesign" not in self.orbit._phases: - return self.orbit_config_dict["oss_design"]["num_substations"] + if self.orbit_config is not None: + if "OffshoreSubstationDesign" in self.orbit._phases: + return self.orbit_config_dict["oss_design"]["num_substations"] + if "FloatingSubstationDesign" in self.orbit._phases: + return self.orbit_config_dict["substation_design"]["num_substations"] elif self.landbosse_config is not None: return 1 if self.wombat_config is not None: return len(self.wombat.windfarm.substation_id) - raise RuntimeError("No models were provided, cannot calculate value.") + raise RuntimeError("No models with substations were provided, cannot calculate value.") @validate_common_inputs(which=["units"]) def capacity(self, units: str = "mw") -> float: