Skip to content

Commit

Permalink
Feature/upgrade to floris v3 (#5)
Browse files Browse the repository at this point in the history
* Update code for floris v3.0 compatiblity

* Update pandas version dependency to resolve issue with pandas rolling in 1.4.1

* Remove Python 3.7 from automated test environments.

* Bump version number to 1.0

* Remove dependency on HISTORY file
  • Loading branch information
Bart Doekemeijer authored Mar 2, 2022
1 parent 164fa5f commit 0710eed
Show file tree
Hide file tree
Showing 22 changed files with 321 additions and 422 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/continuous-integration-workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.7", "3.8", "3.9"]
python-version: ["3.8", "3.9"]
os: [ubuntu-latest, macos-latest]

steps:
Expand Down
8 changes: 0 additions & 8 deletions HISTORY.rst

This file was deleted.

4 changes: 0 additions & 4 deletions docs/source/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,4 @@ code will be available directly through your local Python. Remember
to re-import the FLASC module when changes are made if you are working
in an interactive environment like Jupyter.

In terms of dependencies, the flasc toolbox currently relies on floris
v2.4, and is not yet compatible with floris v3.0rc1.


.. seealso:: `Return to table of contents <index.html>`_
4 changes: 2 additions & 2 deletions docs/source/overview.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ Citation
If FLASC played a role in your research, please cite it. This software can be
cited as:

FLASC. Version 0.1 (2022). Available at https://github.com/NREL/flasc.
FLASC. Version 1.0 (2022). Available at https://github.com/NREL/flasc.

For LaTeX users:

.. code-block:: latex

@misc{flasc2022,
author = {NREL},
title = {FLASC. Version 0.1},
title = {FLASC. Version 1.0},
year = {2022},
publisher = {GitHub},
journal = {GitHub repository},
Expand Down
254 changes: 0 additions & 254 deletions examples/demo_dataset/demo_floris_input.json

This file was deleted.

65 changes: 65 additions & 0 deletions examples/demo_dataset/demo_floris_input.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
description: Example FLORIS Input file for FLASC
farm:
layout_x:
- 1630.222
- 1176.733
- 816.389
- 755.938
- 0.0
- 1142.24
- 1553.102
layout_y:
- 0.0
- 297.357
- 123.431
- 575.544
- 647.779
- 772.262
- 504.711
turbine_type:
- nrel_5MW
floris_version: 3.0
flow_field:
air_density: 1.225
reference_wind_height: 90
turbulence_intensity: 0.08
wind_directions:
- - 90.0
wind_shear: 0.12
wind_speeds:
- - 9.0
wind_veer: 0.0
logging:
console:
enable: true
level: INFO
file:
enable: false
level: INFO
name: floris_input_file_example
solver:
turbine_grid_points: 5
type: turbine_grid
wake:
enable_secondary_steering: true
enable_transverse_velocities: true
enable_yaw_added_recovery: true
model_strings:
combination_model: sosfs
deflection_model: gauss
turbulence_model: crespo_hernandez
velocity_model: gauss
wake_deflection_parameters:
gauss:
dm: 1.0
eps_gain: 0.2
wake_turbulence_parameters:
crespo_hernandez:
ai: 0.8
constant: 0.5
downstream: -0.32
initial: 0.1
wake_velocity_parameters:
gauss:
ka: 0.38
kb: 0.004
10 changes: 3 additions & 7 deletions examples/demo_dataset/generate_demo_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import numpy as np
import pandas as pd

import floris.tools as wfct
from floris.tools.floris_interface import FlorisInterface
from floris.utilities import wrap_360

from flasc.dataframe_operations import dataframe_manipulations as dfm
Expand Down Expand Up @@ -75,8 +75,8 @@ def get_wind_data_from_nwtc():
# Initialize the FLORIS interface fi
print("Initializing the FLORIS object for our demo wind farm")
file_path = os.path.dirname(os.path.abspath(__file__))
fi_path = os.path.join(file_path, "demo_floris_input.json")
fi = wfct.floris_interface.FlorisInterface(fi_path)
fi_path = os.path.join(file_path, "demo_floris_input.yaml")
fi = FlorisInterface(fi_path)

# Format columns to generic names
print("Formatting the dataframe with met mast data...")
Expand Down Expand Up @@ -106,10 +106,6 @@ def get_wind_data_from_nwtc():
wd_array=np.arange(0.0, 360.0, 3.0),
ws_array=np.arange(0.0, 27.0, 1.0),
ti_array=np.arange(0.03, 0.30, 0.03),
num_workers=4,
num_threads=20,
include_unc=False,
use_mpi=False,
)
df_approx.to_feather(fn_approx)

Expand Down
Loading

0 comments on commit 0710eed

Please sign in to comment.