Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
18 changes: 18 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: pre-commit
on:
push:
branches: [main, dev]
pull_request:
branches: [main, dev]
jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.13"

- name: Run pre-commit
uses: pre-commit/action@v3.0.1
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -115,5 +115,10 @@ docs/cables/Figs
# Pycharm
.idea/

# Other
# ORBIT-specific
Analysis/
examples/configs/array_system.yaml
examples/configs/export_system.yaml
examples/configs/mooring_system.yaml
examples/configs/oss.yaml
examples/configs/substructure.yaml
387 changes: 387 additions & 0 deletions CHANGELOG.md

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions CITATION.bib
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
@techreport{orbit_tech_report,
author={Nunemaker, Jacob and Shields, Matthew and Hammond, Robert and Duffy, Patrick},
title={ORBIT: Offshore Renewables Balance-of-System and Installation Tool},
institution={National Renewable Energy Laboratory (NREL), Golden, CO (United States)},
doi={10.2172/1660132},
url={https://www.osti.gov/biblio/1660132},
place={United States},
year={2020},
month={08}
}
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright [2020] [National Renewable Energy Laboratory]
Copyright [2026] [National Laboratory of the Rockies]

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
6 changes: 3 additions & 3 deletions ORBIT/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
"Rob Hammond",
"Nick Riccobono",
]
__copyright__ = "Copyright 2020, National Renewable Energy Laboratory"
__copyright__ = "Copyright 2026, National Laboratory of the Rockies"
__maintainer__ = "Nick Riccobono"
__email__ = ["nicholas.riccobono@nrel.gov", "rob.hammond@nrel.gov"]
__email__ = ["nicholas.riccobono@nlr.gov", "rob.hammond@nlr.gov"]
__status__ = "Development"


Expand All @@ -17,4 +17,4 @@
from ORBIT.parametric import ParametricManager
from ORBIT.supply_chain import SupplyChainManager

__version__ = "1.2.6"
__version__ = "1.3"
52 changes: 46 additions & 6 deletions ORBIT/config.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
"""Provides the configuration loading and saving methods."""

__author__ = "Jake Nunemaker"
__copyright__ = "Copyright 2020, National Renewable Energy Laboratory"
__copyright__ = "Copyright 2026, National Laboratory of the Rockies"
__maintainer__ = "Jake Nunemaker"
__email__ = "jake.nunemaker@nrel.gov"
__email__ = "jake.nunemaker@nlr.gov"


from pathlib import Path

import yaml
import numpy as np
from yaml import Dumper
from benedict.dicts import benedict

from ORBIT.core import loader

Expand All @@ -30,15 +32,49 @@ def load_config(filepath):
return data


def save_config(config, filepath, overwrite=False):
def prepare_config_for_save(config: dict | benedict) -> dict:
"""Prepare the configuration file for compatbility with the YAML
``SafeDump`` class used for saving configurations to file.

Parameters
----------
config : dict | benedict
ORBIT configuration dictionary.

Returns
-------
dict
ORBIT configuration dictionary where all NumPy data types are converted
to standard Python data types, e.g. ``np.float64`` -> ``float``.
"""
Save an ORBIT `config` to `filepath`.
for k, v in config.items():
match v:
case np.ndarray():
config[k] = v.tolist()
case np.floating():
config[k] = float(v)
case np.integer():
config[k] = int(v)
case benedict():
config[k] = prepare_config_for_save(v.dict())
case dict():
config[k] = prepare_config_for_save(v)
case _:
pass
return config


