-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Addressed the deprecated support_vessel call in gravity-base install.…
… Aligned install with moored install
- Loading branch information
Showing
3 changed files
with
59 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
||
|
@@ -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, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ | |
__maintainer__ = "Jake Nunemaker" | ||
__email__ = "[email protected]" | ||
|
||
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() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters