Skip to content

Commit

Permalink
Addressed the deprecated support_vessel call in gravity-base install.…
Browse files Browse the repository at this point in the history
… Aligned install with moored install
  • Loading branch information
nRiccobo committed Jun 14, 2024
1 parent 08cae48 commit 41e57c2
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 8 deletions.
47 changes: 40 additions & 7 deletions ORBIT/phases/install/quayside_assembly_tow/gravity_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
__maintainer__ = "Jake Nunemaker"
__email__ = "[email protected]"

from warnings import warn

import simpy
from marmot import le, process

from ORBIT.core import Vessel, WetStorage
from ORBIT.phases.install import InstallPhase

Expand All @@ -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": {
Expand Down Expand Up @@ -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,
Expand Down
18 changes: 18 additions & 0 deletions tests/phases/install/quayside_assembly_tow/test_gravity_based.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
__maintainer__ = "Jake Nunemaker"
__email__ = "[email protected]"

from copy import deepcopy

import pandas as pd
import pytest
Expand Down Expand Up @@ -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()
2 changes: 1 addition & 1 deletion tests/phases/install/quayside_assembly_tow/test_moored.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 41e57c2

Please sign in to comment.