def save_config(
config: dict | benedict, filepath: str | Path, overwrite: bool = False
):
"""
Save an ORBIT configuration to :py:attr:`filepath`.

Parameters
----------
config : dict
config : dict | benedict
ORBIT configuration.
filepath : str
filepath : str | Path
Location to save config.
overwrite : bool (optional)
Overwrite file if it already exists. Default: False.
Expand All @@ -53,5 +89,9 @@ def save_config(config, filepath, overwrite=False):
if filepath.exists():
raise FileExistsError(f"File already exists at '{filepath}'.")

config = prepare_config_for_save(config)
if isinstance(config, benedict):
config = config.dict()

with filepath.open("w") as f:
yaml.dump(config, f, Dumper=Dumper, default_flow_style=False)
4 changes: 2 additions & 2 deletions ORBIT/core/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
"""Core functionality of ORBIT installation phases."""

__author__ = "Jake Nunemaker"
__copyright__ = "Copyright 2020, National Renewable Energy Laboratory"
__copyright__ = "Copyright 2026, National Laboratory of the Rockies"
__maintainer__ = "Jake Nunemaker"
__email__ = "jake.nunemaker@nrel.gov"
__email__ = "jake.nunemaker@nlr.gov"


from .port import Port, WetStorage
Expand Down
10 changes: 5 additions & 5 deletions ORBIT/core/components.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
"""Provides the `Crane` class."""

__author__ = "Jake Nunemaker"
__copyright__ = "Copyright 2020, National Renewable Energy Laboratory"
__copyright__ = "Copyright 2026, National Laboratory of the Rockies"
__maintainer__ = "Jake Nunemaker"
__email__ = "jake.nunemaker@nrel.gov"
__email__ = "jake.nunemaker@nlr.gov"

import simpy

Expand Down Expand Up @@ -88,12 +88,12 @@ def __init__(self, dp_specs):

def extract_dp_specs(self, dp_specs):
"""
Extracts and defines jacking system specifications.
Extracts and defines dynamic positioning system specifications.

Parameters
----------
jacksys_specs : dict
Dictionary containing jacking system specifications.
dp_specs : dict
Dictionary containing dynamic positioning system specifications.
"""

self.dp_class = dp_specs.get("class", 1)
Expand Down
4 changes: 2 additions & 2 deletions ORBIT/core/defaults/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
"""Default inputs used throughout ORBIT."""

__author__ = "Jake Nunemaker"
__copyright__ = "Copyright 2020, National Renewable Energy Laboratory"
__copyright__ = "Copyright 2026, National Laboratory of the Rockies"
__maintainer__ = "Jake Nunemaker"
__email__ = "jake.nunemaker@nrel.gov"
__email__ = "jake.nunemaker@nlr.gov"

from pathlib import Path

Expand Down
28 changes: 14 additions & 14 deletions ORBIT/core/defaults/common_costs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ substation_design:
topside_fab_cost_rate: 14500 # USD/t
topside_design_cost: # USD
#oldHVAC: 4.5e6
HVAC: 193140000
HVDC-monopole: 529200000
HVDC-bipole: 856800000
HVAC: 193140000
HVDC-monopole: 529200000
HVDC-bipole: 856800000
shunt_cost_rate: 44163 # USD/MW
mpt_unit_cost: 2992926 # USD/mpt
shunt_unit_cost: 10428 # USD/cable
Expand All @@ -38,27 +38,27 @@ substation_design:
topside_assembly_factor: 0.075 # %
converter_cost: # USD
HVAC: 0
HVDC-monopole: 228600000
HVDC-bipole: 532800000
HVDC-monopole: 228600000
HVDC-bipole: 532800000
oss_substructure_cost_rate: 3785 # USD/t
oss_pile_cost_rate: 0 # USD/t

# Onshore substation component cost rates
onshore_substation_design:
onshore_converter_cost: # USD
HVAC: 0
HVDC-monopole: 163724546
HVDC-bipole: 364991025
HVAC: 0
HVDC-monopole: 163724546
HVDC-bipole: 364991025
shunt_unit_cost: 13557 # USD/cable
switchgear_cost: 9729618 # USD/cable
compensation_rate: # USD/cable
HVAC: 32640626
HVDC-monopole: 0
HVDC-bipole: 0
HVAC: 32640626
HVDC-monopole: 0
HVDC-bipole: 0
onshore_construction_rate: # USD
HVAC: 5214158
HVDC-monopole: 91039190
HVDC-bipole: 104283150
HVAC: 5214158
HVDC-monopole: 91039190
HVDC-bipole: 104283150

# Semisubmersible component cost rates
semisubmersible_design:
Expand Down
4 changes: 2 additions & 2 deletions ORBIT/core/environment.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
"""ORBIT specific marmot.Environment."""

__author__ = "Jake Nunemaker"
__copyright__ = "Copyright 2020, National Renewable Energy Laboratory"
__copyright__ = "Copyright 2026, National Laboratory of the Rockies"
__maintainer__ = "Jake Nunemaker"
__email__ = "jake.nunemaker@nrel.gov"
__email__ = "jake.nunemaker@nlr.gov"


from bisect import bisect
Expand Down
4 changes: 2 additions & 2 deletions ORBIT/core/exceptions.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
"""Custom exceptions used throughout ORBIT."""

__author__ = "Jake Nunemaker"
__copyright__ = "Copyright 2020, National Renewable Energy Laboratory"
__copyright__ = "Copyright 2026, National Laboratory of the Rockies"
__maintainer__ = "Jake Nunemaker"
__email__ = "jake.nunemaker@nrel.gov"
__email__ = "jake.nunemaker@nlr.gov"


import os
Expand Down
4 changes: 2 additions & 2 deletions ORBIT/core/library.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
"""

