Skip to content

Commit

Permalink
Merge pull request #871 from NREL/develop
Browse files Browse the repository at this point in the history
FLORIS v3.6
  • Loading branch information
misi9170 authored Apr 5, 2024
2 parents 31fe1b6 + 3fba47f commit abc7856
Show file tree
Hide file tree
Showing 100 changed files with 3,704 additions and 4,279 deletions.
30 changes: 7 additions & 23 deletions .github/workflows/check-working-examples.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ["3.10"]
python-version: ["3.9", "3.10", "3.11"]
os: [ubuntu-latest] #, macos-latest, windows-latest]
fail-fast: False

Expand All @@ -25,9 +25,14 @@ jobs:
pip install nbconvert # For converting Jupyter notebook to python script in the next step
- name: Run examples
# Run all examples and test that they finish successfully. Do not evaluate the results.
# Copy the examples to a new directory outside of the repo to ensure that there is no
# reliance on the repo directory structure.
run: |
cd examples/
mkdir -p temp1/temp2/temp3
cp -r examples/ temp1/temp2/temp3/.
cd temp1/temp2/temp3/examples/
error_found=0 # 0 is false
error_results="Error in example:"
Expand All @@ -48,27 +53,6 @@ jobs:
fi
done
# Run all Jupyter notebooks
for i in *.ipynb; do
# Convert this notebook to a Python script
if ! jupyter nbconvert --to script $i; then
# On conversion error, report and go to the next notebook
error_results="${error_results}"$'\n'" - Error converting ${i} to Python script"
continue
fi
# Get the basename of the notebook since the converted script will have the same basename
script_name=`basename $i .ipynb`
# Run the converted script
if ! python "${script_name}.py"; then
error_results="${error_results}"$'\n'" - ${i}"
error_found=1
fi
done
if [[ $error_found ]]; then
echo "${error_results}"
fi
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/continuous-integration-workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10"]
python-version: ["3.8", "3.9", "3.10", "3.11"]
os: [ubuntu-latest] #, macos-latest, windows-latest]
fail-fast: False
env:
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,4 @@ submit a new feature, let us know in

