Skip to content

Commit

Permalink
Merge pull request #85 from NREL/develop
Browse files Browse the repository at this point in the history
Merge develop into main
  • Loading branch information
paulf81 authored May 16, 2023
2 parents c7f6afc + dab8eb9 commit e425509
Show file tree
Hide file tree
Showing 79 changed files with 11,037 additions and 2,228 deletions.
5 changes: 4 additions & 1 deletion .codecov.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
# Codecov configuration file

comment: false

coverage:
range: 0..100 # sets the range for the color bar in the dashboard
round: down
precision: 2

ignore:
- "setup.py"
- "setup.py"
- "tests/"
18 changes: 10 additions & 8 deletions .github/workflows/continuous-integration-workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ name: Python package
on:
push:
paths-ignore:
- 'AUTHORS.rst'
- 'LICENSE.txt'
- 'NOTICE.txt'
- 'README.rst'
- 'docs/**'
- 'examples/**'
- 'examples*/**'
pull_request:
types: [opened, synchronize, edited, reopened]

Expand All @@ -20,8 +22,8 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9"]
os: [ubuntu-latest, macos-latest]
python-version: ["3.9", "3.10"]
os: [ubuntu-latest]

steps:
- uses: actions/checkout@v2
Expand All @@ -33,14 +35,14 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Test with pytest
run: |
pytest
- name: Run tests and collect coverage
run: |
pip install pytest-cov
pytest --cov=./ --cov-report=xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
uses: codecov/codecov-action@v3
with:
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.xml
fail_ci_if_error: true

5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,7 @@ _build
*.png

# Documentation build files
docs/build
docs/build
SMARTEOLE_WakeSteering_ReadMe.xlsx
SMARTEOLE_WakeSteering_Map.pdf
SMARTEOLE-WFC-open-dataset.zip
4 changes: 2 additions & 2 deletions docs/source/data_analysis.rst
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ allows the user to compare, for example, FLORIS model predictions to SCADA
data. Different instantiations of the FLORIS model can be analyzed by creating
multiple dataframes and all inserting them into the suite object using the
function ``add_df()``. An example of this usage is shown in
``a_08_plot_energy_ratios.py`` in the ``examples/raw_data_processing/``
``a_08_plot_energy_ratios.py`` in the ``examples_artificial_data/raw_data_processing/``
folder.


Expand All @@ -171,7 +171,7 @@ showcasing the energy ratios under various inflow conditions and in different
bins. Continuing on the example of the previous section, a user can generate
such an Excel file using the ``fsc.export_detailed_energy_info_to_xlsx()``
function. Usage of this function is exemplified in
``energy_table_for_two_df.py``, in the folder ``examples/table_analysis/``.
``energy_table_for_two_df.py``, in the folder ``examples_artificial_data/table_analysis/``.
The function produces an Excel sheet which looks as follows:

.. image:: images/example_table_analysis.png
Expand Down
2 changes: 1 addition & 1 deletion docs/source/data_processing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ Data filtering

With the SCADA data now in a wide-formatted Pandas DataFrame, the flasc
data filtering tools can readily be applied. The files in
``examples/raw_data_processing`` demonstrate how the SCADA data files are
``examples_artifical_data/raw_data_processing`` demonstrate how the SCADA data files are
processed.