__author__ = "Rob Hammond"
__copyright__ = "Copyright 2020, National Renewable Energy Laboratory"
__copyright__ = "Copyright 2026, National Laboratory of the Rockies"
__maintainer__ = "Rob Hammond"
__email__ = "rob.hammond@nrel.gov"
__email__ = "rob.hammond@nlr.gov"


import os
Expand Down
4 changes: 2 additions & 2 deletions ORBIT/core/logic/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
"""Provides the simulation logic shared across several modules."""

__author__ = "Jake Nunemaker"
__copyright__ = "Copyright 2020, National Renewable Energy Laboratory"
__copyright__ = "Copyright 2026, National Laboratory of the Rockies"
__maintainer__ = "Jake Nunemaker"
__email__ = "jake.nunemaker@nrel.gov"
__email__ = "jake.nunemaker@nlr.gov"


from .vessel_logic import ( # shuttle_items_to_queue
Expand Down
4 changes: 2 additions & 2 deletions ORBIT/core/logic/vessel_logic.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
"""Provides common simulation logic related to vessels."""

__author__ = ["Jake Nunemaker", "Rob Hammond"]
__copyright__ = "Copyright 2020, National Renewable Energy Laboratory"
__copyright__ = "Copyright 2026, National Laboratory of the Rockies"
__maintainer__ = "Jake Nunemaker"
__email__ = "jake.nunemaker@nrel.gov"
__email__ = "jake.nunemaker@nlr.gov"


from marmot import process
Expand Down
4 changes: 2 additions & 2 deletions ORBIT/core/port.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
"""Provides the `Port` class."""

__author__ = "Jake Nunemaker"
__copyright__ = "Copyright 2020, National Renewable Energy Laboratory"
__copyright__ = "Copyright 2026, National Laboratory of the Rockies"
__maintainer__ = "Jake Nunemaker"
__email__ = "jake.nunemaker@nrel.gov"
__email__ = "jake.nunemaker@nlr.gov"


import simpy
Expand Down
4 changes: 2 additions & 2 deletions ORBIT/core/supply_chain.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
"""Supply chain related infrastructure."""

__author__ = "Jake Nunemaker"
__copyright__ = "Copyright 2022, National Renewable Energy Laboratory"
__copyright__ = "Copyright 2022, National Laboratory of the Rockies"
__maintainer__ = "Jake Nunemaker"
__email__ = "jake.nunemaker@nrel.gov"
__email__ = "jake.nunemaker@nlr.gov"

from marmot import Agent, process

Expand Down
4 changes: 2 additions & 2 deletions ORBIT/core/vessel.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
"""Provides the `Vessel` class."""

__author__ = ["Jake Nunemaker", "Rob Hammond"]
__copyright__ = "Copyright 2020, National Renewable Energy Laboratory"
__copyright__ = "Copyright 2026, National Laboratory of the Rockies"
__maintainer__ = "Jake Nunemaker"
__email__ = "jake.nunemaker@nrel.gov"
__email__ = "jake.nunemaker@nlr.gov"

from collections import Counter, namedtuple

Expand Down
Loading
Loading