Skip to content

Commit

Permalink
Merge pull request #7 from NREL/maintenance/version-pinning
Browse files Browse the repository at this point in the history
Maintenance: Version pinning
  • Loading branch information
RHammond2 committed Apr 9, 2024
2 parents 74e3931 + 9914824 commit a9f8fe5
Show file tree
Hide file tree
Showing 9 changed files with 129 additions and 12 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# CHANGELOG

## 0.5.2 (9 April 2024)

- Pins FLORIS to v3.6 to avoid workarounds for previous versions, and to avoid issues with
adopting v4.
- Updates WOMBAT to 0.9.3 to account for the latest bug fixes.
- Fixes minor typos.
- Adds in mermaid markdown workflow diagrams for the documentation.
42 changes: 42 additions & 0 deletions docs/diagrams/input_flow.mmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
flowchart TD

subgraph Configuration

ConfigA[orbit_config]
ConfigB[wombat_config]
ConfigC[floris_config]
ConfigD[Additional\nConfigurations]
ConfigE[fa:fa-code fa:fa-file WAVES Configuration]

ConfigE ---|fa:fa-file file name or \n fa:fa-code settings| ConfigB
ConfigE ---|fa:fa-file file name or \n fa:fa-code settings| ConfigA
ConfigE ---|fa:fa-file file name or \n fa:fa-code settings| ConfigC
ConfigE ---|fa:fa-code settings| ConfigD

ConfigD --- ConfigF(Shared ORBIT settings and \n ORBIT tie-ins for weather)
ConfigD --- ConfigG(FLORIS tie-ins for weather)
ConfigD --- ConfigH(Detailed CapEx breakdowns)
ConfigD --- ConfigI(High level financial variables)
ConfigD --- ConfigJ(Indicators to connect any \n of ORBIT or FLORIS \n to WOMBAT configurations)
end

subgraph Initialization
InitA(Create ORBIT ProjectManager)
InitB(Create WOMBAT Simulation)
InitC(Create FLORIS FlorisInterface)
InitD[Connect layouts\nand weather profiles]
InitE[Project]
InitF[Project.orbit --> ProjectManager]
InitG[Project.wombat --> Simulation]
InitH[Project.floris --> FlorisInterface]

InitA --> InitD
InitB --> InitD
InitC --> InitD
InitD --> InitE
InitE --- InitF
InitE --- InitG
InitE --- InitH
end

Configuration --> Initialization
1 change: 1 addition & 0 deletions docs/diagrams/input_flow.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
57 changes: 57 additions & 0 deletions docs/diagrams/results_flow.mmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
flowchart LR

A("Project.run()")
A --> B("Project.orbit.run()")
A --> C("Project.wombat.run()")
A --> D("Project.run_floris()")

B --> ORBIT
C --> WOMBAT
D --> FLORIS


subgraph Independent

NT[n_turbines]
NOSS[n_substations]
TurbRat[turbine_rating]

subgraph ORBIT
ArrayLen[total_array_length]
ExpLen[total_export_length]
CapEx[capex_breakdown]
end

subgraph WOMBAT
Avail[availability]
OpEx[opex]
end

subgraph FLORIS
TurbPotential[turbine_potential_energy]
ProjPotential[project_potential_energy]
TurbProd[turbine_production_energy]
ProjProd[project_production_energy]
end

end

subgraph Combined
EnergyPotential[energy_potential] --> EnergyLoss[energy_losses]
EnergyProd[energy_production] --> EnergyLoss
EnergyPotential --> CF[capacity_factor]
EnergyProd --> CF
EnergyProd --> Revenue[revenue]
Revenue --> CashFlow[cash_flow]
CashFlow --> NPV[npv]
CashFlow --> IRR[irr]
CashFlow --> LCOE[lcoe]

TurbPotential --> EnergyPotential
ProjPotential --> EnergyPotential
TurbProd --> EnergyProd
ProjProd --> EnergyProd
Avail --> EnergyProd
OpEx --> CashFlow
CapEx --> CashFlow
end
1 change: 1 addition & 0 deletions docs/diagrams/results_flow.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions docs/user_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,12 @@ The following method is run on intialization when ``Project.connect_floris_to_la
:noindex:
```

Visually, this looks like the following workflow:

```{image} diagrams/input_flow.svg
:align: center
```

### Updating Configurations

Sometimes, additional configurations may need to be connected prior to running an analysis. For
Expand Down Expand Up @@ -199,6 +205,12 @@ For the following set of methods, users only need to create a ``Project`` object

## Results

Visually, the following is a general flow of operations for combining each model's outputs:

```{image} diagrams/results_flow.svg
:align: center
```

To quickly produce any of the high-level outputs to a single `DataFrame`, the below method can be
used in place of individually calculating each metric and combining into a report. Additionally,
users can refer to the [COWER 2022 example](example_cower_2022:results) for the reported results,
Expand Down
13 changes: 4 additions & 9 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
requires = ["setuptools", "setuptools-scm"]
build-backend = "setuptools.build_meta"

[metadata]
version = "attr: waves.__version__"

[project]
name = "WAVES"
dynamic = ["version"]
Expand All @@ -19,10 +16,10 @@ dependencies = [
"pyyaml",
"matplotlib>=3.6",
"numpy-financial>=1.0.0",
"floris>=3.3",
"wombat>=0.9.1",
"floris==3.6", # TODO: upgrade to FLORIS v4
"wombat>=0.9.3",
"orbit-nrel>=1.0.8",
"typer[all]",
"typer>=0.12.3",
]
keywords = [
"python3",
Expand Down Expand Up @@ -54,9 +51,6 @@ classifiers = [
"Typing :: Typed",
]

[console_scripts]
waves = "waves:__main__"

[project.scripts]
waves = "waves.__main__:app"

Expand Down Expand Up @@ -87,6 +81,7 @@ examples=[
"jupyterlab",
"jupyterlab-myst",
]
all = ["waves[dev,docs,examples]"]

[tool.setuptools]
include-package-data = true
Expand Down
2 changes: 1 addition & 1 deletion waves/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
from waves.project import Project


__version__ = "0.5.1"
__version__ = "0.5.2"
4 changes: 2 additions & 2 deletions waves/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -1154,7 +1154,7 @@ def n_turbines(self) -> int:
return len(self.wombat.windfarm.turbine_id)
if self.floris_config is not None:
return self.floris.farm.n_turbines
raise RuntimeError("No models wer provided, cannot calculate value.")
raise RuntimeError("No models were provided, cannot calculate value.")

def turbine_rating(self) -> float:
"""Calculates the average turbine rating, in MW, of all the turbines in the project.
Expand All @@ -1173,7 +1173,7 @@ def turbine_rating(self) -> float:
return self.orbit.turbine_rating
if self.wombat_config is not None:
return self.wombat.windfarm.capacity / 1000 / self.n_turbines
raise RuntimeError("No models wer provided, cannot calculate value.")
raise RuntimeError("No models were provided, cannot calculate value.")

def n_substations(self) -> int:
"""Calculates the number of subsations in the project.
Expand Down

0 comments on commit a9f8fe5

Please sign in to comment.