We rely heavily on git and GitHub, so be sure to review the
contributing guidelines in the
[online documentation](https://floris.readthedocs.io/en/main/source/developers.html).
[online documentation](https://nrel.github.io/floris/dev_guide.html).
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
FLORIS is a controls-focused wind farm simulation software incorporating
steady-state engineering wake models into a performance-focused Python
framework. It has been in active development at NREL since 2013 and the latest
release is [FLORIS v3.5](https://github.com/NREL/floris/releases/latest).
release is [FLORIS v3.6](https://github.com/NREL/floris/releases/latest).
Online documentation is available at https://nrel.github.io/floris.

The software is in active development and engagement with the development team
Expand Down Expand Up @@ -71,7 +71,7 @@ and importing FLORIS:
version

VERSION
3.5
3.6

FILE
~/floris/floris/__init__.py
Expand Down
11 changes: 6 additions & 5 deletions docs/_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@ sphinx:
- 'sphinx.ext.viewcode'
- 'sphinx_autodoc_typehints'
- 'sphinxcontrib.autoyaml'
- 'sphinx.ext.napoleon' # Formats google and numpy docstring styles
- 'sphinxcontrib.mermaid'
config:
html_theme: sphinx_book_theme
templates_path:
- '_templates'
language: 'python'
nb_execution_show_tb: true # Shows the stack trace in stdout; its suppressed otherwise.
nb_execution_raise_on_error: true # Stops the Sphinx build if there is an error in a notebook. See https://github.com/executablebooks/jupyter-book/issues/2011
suppress_warnings:
- etoc.toctree # autodoc output contains toctrees, so suppress this warning. See https://github.com/executablebooks/sphinx-external-toc/issues/36
autoyaml_level: 3
autosummary_generate: true

Expand All @@ -60,7 +60,7 @@ sphinx:
members: true
member-order: bysource
undoc-members: true
private-members: true
private-members: false
# special-members: true
# inherited-members
# show-inheritance
Expand All @@ -70,3 +70,4 @@ sphinx:
# class-doc-from
# no-value
autodoc_typehints: both
mermaid_version: "10.8"
34 changes: 0 additions & 34 deletions docs/_templates/custom-class-template.rst

This file was deleted.

66 changes: 0 additions & 66 deletions docs/_templates/custom-module-template.rst

This file was deleted.

8 changes: 5 additions & 3 deletions docs/_toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
# Learn more at https://jupyterbook.org/customize/toc.html

format: jb-book
root: intro
root: index
parts:
- caption: Getting Started
chapters:
# - file: intro
- file: installation

- caption: User Reference
chapters:
- file: floris_101
- file: intro_concepts
- file: advanced_concepts
- file: floating_wind_turbine
- file: turbine_interaction
- file: input_reference_main
Expand All @@ -21,6 +21,8 @@ parts:
- caption: Theory and Background
chapters:
- file: wake_models
sections:
- file: empirical_gauss_model
- file: bibliography

- caption: Developer Reference
Expand Down
132 changes: 132 additions & 0 deletions docs/advanced_concepts.ipynb

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions docs/api_docs.rst → docs/api_docs.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
API Documentation
=================
# API Documentation

FLORIS is divided into two primary packages.
:py:mod:`floris.simulation` is the core code that models the wind turbines
and wind farms. It is low-level code that generally is nto accessed
by typical users. :py:mod:`floris.tools` is the set of analysis routines
{py:mod}`floris.simulation` is the core code that models the wind turbines
and wind farms. It is low-level code that generally is not accessed
by typical users. {py:mod}`floris.tools` is the set of analysis routines
that define, drive, and post process a simulation. This is where
more users will interface with the software.

```{eval-rst}
.. autosummary::
:toctree: _autosummary
:template: custom-module-template.rst
:recursive:
floris.logging_manager
Expand All @@ -19,3 +18,4 @@ more users will interface with the software.
floris.type_dec
floris.turbine_library
floris.utilities
```
58 changes: 32 additions & 26 deletions docs/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ be violated, and ongoing work should strive to meet these ideas and expand on th
as possible.

- Modularity in wake model formulation:
- New mathematical formulation should be straightforward to incorporate.
- Requisite solver and grid data structures should not conflict with other existing
wake models.
- New mathematical formulation should be straightforward to incorporate by non-expert
software developers.
- Solver and grid data structures for one wake model should not conflict with the data
structures for other wake models.
- Any new feature or work should not affect an existing feature:
- Low level code should be reused as much as possible, but high level code should rarely
be repurposed.
Expand All @@ -31,12 +32,12 @@ packages. The internal structure and hierarchy is described below.
```{mermaid}
classDiagram
class tools {
+FlorisInterface
class simulation["floris.simulation"] {
+Floris
}
class simulation {
+Floris
class tools["floris.tools"] {
+FlorisInterface
}
class logging_manager
Expand All @@ -45,9 +46,7 @@ classDiagram
tools <-- logging_manager
simulation <-- logging_manager
tools <-- type_dec
simulation <-- type_dec
tools <-- utilities
simulation <-- utilities
tools <-- simulation
```
Expand Down Expand Up @@ -75,54 +74,61 @@ classDiagram
class Farm
class FlowField {
array u
array v
array w
u: NDArrayFloat
v: NDArrayFloat
w: NDArrayFloat
}
class Grid {
<<interface>>
x: NDArrayFloat
y: NDArrayFloat
z: NDArrayFloat
}
class TurbineGrid
class TurbineCubatureGrid
class FlowFieldPlanarGrid
class PointsGrid
class WakeModelManager {
<<interface>>
}
class WakeCombination {
dict parameters
parameters: dict
function()
}
class WakeDeflection {
dict parameters
parameters: dict
function()
}
class WakeTurbulence {
dict parameters
parameters: dict
function()
}
class WakeVelocity {
dict parameters
parameters: dict
function()
}
class Solver {
<<interface>>
dict parameters
parameters: dict
}
Floris o-- Farm
Floris o-- FlowField
Floris o-- Grid
Floris o-- WakeModelManager
Floris *-- Solver
WakeModelManager o-- WakeCombination
WakeModelManager o-- WakeDeflection
WakeModelManager o-- WakeTurbulence
WakeModelManager o-- WakeVelocity
Floris *-- Farm
Floris *-- FlowField
Floris *-- Grid
Floris *-- WakeModelManager
Floris --> Solver
WakeModelManager *-- WakeCombination
WakeModelManager *-- WakeDeflection
WakeModelManager *-- WakeTurbulence
WakeModelManager *-- WakeVelocity
Grid <|-- TurbineGrid
Grid <|-- TurbineCubatureGrid
Grid <|-- FlowFieldPlanarGrid
Grid <|-- PointsGrid
Solver --> Farm
Solver --> FlowField
Expand Down
Loading

0 comments on commit abc7856

Please sign in to comment.