Skip to content

Commit eafbd49

Browse files
authored
Merge pull request #31 from FloatingArrayDesign/dev
dev -> main, representing the v1.0.0 release
2 parents 6c58005 + 00f5c58 commit eafbd49

285 files changed

Lines changed: 204964 additions & 23159 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/CI_FAD.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: CI_FAD
2+
3+
# Run CI on push commits and pull requests on main branches and dev
4+
on:
5+
push:
6+
branches: [ main, dev ]
7+
pull_request:
8+
branches: [ main, dev ]
9+
# Allow manual triggering of the workflow
10+
workflow_dispatch:
11+
12+
# Workflow jobs for comprehensive testing
13+
jobs:
14+
# Comprehensive integration tests
15+
build_conda:
16+
name: Conda Build (${{ matrix.os }}) - Python ${{ matrix.python-version }}
17+
runs-on: ${{ matrix.os }}
18+
defaults:
19+
run:
20+
shell: bash -el {0}
21+
22+
strategy:
23+
fail-fast: false
24+
matrix:
25+
os: ["ubuntu-latest", "macOS-latest", "windows-latest"]
26+
python-version: ["3.11"]
27+
28+
29+
steps:
30+
- name: Checkout repository
31+
uses: actions/checkout@v4
32+
33+
- name: Setup Miniconda
34+
uses: conda-incubator/setup-miniconda@v3
35+
with:
36+
# Use mamba for faster package resolution
37+
#mamba-version: "*"
38+
miniforge-version: "latest"
39+
auto-update-conda: true
40+
python-version: ${{ matrix.python-version }}
41+
environment-file: fad-env.yaml
42+
activate-environment: fad-env
43+
auto-activate-base: false
44+
channels: conda-forge
45+
channel-priority: true
46+
#use-mamba: true
47+
48+
- name: Install additional dependencies
49+
run: |
50+
conda install -y pytest meson ninja nlopt
51+
pip install scipy==1.11.2 # specific SciPy version needed for current LineDesign test results
52+
conda info
53+
54+
- name: Install FAD-Toolset package
55+
run: |
56+
pip install -e .
57+
58+
- name: Update MoorPy to dev version
59+
run: |
60+
pip uninstall -y moorpy # need to uninstall the old version to install the current dev branch
61+
pip install git+https://github.com/NREL/MoorPy@dev
62+
63+
- name: Run example driver
64+
run: |
65+
cd examples
66+
python example_driver.py false
67+
68+
- name: Run comprehensive tests
69+
run: |
70+
cd tests
71+
pytest .
72+

.github/workflows/CI_FAModel.yml

Lines changed: 0 additions & 62 deletions
This file was deleted.

LICENSE

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
BSD 3-Clause License
2+
3+
Copyright (c) 2026, The NLR Floating Array Design Team
4+
5+
Redistribution and use in source and binary forms, with or without
6+
modification, are permitted provided that the following conditions are met:
7+
8+
1. Redistributions of source code must retain the above copyright notice, this
9+
list of conditions and the following disclaimer.
10+
11+
2. Redistributions in binary form must reproduce the above copyright notice,
12+
this list of conditions and the following disclaimer in the documentation
13+
and/or other materials provided with the distribution.
14+
15+
3. Neither the name of the copyright holder nor the names of its
16+
contributors may be used to endorse or promote products derived from
17+
this software without specific prior written permission.
18+
19+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
23+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
25+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
26+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
27+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

README.md

Lines changed: 66 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,23 @@ modeling and designing arrays of floating offshore structures. It was
55
originally designed for floating wind systems but has applicability
66
for many offshore applications.
77

