Skip to content

Commit

Permalink
Merge pull request #48 from WISDEM/develop
Browse files Browse the repository at this point in the history
v0.5.1
  • Loading branch information
RHammond2 authored Jul 23, 2022
2 parents cdc6d49 + 648cf9b commit 35b350e
Show file tree
Hide file tree
Showing 25 changed files with 4,771 additions and 9,853 deletions.
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
## v.0.5.0 (30 June 2022)
## 0.5.1 (22 July 2022)
- Updates to use the most recent pandas API/recommendations, which fixes numerous warnings in the `Metrics` class
- Fixes inconsistency in returning floats vs `DataFrame`s in the `Metrics` class
- Updates the examples to work with the returned `DataFrame` values, and adds warnings about the change in usage
- Updates the documenation configuration to be compatible with the latest sphinx book theme API usage
- Adds a potential fix to an occasional issue where the logging files can't be deleted using `WombatEnvironment.cleanup_log_files()` because the file is still considered to be in use

## 0.5.0 (30 June 2022)
- Adds capabilities: "TOW" and "AHV" for tugboat/towing equipment and anchor-handling vessels
- Adds a tow-to-port strategy that is activated for repairs with the "TOW" capability in the servicing
- Adds a `Port` class to handle the tow-to-port class and tugboat-based service requests
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Setup
Requirements
~~~~~~~~~~~~

* Python 3.7+, see the next section for more.
* Python 3.8+, see the next section for more.

Environment Setup
~~~~~~~~~~~~~~~~~
Expand Down
60 changes: 32 additions & 28 deletions docs/jupyter_execute/examples/how_to.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "markdown",
"id": "a9ad6b44",
"id": "80d1aebb",
"metadata": {},
"source": [
"# How To Use WOMBAT\n",
Expand All @@ -19,7 +19,7 @@
{
"cell_type": "code",
"execution_count": 1,
"id": "6ae15999",
"id": "b27d9d16",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -42,7 +42,7 @@
},
{
"cell_type": "markdown",
"id": "e16768df",
"id": "0e3a19ae",
"metadata": {},
"source": [
"## Defining the Simulation\n",
Expand Down Expand Up @@ -444,7 +444,7 @@
{
"cell_type": "code",
"execution_count": 2,
"id": "95c9ad6d",
"id": "8a9babc6",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -453,7 +453,7 @@
},
{
"cell_type": "markdown",
"id": "a89055ed",
"id": "0e6e024f",
"metadata": {},
"source": [
"### The configuration file\n",
Expand All @@ -474,7 +474,7 @@
{
"cell_type": "code",
"execution_count": 3,
"id": "a7e99972",
"id": "6c0e67c5",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -483,7 +483,7 @@
},
{
"cell_type": "markdown",
"id": "befcb478",
"id": "3a1eacf5",
"metadata": {},
"source": [
"```{code-block} yaml\n",
Expand Down Expand Up @@ -527,7 +527,7 @@
{
"cell_type": "code",
"execution_count": 4,
"id": "1c6943b0",
"id": "4078904c",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -539,7 +539,7 @@
},
{
"cell_type": "markdown",
"id": "1acf06ef",
"id": "e1dd6456",
"metadata": {},
"source": [
"### Option 2: `Simulation()`\n",
Expand All @@ -561,7 +561,7 @@
{
"cell_type": "code",
"execution_count": 5,
"id": "9cd64780",
"id": "5a2890ae",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -573,7 +573,7 @@
},
{
"cell_type": "markdown",
"id": "71181a59",
"id": "e5e2e4ec",
"metadata": {},
"source": [
"## Run the analysis\n",
Expand All @@ -600,14 +600,14 @@
{
"cell_type": "code",
"execution_count": 6,
"id": "e3962eef",
"id": "66806225",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Run time: 2.36 minutes\n"
"Run time: 97.1416 seconds\n"
]
}
],
Expand All @@ -628,7 +628,7 @@
},
{
"cell_type": "markdown",
"id": "9bb5222c",
"id": "fa896fc4",
"metadata": {},
"source": [
"## Metric computation\n",
Expand All @@ -640,7 +640,7 @@
{
"cell_type": "code",
"execution_count": 7,
"id": "e84c4d62",
"id": "7a631333",
"metadata": {},
"outputs": [
{
Expand All @@ -653,27 +653,31 @@
}
],
"source": [
"net_cf = sim.metrics.capacity_factor(which=\"net\", frequency=\"project\", by=\"windfarm\")\n",
"gross_cf = sim.metrics.capacity_factor(which=\"gross\", frequency=\"project\", by=\"windfarm\")\n",
"net_cf = sim.metrics.capacity_factor(which=\"net\", frequency=\"project\", by=\"windfarm\").values[0][0]\n",
"gross_cf = sim.metrics.capacity_factor(which=\"gross\", frequency=\"project\", by=\"windfarm\").values[0][0]\n",
"print(f\" Net Capacity Factor: {net_cf:2.1f}%\")\n",
"print(f\"Gross Capacity Factor: {gross_cf:2.1f}%\")"
]
},
{
"cell_type": "code",
"execution_count": 8,
"id": "1681888e",
"id": "ecbe6f82",
"metadata": {},
"outputs": [
{
"ename": "AttributeError",
"evalue": "'numpy.float64' object has no attribute 'values'",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mAttributeError\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m<ipython-input-8-2378806ef770>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[0;31m# Report back a subset of the metrics\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 2\u001b[0m \u001b[0mtotal\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0msim\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mmetrics\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtime_based_availability\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mfrequency\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m\"project\"\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mby\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m\"windfarm\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 3\u001b[0;31m \u001b[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34mf\" Project time-based availability: {total.values[0][0] * 100:.1f}%\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 4\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 5\u001b[0m \u001b[0mtotal\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0msim\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mmetrics\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mproduction_based_availability\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mfrequency\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m\"project\"\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mby\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m\"windfarm\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;31mAttributeError\u001b[0m: 'numpy.float64' object has no attribute 'values'"
"name": "stdout",
"output_type": "stream",
"text": [
" Project time-based availability: 96.0%\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Project energy-based availability: 95.9%\n",
" Project equipment costs: $502,613.63/MW\n"
]
}
],
Expand All @@ -691,7 +695,7 @@
},
{
"cell_type": "markdown",
"id": "111de5c7",
"id": "c4ac7165",
"metadata": {},
"source": [
"## Optional: Delete the logging files\n",
Expand All @@ -702,7 +706,7 @@
{
"cell_type": "code",
"execution_count": 9,
"id": "b2dbd0a0",
"id": "4ee54991",
"metadata": {},
"outputs": [],
"source": [
Expand Down
Loading

0 comments on commit 35b350e

Please sign in to comment.