++++++++++++++++++++++++
Expand Down
2 changes: 1 addition & 1 deletion docs/source/getting_started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Install the repository following the instructions `here <installation.html>`_.
Generating an artificial dataset
================================
You can generate a demo dataset using the script at
``examples/demo_dataset/``. The script ``generate_demo_dataset.py`` downloads
``examples_artificial_data/demo_dataset/``. The script ``generate_demo_dataset.py`` downloads
historical data from a meteorological measurement tower at the U.S. National
Wind Technology Center (NWTC), part of the National Renewable Energy
Laboratory (NREL). This data is made readily available to the public on its
Expand Down
Binary file removed examples/demo_dataset/df_approx.ftr
Binary file not shown.
157 changes: 0 additions & 157 deletions examples/raw_data_processing/a_03_check_sensor_stuck_faults.py

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,9 @@ def get_wind_data_from_nwtc():
df_approx = ftls.calc_floris_approx_table(
fi=fi,
wd_array=np.arange(0.0, 360.0, 3.0),
ws_array=np.arange(0.0, 27.0, 1.0),
ws_array=np.arange(0.001, 27.0, 1.0),
ti_array=np.arange(0.03, 0.30, 0.03),
save_turbine_inflow_conditions_to_df=True
)
df_approx.to_feather(fn_approx)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def load_data():
root_dir, '..', 'demo_dataset', 'demo_dataset_scada_60s.ftr'
)
if not os.path.exists(ftr_path):
raise FileNotFoundError('Please run ./examples/demo_dataset/' +
raise FileNotFoundError('Please run ./examples_artifical/demo_dataset/' +
'generate_demo_dataset.py before try' +
'ing any of the other examples.')
df = pd.read_feather(ftr_path)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def load_data():
ftr_path = os.path.join(root_dir, '..', 'demo_dataset',
'demo_dataset_scada_60s.ftr')
if not os.path.exists(ftr_path):
raise FileNotFoundError('Please run ./examples/demo_dataset/' +
raise FileNotFoundError('Please run ./examples_artificial_data/demo_dataset/' +
'generate_demo_dataset.py before try' +
'ing any of the other examples.')
df = pd.read_feather(ftr_path)
Expand Down Expand Up @@ -122,4 +122,5 @@ def load_floris():
percentiles=[5., 95.],
verbose=False)
fsc.plot_energy_ratios(superimpose=True)
fsc.plot_energy_ratios(superimpose=True, polar_plot=True) # Also show in a polar plot
plt.show()
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def load_data():
ftr_path = os.path.join(root_dir, '..', 'demo_dataset',
'demo_dataset_scada_60s.ftr')
if not os.path.exists(ftr_path):
raise FileNotFoundError('Please run ./examples/demo_dataset/' +
raise FileNotFoundError('Please run ./examples_artificial_data/demo_dataset/' +
'generate_demo_dataset.py before try' +
'ing any of the other examples.')
df = pd.read_feather(ftr_path)
Expand Down Expand Up @@ -89,25 +89,45 @@ def load_floris():
test_turbines=[1],
wd_step=2.0,
ws_step=1.0,
wd_bin_width=3.0,
wd_bin_width=2.0,
)
fig, ax = era.plot_energy_ratio()
ax[0].set_title("Energy ratios for turbine 001 without UQ")
plt.tight_layout()

fig, ax = era.plot_energy_ratio(polar_plot=True) # Plot in polar format too
ax[0].set_title("Energy ratios for turbine 001 without UQ")
plt.tight_layout()

# Get energy ratio with uncertainty quantification
# using N=50 bootstrap samples and 5-95 percent conf. bounds.
era.get_energy_ratio(
test_turbines=[1],
wd_step=2.0,
ws_step=1.0,
wd_bin_width=3.0,
N=50,
wd_bin_width=2.0,
N=20,
percentiles=[5.0, 95.0]
)
fig, ax = era.plot_energy_ratio()
ax[0].set_title("Energy ratios for turbine 001 with UQ "
+ "(N=50, 90% confidence interval)")
+ "(N=20, 90% confidence interval)")
plt.tight_layout()

# Get energy ratio with uncertainty quantification
# using N=10 bootstrap samples and block bootstrapping
era.get_energy_ratio(
test_turbines=[1],
wd_step=2.0,
ws_step=1.0,
wd_bin_width=2.0,
N=20,
percentiles=[5.0, 95.0],
num_blocks=20 # Resample over 20 blocks
)
fig, ax = era.plot_energy_ratio()
ax[0].set_title("Energy ratios for turbine 001 with UQ "
+ "(N=20, Block Bootstrapping)")
plt.tight_layout()

plt.show()
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def load_data():
root_dir, '..', 'demo_dataset', 'demo_dataset_scada_60s.ftr'
)
if not os.path.exists(ftr_path):
raise FileNotFoundError('Please run ./examples/demo_dataset/' +
raise FileNotFoundError('Please run ./examples_artificial_data/demo_dataset/' +
'generate_demo_dataset.py before try' +
'ing any of the other examples.')
df = pd.read_feather(ftr_path)
Expand Down
Loading

0 comments on commit e425509

Please sign in to comment.