8-
A core part of the FAD Toolset is the Floating Array Model (FAModel),
8+
A core part of the FAD Toolset is the floating array model,
99
which serves as a high-level library for efficiently
10-
modeling a floating wind array. It combines site condition information and a
10+
modeling a floating array, such as a floating wind array. It combines site condition information and a
1111
description of the floating array design, and contains functions for evaluating
1212
the array's behavior considering the site conditions. For example, it combines
13-
information about site soil conditions and an array's anchor characteristics to
14-
estimate the holding capacity of each anchor.
13+
information about site soil conditions, mooring line loads, and an array's anchor characteristics to
14+
estimate the holding capacity of each anchor.
1515

1616
The library works in conjunction with the tools RAFT, MoorPy, and FLORIS to model floating
17-
wind turbines, mooring systems, and array wakes respectively.
17+
platforms, wind turbines, mooring systems, power cables, and array wakes respectively.
1818

1919
Layered on top of the floating array model is a set of design tools that can
2020
be used for algorithmically adjusting or optimizing parts of the a floating
2121
array. Specific tools existing for mooring lines, shared mooring systems,
2222
dynamic power cables, static power cable routing, and overall array layout.
2323
These capabilities work with the design representation and evaluation functions
24-
in FAModel, and they can be applied by users in various combinations to suit
24+
in the floating array model, and they can be applied by users in various combinations to suit
2525
different purposes.
2626

2727
In addition to standalone uses of the FAD Toolset, a coupling has been made with
@@ -36,50 +36,72 @@ and designs.
3636

3737
See example use cases in our [examples](./examples/README.md) folder.
3838

39-
## Pre-installation Requirements
40-
The FAD Toolset is built entirely in Python. It is recommended that users
41-
familiarize themselves with basic Python commands before use.
4239
For working with the library, it is important to understand the floating array
43-
model structure, which is described more [here](./famodel/README.md).
40+
model structure, which is described more [here](./fad/README.md).
4441

4542

4643
## Installation
47-
To install the FAD Toolset itself, first clone this FAD-Toolset repository.
4844

49-
The dependencies required by FAD depend on how it is used. To install all
50-
possible required dependencies, you can create a
51-
new python virtual environment based on the included yaml listing the required
52-
dependencies.
45+
FAD-Toolset is built entirely in Python. It is recommended that users familiarize themselves with Python and install Python onto their machine through Anaconda or Miniconda distributions.
5346

54-
In the terminal (Anaconda Powershell Prompt), clone this repository to a
55-
directory of your choice, navigate into the main folder of the repository, and
56-
run the following command:
47+
The following describes the steps to set up a python virtual environment, install FAD-Toolset, and all install required dependencies into the environment.
5748

58-
conda env create -f famodel-env.yaml
49+
First, in a terminal such as the Anaconda Powershell Prompt, clone the GitHub repository to access the files. Navigate to a directory of your choice to download the repository and then navigate into the FAD-Toolset folder.
5950

60-
This command will install all the dependencies required to run FAD.
61-
Activate your virtual environment before using FAD with ```conda activate famodel-env```
51+
```
52+
(base) YOUR_PATH> git clone https://github.com/FloatingArrayDesign/FAD-Toolset.git
53+
(base) YOUR_PATH> cd FAD-Toolset
54+
```
6255

63-
To install the FAD Toolset package in your environment, enter the
64-
following in the command line from the FAD-Toolset directory.
56+
Next, create a new python virtual environment with an environment name of your choice. We will use 'fad-env' as an example.
6557

66-
For development use:
58+
```
59+
(base) YOUR_PATH\FAD-Toolset> conda env create -n fad-env -f fad-env.yaml
60+
(base) YOUR_PATH\FAD-Toolset> conda activate fad-env # run `conda deactivate` to deactivate
61+
(fad-env) YOUR_PATH\FAD-Toolset>
62+
```
6763

68-
run ```python setup.py develop``` or ```pip install -e .``` from the command
69-
line in the main FAD-Toolset directory.
64+
Within the new python virtual environment, we can install FAD-Toolset.
7065

71-
For non-development use:
66+
Use ```pip``` to install the contents of this folder. Ensure you are still within the root directory of FAD-Toolset.
7267

