Skip to content

Commit 2297c2f

Browse files
committed
Add a WindpowerlibUserWarning for untypical behaviour
1 parent 6b06924 commit 2297c2f

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

windpowerlib/tools.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,22 @@
99
__license__ = "GPLv3"
1010

1111
import numpy as np
12+
import warnings
13+
14+
15+
class WindpowerlibUserWarning(UserWarning):
16+
"""
17+
The WindpowerlibUserWarning is used to warn users if they use the
18+
windpowerlib in an untypical way. It is not necessarily wrong but could
19+
lead to an unwanted behaviour if you do not know what you are doing.
20+
If you know what you are doing you can easily switch the warnings off:
21+
22+
Examples
23+
--------
24+
>>> import warnings
25+
>>> warnings.filterwarnings("ignore", category=WindpowerlibUserWarning)
26+
"""
27+
pass
1228

1329

1430
def linear_interpolation_extrapolation(df, target_height):

0 commit comments

Comments
 (0)