res-wind-up 0.1.5__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- res_wind_up-0.1.5/LICENSE.txt +26 -0
- res_wind_up-0.1.5/PKG-INFO +121 -0
- res_wind_up-0.1.5/README.md +50 -0
- res_wind_up-0.1.5/pyproject.toml +157 -0
- res_wind_up-0.1.5/res_wind_up.egg-info/PKG-INFO +121 -0
- res_wind_up-0.1.5/res_wind_up.egg-info/SOURCES.txt +69 -0
- res_wind_up-0.1.5/res_wind_up.egg-info/dependency_links.txt +1 -0
- res_wind_up-0.1.5/res_wind_up.egg-info/requires.txt +32 -0
- res_wind_up-0.1.5/res_wind_up.egg-info/top_level.txt +1 -0
- res_wind_up-0.1.5/setup.cfg +4 -0
- res_wind_up-0.1.5/tests/test_combine_results.py +89 -0
- res_wind_up-0.1.5/tests/test_conversions.py +28 -0
- res_wind_up-0.1.5/tests/test_detrend.py +104 -0
- res_wind_up-0.1.5/tests/test_helpers.py +35 -0
- res_wind_up-0.1.5/tests/test_long_term.py +27 -0
- res_wind_up-0.1.5/tests/test_main_analysis.py +121 -0
- res_wind_up-0.1.5/tests/test_math_funcs.py +26 -0
- res_wind_up-0.1.5/tests/test_models.py +106 -0
- res_wind_up-0.1.5/tests/test_northing.py +47 -0
- res_wind_up-0.1.5/tests/test_optimize_northing.py +158 -0
- res_wind_up-0.1.5/tests/test_power_curve.py +32 -0
- res_wind_up-0.1.5/tests/test_pp_analysis.py +78 -0
- res_wind_up-0.1.5/tests/test_reanalysis_data.py +39 -0
- res_wind_up-0.1.5/tests/test_scada_funcs.py +361 -0
- res_wind_up-0.1.5/tests/test_smart_data.py +85 -0
- res_wind_up-0.1.5/tests/test_version.py +14 -0
- res_wind_up-0.1.5/tests/test_waking_state.py +234 -0
- res_wind_up-0.1.5/tests/test_wind_funcs.py +27 -0
- res_wind_up-0.1.5/tests/test_windspeed_drift.py +25 -0
- res_wind_up-0.1.5/tests/test_ws_est.py +26 -0
- res_wind_up-0.1.5/wind_up/__init__.py +3 -0
- res_wind_up-0.1.5/wind_up/caching.py +35 -0
- res_wind_up-0.1.5/wind_up/combine_results.py +151 -0
- res_wind_up-0.1.5/wind_up/constants.py +45 -0
- res_wind_up-0.1.5/wind_up/conversions.py +11 -0
- res_wind_up-0.1.5/wind_up/detrend.py +348 -0
- res_wind_up-0.1.5/wind_up/interface.py +204 -0
- res_wind_up-0.1.5/wind_up/long_term.py +226 -0
- res_wind_up-0.1.5/wind_up/main_analysis.py +898 -0
- res_wind_up-0.1.5/wind_up/math_funcs.py +14 -0
- res_wind_up-0.1.5/wind_up/models.py +446 -0
- res_wind_up-0.1.5/wind_up/northing.py +188 -0
- res_wind_up-0.1.5/wind_up/northing_utils.py +17 -0
- res_wind_up-0.1.5/wind_up/optimize_northing.py +671 -0
- res_wind_up-0.1.5/wind_up/plots/__init__.py +0 -0
- res_wind_up-0.1.5/wind_up/plots/combine_results_plots.py +52 -0
- res_wind_up-0.1.5/wind_up/plots/data_coverage_plots.py +143 -0
- res_wind_up-0.1.5/wind_up/plots/detrend_plots.py +307 -0
- res_wind_up-0.1.5/wind_up/plots/long_term_plots.py +86 -0
- res_wind_up-0.1.5/wind_up/plots/misc_plots.py +210 -0
- res_wind_up-0.1.5/wind_up/plots/northing_plots.py +128 -0
- res_wind_up-0.1.5/wind_up/plots/optimize_northing_plots.py +71 -0
- res_wind_up-0.1.5/wind_up/plots/pp_analysis_plots.py +512 -0
- res_wind_up-0.1.5/wind_up/plots/reanalysis_plots.py +102 -0
- res_wind_up-0.1.5/wind_up/plots/scada_funcs_plots.py +406 -0
- res_wind_up-0.1.5/wind_up/plots/scada_power_curve_plots.py +89 -0
- res_wind_up-0.1.5/wind_up/plots/waking_state_plots.py +45 -0
- res_wind_up-0.1.5/wind_up/plots/windspeed_drift_plots.py +27 -0
- res_wind_up-0.1.5/wind_up/plots/ws_est_plots.py +125 -0
- res_wind_up-0.1.5/wind_up/plots/yaw_direction_plots.py +207 -0
- res_wind_up-0.1.5/wind_up/pp_analysis.py +559 -0
- res_wind_up-0.1.5/wind_up/reanalysis_data.py +190 -0
- res_wind_up-0.1.5/wind_up/result_manager.py +17 -0
- res_wind_up-0.1.5/wind_up/scada_funcs.py +522 -0
- res_wind_up-0.1.5/wind_up/scada_power_curve.py +84 -0
- res_wind_up-0.1.5/wind_up/smart_data.py +194 -0
- res_wind_up-0.1.5/wind_up/waking_state.py +300 -0
- res_wind_up-0.1.5/wind_up/wind_funcs.py +13 -0
- res_wind_up-0.1.5/wind_up/windspeed_drift.py +74 -0
- res_wind_up-0.1.5/wind_up/ws_est.py +163 -0
- res_wind_up-0.1.5/wind_up/yaml_loader.py +27 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
BSD 3-Clause License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024, RENEWABLE ENERGY SYSTEMS LIMITED, all rights reserved.
|
|
4
|
+
|
|
5
|
+
Redistribution and use in source and binary forms, with or without modification, are permitted
|
|
6
|
+
provided that the following conditions are met:
|
|
7
|
+
|
|
8
|
+
* Redistributions of source code must retain the above copyright notice, this list of conditions
|
|
9
|
+
and the following disclaimer.
|
|
10
|
+
|
|
11
|
+
* Redistributions in binary form must reproduce the above copyright notice, this list of
|
|
12
|
+
conditions and the following disclaimer in the documentation and/or other materials provided
|
|
13
|
+
with the distribution.
|
|
14
|
+
|
|
15
|
+
* Neither the name of the copyright holder nor the names of its contributors may be used to
|
|
16
|
+
endorse or promote products derived from this software without specific prior written permission.
|
|
17
|
+
|
|
18
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
|
19
|
+
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
20
|
+
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER
|
|
21
|
+
OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
22
|
+
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
23
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
|
24
|
+
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
|
25
|
+
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
26
|
+
POSSIBILITY OF SUCH DAMAGE.
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: res-wind-up
|
|
3
|
+
Version: 0.1.5
|
|
4
|
+
Summary: A tool to assess yield uplift of wind turbines
|
|
5
|
+
Author-email: Alex Clerc <alex.clerc@res-group.com>
|
|
6
|
+
License: BSD 3-Clause License
|
|
7
|
+
|
|
8
|
+
Copyright (c) 2024, RENEWABLE ENERGY SYSTEMS LIMITED, all rights reserved.
|
|
9
|
+
|
|
10
|
+
Redistribution and use in source and binary forms, with or without modification, are permitted
|
|
11
|
+
provided that the following conditions are met:
|
|
12
|
+
|
|
13
|
+
* Redistributions of source code must retain the above copyright notice, this list of conditions
|
|
14
|
+
and the following disclaimer.
|
|
15
|
+
|
|
16
|
+
* Redistributions in binary form must reproduce the above copyright notice, this list of
|
|
17
|
+
conditions and the following disclaimer in the documentation and/or other materials provided
|
|
18
|
+
with the distribution.
|
|
19
|
+
|
|
20
|
+
* Neither the name of the copyright holder nor the names of its contributors may be used to
|
|
21
|
+
endorse or promote products derived from this software without specific prior written permission.
|
|
22
|
+
|
|
23
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
|
24
|
+
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
25
|
+
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER
|
|
26
|
+
OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
27
|
+
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
28
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
|
29
|
+
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
|
30
|
+
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
31
|
+
POSSIBILITY OF SUCH DAMAGE.
|
|
32
|
+
|
|
33
|
+
Project-URL: Homepage, https://github.com/resgroup/wind-up
|
|
34
|
+
Classifier: Development Status :: 4 - Beta
|
|
35
|
+
Classifier: Programming Language :: Python :: 3
|
|
36
|
+
Classifier: License :: OSI Approved :: BSD License
|
|
37
|
+
Classifier: Operating System :: OS Independent
|
|
38
|
+
Requires-Python: >=3.10
|
|
39
|
+
Description-Content-Type: text/markdown
|
|
40
|
+
License-File: LICENSE.txt
|
|
41
|
+
Requires-Dist: geographiclib
|
|
42
|
+
Requires-Dist: matplotlib
|
|
43
|
+
Requires-Dist: pandas>=2.0.0
|
|
44
|
+
Requires-Dist: pyarrow
|
|
45
|
+
Requires-Dist: pydantic>=2.0.0
|
|
46
|
+
Requires-Dist: python-dotenv
|
|
47
|
+
Requires-Dist: pyyaml
|
|
48
|
+
Requires-Dist: requests
|
|
49
|
+
Requires-Dist: ruptures
|
|
50
|
+
Requires-Dist: scipy
|
|
51
|
+
Requires-Dist: seaborn
|
|
52
|
+
Requires-Dist: tabulate
|
|
53
|
+
Requires-Dist: toml
|
|
54
|
+
Requires-Dist: utm
|
|
55
|
+
Requires-Dist: tqdm
|
|
56
|
+
Provides-Extra: dev
|
|
57
|
+
Requires-Dist: pytest; extra == "dev"
|
|
58
|
+
Requires-Dist: coverage; extra == "dev"
|
|
59
|
+
Requires-Dist: poethepoet; extra == "dev"
|
|
60
|
+
Requires-Dist: types-pyyaml; extra == "dev"
|
|
61
|
+
Requires-Dist: types-tabulate; extra == "dev"
|
|
62
|
+
Requires-Dist: types-toml; extra == "dev"
|
|
63
|
+
Requires-Dist: types-requests; extra == "dev"
|
|
64
|
+
Requires-Dist: types-tqdm; extra == "dev"
|
|
65
|
+
Requires-Dist: ruff; extra == "dev"
|
|
66
|
+
Requires-Dist: mypy; extra == "dev"
|
|
67
|
+
Provides-Extra: jupyter
|
|
68
|
+
Requires-Dist: jupyterlab; extra == "jupyter"
|
|
69
|
+
Requires-Dist: notebook; extra == "jupyter"
|
|
70
|
+
Requires-Dist: ipywidgets; extra == "jupyter"
|
|
71
|
+
|
|
72
|
+
# wind-up
|
|
73
|
+
A tool to assess yield uplift of wind turbines
|
|
74
|
+
|
|
75
|
+
[](https://github.com/resgroup/wind-up/actions/workflows/CI.yaml)
|
|
76
|
+
[](https://www.python.org/downloads/release/python-3100/)
|
|
77
|
+
[](https://github.com/charliermarsh/ruff)
|
|
78
|
+
[](https://github.com/python/mypy)
|
|
79
|
+
[](https://github.com/nat-n/poethepoet)
|
|
80
|
+
|
|
81
|
+
## Getting Started
|
|
82
|
+
See [`examples`](examples) folder for example analysis using the wind-up package. [`smarteole_example.ipynb`](examples%2Fsmarteole_example.ipynb) is a good place to start.
|
|
83
|
+
|
|
84
|
+
The wind-up package can be installed in a virtual environment with the following commands:
|
|
85
|
+
```shell
|
|
86
|
+
# create and activate a virtual environment, if needed
|
|
87
|
+
python -m venv .venv
|
|
88
|
+
source .venv/Scripts/activate # or .venv/bin/activate on linux or ".venv/Scripts/activate" in Windows command prompt
|
|
89
|
+
# install the wind-up package in the virtual environment
|
|
90
|
+
pip install res-wind-up # alternatively clone the repo, navigate to the wind-up folder and run "pip install ."
|
|
91
|
+
```
|
|
92
|
+
Note that the package is named `wind_up` (with an underscore) in Python code. For example to print the version of the installed package use the following code snippet:
|
|
93
|
+
```python
|
|
94
|
+
import wind_up
|
|
95
|
+
print(wind_up.__version__)
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
## Contributing
|
|
99
|
+
To start making changes fork the repository or make a new branch from `main`. Note `main` is protected;
|
|
100
|
+
if a commit fails to push and you want to undo it try `git reset origin/main --hard`
|
|
101
|
+
|
|
102
|
+
After cloning the repository (and creating and activating the virtual environment), use the following commands to install the wind-up package in editable mode with the dev dependencies:
|
|
103
|
+
```shell
|
|
104
|
+
git clone https://github.com/resgroup/wind-up # or your fork of wind-up
|
|
105
|
+
cd wind-up
|
|
106
|
+
# create and activate a virtual environment
|
|
107
|
+
python -m venv .venv
|
|
108
|
+
source .venv/Scripts/activate # or .venv/bin/activate on linux or ".venv/Scripts/activate" in Windows command prompt
|
|
109
|
+
# install the package in editable mode with the dev dependencies
|
|
110
|
+
pip install -e .[dev] # or .[jupyter,dev] if you want jupyter dependencies as well
|
|
111
|
+
```
|
|
112
|
+
Use `poe all` to run all required pre-push commands (make sure the virtual environment is activated)
|
|
113
|
+
|
|
114
|
+
## Running tests
|
|
115
|
+
Install dev dependencies and use `poe test` to run unit tests (make sure the virtual environment is activated)
|
|
116
|
+
|
|
117
|
+
## License
|
|
118
|
+
See [`LICENSE.txt`](LICENSE.txt)
|
|
119
|
+
|
|
120
|
+
## Contact
|
|
121
|
+
Alex.Clerc@res-group.com
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# wind-up
|
|
2
|
+
A tool to assess yield uplift of wind turbines
|
|
3
|
+
|
|
4
|
+
[](https://github.com/resgroup/wind-up/actions/workflows/CI.yaml)
|
|
5
|
+
[](https://www.python.org/downloads/release/python-3100/)
|
|
6
|
+
[](https://github.com/charliermarsh/ruff)
|
|
7
|
+
[](https://github.com/python/mypy)
|
|
8
|
+
[](https://github.com/nat-n/poethepoet)
|
|
9
|
+
|
|
10
|
+
## Getting Started
|
|
11
|
+
See [`examples`](examples) folder for example analysis using the wind-up package. [`smarteole_example.ipynb`](examples%2Fsmarteole_example.ipynb) is a good place to start.
|
|
12
|
+
|
|
13
|
+
The wind-up package can be installed in a virtual environment with the following commands:
|
|
14
|
+
```shell
|
|
15
|
+
# create and activate a virtual environment, if needed
|
|
16
|
+
python -m venv .venv
|
|
17
|
+
source .venv/Scripts/activate # or .venv/bin/activate on linux or ".venv/Scripts/activate" in Windows command prompt
|
|
18
|
+
# install the wind-up package in the virtual environment
|
|
19
|
+
pip install res-wind-up # alternatively clone the repo, navigate to the wind-up folder and run "pip install ."
|
|
20
|
+
```
|
|
21
|
+
Note that the package is named `wind_up` (with an underscore) in Python code. For example to print the version of the installed package use the following code snippet:
|
|
22
|
+
```python
|
|
23
|
+
import wind_up
|
|
24
|
+
print(wind_up.__version__)
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Contributing
|
|
28
|
+
To start making changes fork the repository or make a new branch from `main`. Note `main` is protected;
|
|
29
|
+
if a commit fails to push and you want to undo it try `git reset origin/main --hard`
|
|
30
|
+
|
|
31
|
+
After cloning the repository (and creating and activating the virtual environment), use the following commands to install the wind-up package in editable mode with the dev dependencies:
|
|
32
|
+
```shell
|
|
33
|
+
git clone https://github.com/resgroup/wind-up # or your fork of wind-up
|
|
34
|
+
cd wind-up
|
|
35
|
+
# create and activate a virtual environment
|
|
36
|
+
python -m venv .venv
|
|
37
|
+
source .venv/Scripts/activate # or .venv/bin/activate on linux or ".venv/Scripts/activate" in Windows command prompt
|
|
38
|
+
# install the package in editable mode with the dev dependencies
|
|
39
|
+
pip install -e .[dev] # or .[jupyter,dev] if you want jupyter dependencies as well
|
|
40
|
+
```
|
|
41
|
+
Use `poe all` to run all required pre-push commands (make sure the virtual environment is activated)
|
|
42
|
+
|
|
43
|
+
## Running tests
|
|
44
|
+
Install dev dependencies and use `poe test` to run unit tests (make sure the virtual environment is activated)
|
|
45
|
+
|
|
46
|
+
## License
|
|
47
|
+
See [`LICENSE.txt`](LICENSE.txt)
|
|
48
|
+
|
|
49
|
+
## Contact
|
|
50
|
+
Alex.Clerc@res-group.com
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "res-wind-up"
|
|
3
|
+
version = "0.1.5"
|
|
4
|
+
authors = [
|
|
5
|
+
{ name = "Alex Clerc", email = "alex.clerc@res-group.com" }
|
|
6
|
+
]
|
|
7
|
+
description = "A tool to assess yield uplift of wind turbines"
|
|
8
|
+
readme = "README.md"
|
|
9
|
+
requires-python = ">=3.10"
|
|
10
|
+
license = { file = "LICENSE.txt" }
|
|
11
|
+
classifiers = [
|
|
12
|
+
"Development Status :: 4 - Beta",
|
|
13
|
+
"Programming Language :: Python :: 3",
|
|
14
|
+
"License :: OSI Approved :: BSD License",
|
|
15
|
+
"Operating System :: OS Independent",
|
|
16
|
+
]
|
|
17
|
+
dependencies = [
|
|
18
|
+
'geographiclib',
|
|
19
|
+
'matplotlib',
|
|
20
|
+
'pandas >= 2.0.0',
|
|
21
|
+
'pyarrow',
|
|
22
|
+
'pydantic >= 2.0.0',
|
|
23
|
+
'python-dotenv',
|
|
24
|
+
'pyyaml',
|
|
25
|
+
'requests',
|
|
26
|
+
'ruptures',
|
|
27
|
+
'scipy',
|
|
28
|
+
'seaborn',
|
|
29
|
+
'tabulate',
|
|
30
|
+
'toml',
|
|
31
|
+
'utm',
|
|
32
|
+
'tqdm',
|
|
33
|
+
]
|
|
34
|
+
|
|
35
|
+
[project.urls]
|
|
36
|
+
Homepage = "https://github.com/resgroup/wind-up"
|
|
37
|
+
|
|
38
|
+
[build-system]
|
|
39
|
+
requires = ["setuptools>=61.0"]
|
|
40
|
+
build-backend = "setuptools.build_meta"
|
|
41
|
+
|
|
42
|
+
[project.optional-dependencies]
|
|
43
|
+
dev = [
|
|
44
|
+
'pytest',
|
|
45
|
+
'coverage',
|
|
46
|
+
'poethepoet',
|
|
47
|
+
'types-pyyaml',
|
|
48
|
+
'types-tabulate',
|
|
49
|
+
'types-toml',
|
|
50
|
+
'types-requests',
|
|
51
|
+
'types-tqdm',
|
|
52
|
+
'ruff',
|
|
53
|
+
'mypy',
|
|
54
|
+
]
|
|
55
|
+
jupyter = [
|
|
56
|
+
'jupyterlab',
|
|
57
|
+
'notebook',
|
|
58
|
+
'ipywidgets',
|
|
59
|
+
]
|
|
60
|
+
|
|
61
|
+
[tool.setuptools.packages.find]
|
|
62
|
+
where = ["."]
|
|
63
|
+
include = ["wind_up*"]
|
|
64
|
+
|
|
65
|
+
[tool.ruff]
|
|
66
|
+
line-length = 120
|
|
67
|
+
target-version = "py310"
|
|
68
|
+
show-fixes = true
|
|
69
|
+
|
|
70
|
+
[tool.ruff.lint]
|
|
71
|
+
select = ["ALL"] # https://beta.ruff.rs/docs/rules/
|
|
72
|
+
ignore = [
|
|
73
|
+
"ANN101", # `self` doesn't need annotations
|
|
74
|
+
"ANN102", # `cls` doesn't need annotations
|
|
75
|
+
"ANN204", # `__init__` doesn't need annotations
|
|
76
|
+
"S301", # `pickle` and modules that wrap it can be unsafe when used to deserialize untrusted data, possible security issue
|
|
77
|
+
"D", # docstring checks
|
|
78
|
+
"PGH004", # Use specific rule codes when using `noqa`. Seems to give false alarms
|
|
79
|
+
"COM812", # can conflict with ruff formatter
|
|
80
|
+
"ISC001", # can conflict with ruff formatter
|
|
81
|
+
"G004", # logging statement can use f-string
|
|
82
|
+
]
|
|
83
|
+
|
|
84
|
+
[tool.ruff.lint.mccabe]
|
|
85
|
+
max-complexity = 12 # try to bring this down to 10
|
|
86
|
+
|
|
87
|
+
[tool.ruff.lint.pylint]
|
|
88
|
+
max-branches = 14 # try to bring this down to 12
|
|
89
|
+
max-statements = 66 # try to bring this down to 50
|
|
90
|
+
max-args = 17 # try to bring this down to 5
|
|
91
|
+
|
|
92
|
+
[tool.ruff.lint.per-file-ignores]
|
|
93
|
+
"wind_up/models.py" = ["N805", "PERF401"] # try to eliminate this
|
|
94
|
+
"tests/**/*.py" = ["S101", "PLR2004"] # allow `assert` and magic values in tests
|
|
95
|
+
"tests/test_smart_data.py" = ["DTZ001"] # SMART functions use tz naive datetimes
|
|
96
|
+
"**/__init__.py" = ["F401"] # ignore unused imports in __init__.py
|
|
97
|
+
"examples/**/*.py" = ["T20"] # allow print in examples
|
|
98
|
+
|
|
99
|
+
[tool.mypy]
|
|
100
|
+
plugins = ["pydantic.mypy"]
|
|
101
|
+
python_version = "3.10"
|
|
102
|
+
exclude = "build|tests|venv|.venv|__ignore__"
|
|
103
|
+
disallow_untyped_defs = true
|
|
104
|
+
|
|
105
|
+
[[tool.mypy.overrides]]
|
|
106
|
+
module = [
|
|
107
|
+
"geographiclib.geodesic",
|
|
108
|
+
"pandas",
|
|
109
|
+
"pandas.testing",
|
|
110
|
+
"ruptures",
|
|
111
|
+
"scipy.stats",
|
|
112
|
+
"seaborn",
|
|
113
|
+
"utm",
|
|
114
|
+
]
|
|
115
|
+
disable_error_code = ["name-defined"]
|
|
116
|
+
ignore_missing_imports = true
|
|
117
|
+
|
|
118
|
+
[tool.pytest.ini_options]
|
|
119
|
+
filterwarnings = [
|
|
120
|
+
"error",
|
|
121
|
+
"ignore:Passing unrecognized arguments to super:DeprecationWarning", # pycharm debugger issue
|
|
122
|
+
"ignore:Passing a BlockManager to DataFrame is deprecated:DeprecationWarning",
|
|
123
|
+
]
|
|
124
|
+
|
|
125
|
+
[tool.coverage.report]
|
|
126
|
+
omit = [
|
|
127
|
+
"wind_up/plots/*.py",
|
|
128
|
+
]
|
|
129
|
+
exclude_lines = ["if __name__ == .__main__.:"]
|
|
130
|
+
|
|
131
|
+
[tool.poe.tasks]
|
|
132
|
+
[tool.poe.tasks.lint]
|
|
133
|
+
help = "Runs formater and linter"
|
|
134
|
+
sequence = [
|
|
135
|
+
{ cmd = "ruff format ." },
|
|
136
|
+
{ cmd = "ruff check . --fix" },
|
|
137
|
+
{ cmd = "mypy ." }
|
|
138
|
+
]
|
|
139
|
+
|
|
140
|
+
[tool.poe.tasks.lint-check]
|
|
141
|
+
help = "Checks formatter and linter"
|
|
142
|
+
sequence = [
|
|
143
|
+
{ cmd = "ruff format . --check" },
|
|
144
|
+
{ cmd = "ruff check ." },
|
|
145
|
+
{ cmd = "mypy ." }
|
|
146
|
+
]
|
|
147
|
+
|
|
148
|
+
[tool.poe.tasks.test]
|
|
149
|
+
help = "Runs unit tests and show coverage"
|
|
150
|
+
sequence = [
|
|
151
|
+
{ cmd = "coverage run --source wind_up -m pytest ./tests" },
|
|
152
|
+
{ cmd = "coverage report -m" },
|
|
153
|
+
]
|
|
154
|
+
|
|
155
|
+
[tool.poe.tasks.all]
|
|
156
|
+
help = "Run all required pre-push commands"
|
|
157
|
+
sequence = [{ ref = "lint" }, { ref = "test" }]
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: res-wind-up
|
|
3
|
+
Version: 0.1.5
|
|
4
|
+
Summary: A tool to assess yield uplift of wind turbines
|
|
5
|
+
Author-email: Alex Clerc <alex.clerc@res-group.com>
|
|
6
|
+
License: BSD 3-Clause License
|
|
7
|
+
|
|
8
|
+
Copyright (c) 2024, RENEWABLE ENERGY SYSTEMS LIMITED, all rights reserved.
|
|
9
|
+
|
|
10
|
+
Redistribution and use in source and binary forms, with or without modification, are permitted
|
|
11
|
+
provided that the following conditions are met:
|
|
12
|
+
|
|
13
|
+
* Redistributions of source code must retain the above copyright notice, this list of conditions
|
|
14
|
+
and the following disclaimer.
|
|
15
|
+
|
|
16
|
+
* Redistributions in binary form must reproduce the above copyright notice, this list of
|
|
17
|
+
conditions and the following disclaimer in the documentation and/or other materials provided
|
|
18
|
+
with the distribution.
|
|
19
|
+
|
|
20
|
+
* Neither the name of the copyright holder nor the names of its contributors may be used to
|
|
21
|
+
endorse or promote products derived from this software without specific prior written permission.
|
|
22
|
+
|
|
23
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
|
24
|
+
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
25
|
+
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER
|
|
26
|
+
OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
27
|
+
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
28
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
|
29
|
+
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
|
30
|
+
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
31
|
+
POSSIBILITY OF SUCH DAMAGE.
|
|
32
|
+
|
|
33
|
+
Project-URL: Homepage, https://github.com/resgroup/wind-up
|
|
34
|
+
Classifier: Development Status :: 4 - Beta
|
|
35
|
+
Classifier: Programming Language :: Python :: 3
|
|
36
|
+
Classifier: License :: OSI Approved :: BSD License
|
|
37
|
+
Classifier: Operating System :: OS Independent
|
|
38
|
+
Requires-Python: >=3.10
|
|
39
|
+
Description-Content-Type: text/markdown
|
|
40
|
+
License-File: LICENSE.txt
|
|
41
|
+
Requires-Dist: geographiclib
|
|
42
|
+
Requires-Dist: matplotlib
|
|
43
|
+
Requires-Dist: pandas>=2.0.0
|
|
44
|
+
Requires-Dist: pyarrow
|
|
45
|
+
Requires-Dist: pydantic>=2.0.0
|
|
46
|
+
Requires-Dist: python-dotenv
|
|
47
|
+
Requires-Dist: pyyaml
|
|
48
|
+
Requires-Dist: requests
|
|
49
|
+
Requires-Dist: ruptures
|
|
50
|
+
Requires-Dist: scipy
|
|
51
|
+
Requires-Dist: seaborn
|
|
52
|
+
Requires-Dist: tabulate
|
|
53
|
+
Requires-Dist: toml
|
|
54
|
+
Requires-Dist: utm
|
|
55
|
+
Requires-Dist: tqdm
|
|
56
|
+
Provides-Extra: dev
|
|
57
|
+
Requires-Dist: pytest; extra == "dev"
|
|
58
|
+
Requires-Dist: coverage; extra == "dev"
|
|
59
|
+
Requires-Dist: poethepoet; extra == "dev"
|
|
60
|
+
Requires-Dist: types-pyyaml; extra == "dev"
|
|
61
|
+
Requires-Dist: types-tabulate; extra == "dev"
|
|
62
|
+
Requires-Dist: types-toml; extra == "dev"
|
|
63
|
+
Requires-Dist: types-requests; extra == "dev"
|
|
64
|
+
Requires-Dist: types-tqdm; extra == "dev"
|
|
65
|
+
Requires-Dist: ruff; extra == "dev"
|
|
66
|
+
Requires-Dist: mypy; extra == "dev"
|
|
67
|
+
Provides-Extra: jupyter
|
|
68
|
+
Requires-Dist: jupyterlab; extra == "jupyter"
|
|
69
|
+
Requires-Dist: notebook; extra == "jupyter"
|
|
70
|
+
Requires-Dist: ipywidgets; extra == "jupyter"
|
|
71
|
+
|
|
72
|
+
# wind-up
|
|
73
|
+
A tool to assess yield uplift of wind turbines
|
|
74
|
+
|
|
75
|
+
[](https://github.com/resgroup/wind-up/actions/workflows/CI.yaml)
|
|
76
|
+
[](https://www.python.org/downloads/release/python-3100/)
|
|
77
|
+
[](https://github.com/charliermarsh/ruff)
|
|
78
|
+
[](https://github.com/python/mypy)
|
|
79
|
+
[](https://github.com/nat-n/poethepoet)
|
|
80
|
+
|
|
81
|
+
## Getting Started
|
|
82
|
+
See [`examples`](examples) folder for example analysis using the wind-up package. [`smarteole_example.ipynb`](examples%2Fsmarteole_example.ipynb) is a good place to start.
|
|
83
|
+
|
|
84
|
+
The wind-up package can be installed in a virtual environment with the following commands:
|
|
85
|
+
```shell
|
|
86
|
+
# create and activate a virtual environment, if needed
|
|
87
|
+
python -m venv .venv
|
|
88
|
+
source .venv/Scripts/activate # or .venv/bin/activate on linux or ".venv/Scripts/activate" in Windows command prompt
|
|
89
|
+
# install the wind-up package in the virtual environment
|
|
90
|
+
pip install res-wind-up # alternatively clone the repo, navigate to the wind-up folder and run "pip install ."
|
|
91
|
+
```
|
|
92
|
+
Note that the package is named `wind_up` (with an underscore) in Python code. For example to print the version of the installed package use the following code snippet:
|
|
93
|
+
```python
|
|
94
|
+
import wind_up
|
|
95
|
+
print(wind_up.__version__)
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
## Contributing
|
|
99
|
+
To start making changes fork the repository or make a new branch from `main`. Note `main` is protected;
|
|
100
|
+
if a commit fails to push and you want to undo it try `git reset origin/main --hard`
|
|
101
|
+
|
|
102
|
+
After cloning the repository (and creating and activating the virtual environment), use the following commands to install the wind-up package in editable mode with the dev dependencies:
|
|
103
|
+
```shell
|
|
104
|
+
git clone https://github.com/resgroup/wind-up # or your fork of wind-up
|
|
105
|
+
cd wind-up
|
|
106
|
+
# create and activate a virtual environment
|
|
107
|
+
python -m venv .venv
|
|
108
|
+
source .venv/Scripts/activate # or .venv/bin/activate on linux or ".venv/Scripts/activate" in Windows command prompt
|
|
109
|
+
# install the package in editable mode with the dev dependencies
|
|
110
|
+
pip install -e .[dev] # or .[jupyter,dev] if you want jupyter dependencies as well
|
|
111
|
+
```
|
|
112
|
+
Use `poe all` to run all required pre-push commands (make sure the virtual environment is activated)
|
|
113
|
+
|
|
114
|
+
## Running tests
|
|
115
|
+
Install dev dependencies and use `poe test` to run unit tests (make sure the virtual environment is activated)
|
|
116
|
+
|
|
117
|
+
## License
|
|
118
|
+
See [`LICENSE.txt`](LICENSE.txt)
|
|
119
|
+
|
|
120
|
+
## Contact
|
|
121
|
+
Alex.Clerc@res-group.com
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
LICENSE.txt
|
|
2
|
+
README.md
|
|
3
|
+
pyproject.toml
|
|
4
|
+
res_wind_up.egg-info/PKG-INFO
|
|
5
|
+
res_wind_up.egg-info/SOURCES.txt
|
|
6
|
+
res_wind_up.egg-info/dependency_links.txt
|
|
7
|
+
res_wind_up.egg-info/requires.txt
|
|
8
|
+
res_wind_up.egg-info/top_level.txt
|
|
9
|
+
tests/test_combine_results.py
|
|
10
|
+
tests/test_conversions.py
|
|
11
|
+
tests/test_detrend.py
|
|
12
|
+
tests/test_helpers.py
|
|
13
|
+
tests/test_long_term.py
|
|
14
|
+
tests/test_main_analysis.py
|
|
15
|
+
tests/test_math_funcs.py
|
|
16
|
+
tests/test_models.py
|
|
17
|
+
tests/test_northing.py
|
|
18
|
+
tests/test_optimize_northing.py
|
|
19
|
+
tests/test_power_curve.py
|
|
20
|
+
tests/test_pp_analysis.py
|
|
21
|
+
tests/test_reanalysis_data.py
|
|
22
|
+
tests/test_scada_funcs.py
|
|
23
|
+
tests/test_smart_data.py
|
|
24
|
+
tests/test_version.py
|
|
25
|
+
tests/test_waking_state.py
|
|
26
|
+
tests/test_wind_funcs.py
|
|
27
|
+
tests/test_windspeed_drift.py
|
|
28
|
+
tests/test_ws_est.py
|
|
29
|
+
wind_up/__init__.py
|
|
30
|
+
wind_up/caching.py
|
|
31
|
+
wind_up/combine_results.py
|
|
32
|
+
wind_up/constants.py
|
|
33
|
+
wind_up/conversions.py
|
|
34
|
+
wind_up/detrend.py
|
|
35
|
+
wind_up/interface.py
|
|
36
|
+
wind_up/long_term.py
|
|
37
|
+
wind_up/main_analysis.py
|
|
38
|
+
wind_up/math_funcs.py
|
|
39
|
+
wind_up/models.py
|
|
40
|
+
wind_up/northing.py
|
|
41
|
+
wind_up/northing_utils.py
|
|
42
|
+
wind_up/optimize_northing.py
|
|
43
|
+
wind_up/pp_analysis.py
|
|
44
|
+
wind_up/reanalysis_data.py
|
|
45
|
+
wind_up/result_manager.py
|
|
46
|
+
wind_up/scada_funcs.py
|
|
47
|
+
wind_up/scada_power_curve.py
|
|
48
|
+
wind_up/smart_data.py
|
|
49
|
+
wind_up/waking_state.py
|
|
50
|
+
wind_up/wind_funcs.py
|
|
51
|
+
wind_up/windspeed_drift.py
|
|
52
|
+
wind_up/ws_est.py
|
|
53
|
+
wind_up/yaml_loader.py
|
|
54
|
+
wind_up/plots/__init__.py
|
|
55
|
+
wind_up/plots/combine_results_plots.py
|
|
56
|
+
wind_up/plots/data_coverage_plots.py
|
|
57
|
+
wind_up/plots/detrend_plots.py
|
|
58
|
+
wind_up/plots/long_term_plots.py
|
|
59
|
+
wind_up/plots/misc_plots.py
|
|
60
|
+
wind_up/plots/northing_plots.py
|
|
61
|
+
wind_up/plots/optimize_northing_plots.py
|
|
62
|
+
wind_up/plots/pp_analysis_plots.py
|
|
63
|
+
wind_up/plots/reanalysis_plots.py
|
|
64
|
+
wind_up/plots/scada_funcs_plots.py
|
|
65
|
+
wind_up/plots/scada_power_curve_plots.py
|
|
66
|
+
wind_up/plots/waking_state_plots.py
|
|
67
|
+
wind_up/plots/windspeed_drift_plots.py
|
|
68
|
+
wind_up/plots/ws_est_plots.py
|
|
69
|
+
wind_up/plots/yaw_direction_plots.py
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
geographiclib
|
|
2
|
+
matplotlib
|
|
3
|
+
pandas>=2.0.0
|
|
4
|
+
pyarrow
|
|
5
|
+
pydantic>=2.0.0
|
|
6
|
+
python-dotenv
|
|
7
|
+
pyyaml
|
|
8
|
+
requests
|
|
9
|
+
ruptures
|
|
10
|
+
scipy
|
|
11
|
+
seaborn
|
|
12
|
+
tabulate
|
|
13
|
+
toml
|
|
14
|
+
utm
|
|
15
|
+
tqdm
|
|
16
|
+
|
|
17
|
+
[dev]
|
|
18
|
+
pytest
|
|
19
|
+
coverage
|
|
20
|
+
poethepoet
|
|
21
|
+
types-pyyaml
|
|
22
|
+
types-tabulate
|
|
23
|
+
types-toml
|
|
24
|
+
types-requests
|
|
25
|
+
types-tqdm
|
|
26
|
+
ruff
|
|
27
|
+
mypy
|
|
28
|
+
|
|
29
|
+
[jupyter]
|
|
30
|
+
jupyterlab
|
|
31
|
+
notebook
|
|
32
|
+
ipywidgets
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
wind_up
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
from pathlib import Path
|
|
2
|
+
|
|
3
|
+
import pandas as pd
|
|
4
|
+
from pandas.testing import assert_frame_equal
|
|
5
|
+
|
|
6
|
+
from wind_up.combine_results import combine_results
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def calc_expected_combine_results(trdf: pd.DataFrame) -> pd.DataFrame:
|
|
10
|
+
p50_uplift = (trdf["uplift_frc"] * (1 / trdf["unc_one_sigma_frc"] ** 2)).sum() / (
|
|
11
|
+
1 / trdf["unc_one_sigma_frc"] ** 2
|
|
12
|
+
).sum()
|
|
13
|
+
sigma_correlated = (1 / trdf["unc_one_sigma_frc"]).sum() / (1 / trdf["unc_one_sigma_frc"] ** 2).sum()
|
|
14
|
+
sigma_independent = (
|
|
15
|
+
(
|
|
16
|
+
(
|
|
17
|
+
trdf["unc_one_sigma_frc"]
|
|
18
|
+
* 1
|
|
19
|
+
/ (trdf["unc_one_sigma_frc"] ** 2)
|
|
20
|
+
/ (1 / (trdf["unc_one_sigma_frc"] ** 2)).sum()
|
|
21
|
+
)
|
|
22
|
+
** 2
|
|
23
|
+
).sum()
|
|
24
|
+
) ** 0.5
|
|
25
|
+
sigma_test = (sigma_independent + sigma_correlated) / 2
|
|
26
|
+
return pd.DataFrame(
|
|
27
|
+
data={
|
|
28
|
+
"test_wtg": ["test1"],
|
|
29
|
+
"p50_uplift": [p50_uplift],
|
|
30
|
+
"sigma": [sigma_test],
|
|
31
|
+
"sigma_test": [sigma_test],
|
|
32
|
+
"sigma_uncorr": [sigma_independent],
|
|
33
|
+
"sigma_corr": [sigma_correlated],
|
|
34
|
+
},
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
def test_combine_two_refs() -> None:
|
|
39
|
+
trdf = pd.DataFrame(
|
|
40
|
+
data={
|
|
41
|
+
"test_wtg": ["test1", "test1"],
|
|
42
|
+
"ref": ["ref1", "ref2"],
|
|
43
|
+
"uplift_frc": [0.02, 0.02],
|
|
44
|
+
"unc_one_sigma_frc": [0.02, 0.02],
|
|
45
|
+
},
|
|
46
|
+
)
|
|
47
|
+
edf = calc_expected_combine_results(trdf)
|
|
48
|
+
tdf = combine_results(trdf=trdf, auto_choose_refs=False)
|
|
49
|
+
tdf = tdf[edf.columns.tolist()]
|
|
50
|
+
assert_frame_equal(edf, tdf)
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
def test_combine_three_refs() -> None:
|
|
54
|
+
trdf = pd.DataFrame(
|
|
55
|
+
data={
|
|
56
|
+
"test_wtg": ["test1", "test1", "test1"],
|
|
57
|
+
"ref": ["ref1", "ref2", "ref3"],
|
|
58
|
+
"uplift_frc": [0.01, 0.02, 0.03],
|
|
59
|
+
"unc_one_sigma_frc": [0.03, 0.02, 0.01],
|
|
60
|
+
},
|
|
61
|
+
)
|
|
62
|
+
edf = calc_expected_combine_results(trdf)
|
|
63
|
+
|
|
64
|
+
tdf = combine_results(trdf=trdf, auto_choose_refs=False)
|
|
65
|
+
|
|
66
|
+
tdf = tdf[edf.columns.tolist()]
|
|
67
|
+
assert_frame_equal(edf, tdf)
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
def test_brt_t16_pitch() -> None:
|
|
71
|
+
trdf = pd.read_csv(Path(__file__).parents[0] / "test_data/trdf_BRT_T16_pitch_Sep23.csv", index_col=0)
|
|
72
|
+
edf = pd.read_csv(Path(__file__).parents[0] / "test_data/tdf_BRT_T16_pitch.csv", index_col=0)
|
|
73
|
+
tdf = combine_results(trdf=trdf)
|
|
74
|
+
assert_frame_equal(edf, tdf)
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
def test_brt_t16_pitch_no_auto_choose() -> None:
|
|
78
|
+
trdf = pd.read_csv(Path(__file__).parents[0] / "test_data/trdf_BRT_T16_pitch_Sep23.csv", index_col=0)
|
|
79
|
+
edf = pd.read_csv(Path(__file__).parents[0] / "test_data/tdf_BRT_T16_pitch_no_auto_choose.csv", index_col=0)
|
|
80
|
+
tdf = combine_results(trdf=trdf, auto_choose_refs=False)
|
|
81
|
+
assert_frame_equal(edf, tdf)
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
def test_brt_t16_pitch_exclude_refs() -> None:
|
|
85
|
+
trdf = pd.read_csv(Path(__file__).parents[0] / "test_data/trdf_BRT_T16_pitch_Sep23.csv", index_col=0)
|
|
86
|
+
edf = pd.read_csv(Path(__file__).parents[0] / "test_data/tdf_BRT_T16_pitch_exclude_refs.csv", index_col=0)
|
|
87
|
+
# all but one ref excluded
|
|
88
|
+
tdf = combine_results(trdf=trdf, auto_choose_refs=False, exclude_refs=["BRT_T02", "BRT_T03", "BRT_T04", "BRT_T14"])
|
|
89
|
+
assert_frame_equal(edf, tdf)
|