73-
run ```python setup.py``` or ```pip install .``` from the command line in
74-
the main FAD-Toolset directory.
68+
```
69+
(fad-env) YOUR_PATH\FAD-Toolset> pip install -e .
70+
```
7571

76-
You can test the installation by running ```pytest``` from the main FAD-Toolset directory.
72+
This command tells `pip` to look at the `pyproject.toml` file to install the FAD-Toolset program into the current virtual environment, along with all the dependencies listed in the `pyproject.toml` file. There is overlap between the python packages listed in the `pyproject.toml` and the `fad-env.yaml` file since the installation can be done by either or both of the package installation managers, `conda` and `pip`. Specific versions of packages like scipy are listed in the `pyproject.toml` file to ensure they get installed properly. The `-e` option allows users to make local changes to their FAD-Toolset files and have those changes be reflected in the FAD-Toolset installation.
73+
74+
Lastly, we can test the installation by running `pytest` from the main FAD-Toolset directory.
75+
76+
```
77+
(fad-env) YOUR_PATH\FAD-Toolset> pytest
78+
```
7779

7880
<!-- FAD requires MoorPy and we currently install it separately. If you don't already have it,
7981
you can install MoorPy with ```git clone https://github.com/NREL/MoorPy.git```
8082
then navigate to the MoorPy folder and install with ```pip install .```.
8183
Make sure your virtual enviroment is activated before installing MoorPy. -->
8284

85+
For future changes to dependencies like MoorPy or RAFT, as long as those changes come through a new release of the software and an updated version is listed on PyPI, users should manually re-install the dependencies in their virtual environment to gather those new changes (i.e., `pip install moorpy`).
86+
87+
FAD-Toolset is also pip installable and can be installed using `pip install fad-toolset`. The main source code folder in the repo is named `fad`, which is how classes and functions will be imported (i.e., `import fad.Project as Project` or `from fad.anchors.anchor import Anchor`).
88+
89+
90+
91+
### Installation/Dependency Issues
92+
93+
Some of the toolset's functionality requires RAFT, which in turn requires
94+
CCBlade, which recently can only be installed as part of WISDEM. Some issues
95+
can occur from the associated dependencies, but some have quick fixes:
96+
97+
- Getting a readline error when breakpoint() is called? Check if the
98+
pyreadline3 package is installed in the conda environment. If so, try
99+
removing it.
100+
101+
- Wanting to use both WEIS and FAD Toolset in the same environment, but
102+
getting errors related to "smt" when installing WEIS? Try commenting out
103+
the smt requirement in environment.yml and pyproject.toml.
104+
83105

84106
## Subpackages
85107

@@ -93,24 +115,33 @@ collection of subpackages for specific functions. The current subpackages are:
93115

94116
Please navigate into the subfolders above for additional information.
95117

118+
96119
## Getting Started
120+
97121
The easiest way to create a FAD project is to provide the array
98122
information in an ontology yaml file. FAD has been designed
99123
to work with a specific ontology yaml setup, which is described
100-
in detail in the [Ontology ReadMe](./famodel/ontology/README.md).
124+
in detail in the [Ontology ReadMe](./fad/ontology/README.md).
125+
126+
For examples of ontologies and driver files of common use cases,
127+
we recommend starting with the numbered examples in the examples folder.
128+
The [visualization examples](./examples/01_Visualization/) are a good place
129+
to start. Run the .py files and inspect the .yaml files with the same name
130+
to see what information is required for different uses and how they are conveyed
131+
in the ontology.
101132

102-
The [example driver file](./famodel/example_driver.py) creates a FAD Project
133+
To see an example with all use cases, the [example driver file](./examples/example_driver.py) creates a FAD Project
103134
object from a pre-set ontology file and shows the syntax and outputs of
104135
various capabilities. For guidance on creating your own ontology yaml file,
105-
it is recommended to read through the [Ontology ReadMe](./famodel/ontology/README.md),
136+
it is recommended to read through the [Ontology ReadMe](./fad/ontology/README.md),
106137
then either adapt one of the ontology samples or fill in the ontology template.
107138

