diff --git a/ORBIT/phases/install/quayside_assembly_tow/gravity_base.py b/ORBIT/phases/install/quayside_assembly_tow/gravity_base.py index 665f6d7c..a25e4404 100644 --- a/ORBIT/phases/install/quayside_assembly_tow/gravity_base.py +++ b/ORBIT/phases/install/quayside_assembly_tow/gravity_base.py @@ -5,9 +5,11 @@ __maintainer__ = "Jake Nunemaker" __email__ = "jake.nunemaker@nrel.gov" +from warnings import warn import simpy from marmot import le, process + from ORBIT.core import Vessel, WetStorage from ORBIT.phases.install import InstallPhase @@ -25,11 +27,13 @@ class GravityBasedInstallation(InstallPhase): #: expected_config = { - "support_vessel": "str", + "support_vessel": "str, (optional)", + "ahts_vessel": "str", "towing_vessel": "str", "towing_vessel_groups": { "towing_vessels": "int", - "station_keeping_vessels": "int", + "station_keeping_vessels": "int (optional)", + "ahts_vessels": "int (optional, default: 1)", "num_groups": "int (optional)", }, "substructure": { @@ -210,20 +214,49 @@ def initialize_queue(self): def initialize_support_vessel(self, **kwargs): """ + ** The support vessel is deprecated and an AHTS + vessel will perform the installation with the towing group. + # TODO: determine if the installation process for GBF is still + sound. + Initializes Multi-Purpose Support Vessel to perform installation processes at site. """ - specs = self.config["support_vessel"] - vessel = self.initialize_vessel("Multi-Purpose Support Vessel", specs) + specs = self.config.get("support_vessel", None) + + if specs is not None: + warn( + "support_vessel will be deprecated and replaced with" + " towing_vessels and ahts_vessel in the towing groups.\n", + DeprecationWarning, + stacklevel=2, + ) + + specs = self.config["ahts_vessel"] + vessel = self.initialize_vessel("Multi-Purpose AHTS Vessel", specs) self.env.register(vessel) vessel.initialize(mobilize=False) self.support_vessel = vessel - station_keeping_vessels = self.config["towing_vessel_groups"][ - "station_keeping_vessels" - ] + station_keeping_vessels = self.config["towing_vessel_groups"].get( + "station_keeping_vessels", None + ) + + if station_keeping_vessels is not None: + print(station_keeping_vessels) + warn( + "['towing_vessl_groups]['station_keeping_vessels']" + " will be deprecated and replaced with" + " ['towing_vessl_groups]['ahts_vessels'].\n", + DeprecationWarning, + stacklevel=2, + ) + + station_keeping_vessels = self.config["towing_vessel_groups"].get( + "ahts_vessels", 1 + ) install_gravity_base_foundations( self.support_vessel, diff --git a/tests/phases/install/quayside_assembly_tow/test_gravity_based.py b/tests/phases/install/quayside_assembly_tow/test_gravity_based.py index dafad84b..84c57b9d 100644 --- a/tests/phases/install/quayside_assembly_tow/test_gravity_based.py +++ b/tests/phases/install/quayside_assembly_tow/test_gravity_based.py @@ -5,6 +5,7 @@ __maintainer__ = "Jake Nunemaker" __email__ = "jake.nunemaker@nrel.gov" +from copy import deepcopy import pandas as pd import pytest @@ -56,3 +57,20 @@ def test_for_complete_logging(weather, config): assert ~df["cost"].isnull().any() _ = sim.agent_efficiencies _ = sim.detailed_output + + +def test_deprecated_vessel(): + + deprecated = deepcopy(config) + deprecated["support_vessel"] = "test_support_vessel" + + with pytest.deprecated_call(): + sim = GravityBasedInstallation(deprecated) + sim.run() + + deprecated2 = deepcopy(config) + deprecated2["towing_vessel_groups"]["station_keeping_vessels"] = 2 + + with pytest.deprecated_call(): + sim = GravityBasedInstallation(deprecated2) + sim.run() diff --git a/tests/phases/install/quayside_assembly_tow/test_moored.py b/tests/phases/install/quayside_assembly_tow/test_moored.py index 3892495b..17dd0cb0 100644 --- a/tests/phases/install/quayside_assembly_tow/test_moored.py +++ b/tests/phases/install/quayside_assembly_tow/test_moored.py @@ -80,7 +80,7 @@ def test_for_complete_logging(weather, config): assert installed_mooring_lines == sim.num_turbines -def test_deprecated_landfall(): +def test_deprecated_vessel(): deprecated = deepcopy(config) deprecated["support_vessel"] = "test_support_vessel"