108-
The [core model readme](./famodel/README.md) describes the Project class structure,
139+
The [core model readme](./fad/README.md) describes the Project class structure,
109140
as well as the properties and methods of each component class.
110141

111142
There are some limited helper functions to automatically fill in sections
112143
of a yaml from a MoorPy system or a list of platform locations.
113-
See [helpers](./famodel/helpers.py) for the full list of yaml writing capabilities.
144+
See [helpers](./fad/helpers.py) for the full list of yaml writing capabilities.
114145

115146

116147
## Authors

examples/01_Visualization/01_2D-visual_turbine_locations.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,13 @@
55
site condition information, etc.)
66
"""
77

8-
from famodel import Project
8+
from fad import Project
99
import matplotlib.pyplot as plt
10+
import os
1011

1112
# define name of ontology input file
12-
input_file = '01_2D-visual_turbine_locations.yaml'
13+
dir = os.path.dirname(os.path.realpath(__file__))
14+
input_file = os.path.join(dir,'01_2D-visual_turbine_locations.yaml')
1315

1416
# initialize Project class with input file, we don't need RAFT for this so mark False
1517
project = Project(file=input_file,raft=False)

examples/01_Visualization/01_2D-visual_turbine_locations.yaml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,22 @@
11

22
# ----- Array-level inputs -----
33

4-
# Wind turbine array layout
4+
# platform array layout
55
array:
66
keys : [ID, topsideID, platformID, mooringID, x_location, y_location, heading_adjust]
7+
# ID: unique identifier for that platform/turbine system (can be anything you want)
8+
# topside ID: index in list of topsides, which includes wind turbines (indices starting at 1. 0 means there is no topside).
9+
# In this case, we have no topside design defined, so all are 0.
10+
# platform ID: index in list of platforms, which includes FOWT platforms, substation platforms, etc.
11+
# (indices starting at 1, 0 means there is no platform). In this case, we only have 1 platform design defined, so all are 1.
12+
# mooringID: string/id of mooring system to apply to this platform if using mooring_system.
13+
# If there is no mooring or you want to define the mooring lines individually (i.e. through array_mooring table),
14+
# then set mooringID=0, which means there is no mooring system and we've instead individually defined the mooring lines in the array_mooring table.
15+
# In this case, we have no mooring system defined, so all are 0.
16+
# x_location: x coord of platform location
17+
# y_location: y coord of platform location
18+
# z_location: z coord of platform location. For FOWTs generally is 0
19+
# heading_adjust: rotation of platform relative to its 0 position defined for that platformID
720
data : # ID# ID# ID# [m] [m] [deg]
821
- [fowt0, 0, 1, 0, -1600, -1600, 0 ]
922
- [fowt1, 0, 1, 0, 0, -1600, 0 ]
@@ -16,4 +29,4 @@ array:
1629
- [fowt8, 0, 1, 0, 1600, 1600, 0 ]
1730

1831
platform:
19-
type : FOWT
32+
type : FOWT # type of platform, can be FOWT, substation, WEC, or other

examples/01_Visualization/02_visual_moorings.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,13 @@
77
site condition information, etc.)
88
"""
99

10-
from famodel import Project
10+
from fad import Project
1111
import matplotlib.pyplot as plt
12+
import os
1213

1314
# define name of ontology input file
14-
input_file = '02_visual_moorings.yaml'
15+
dir = os.path.dirname(os.path.realpath(__file__))
16+
input_file = os.path.join(dir,'02_visual_moorings.yaml')
1517

1618
# initialize Project class with input file, we don't need RAFT for this so mark False
1719
project = Project(file=input_file,raft=False)

0 commit comments

Comments
 (0)