tools.debugging   A
last analyzed

Complexity

Total Complexity 0

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 38
rs 10
c 0
b 0
f 0
wmc 0
1
# -*- coding: utf-8 -*-
2
3
"""Module contains tools facilitating debugging
4
5
This file is part of project oemof (github.com/oemof/oemof). It's copyrighted
6
by the contributors recorded in the version control history of the file,
7
available from its original location oemof/oemof/tools/economics.py
8
9
SPDX-License-Identifier: MIT
10
"""
11
12
13
class SuspiciousUsageWarning(UserWarning):
14
    """
15
    Warn the user about potentially dangerous usage.
16
17
    Some ways of using `oemof` are not necessarily wrong but could lead to
18
    hard to find bugs if done accidentally instead of intentionally. We
19
    use these warnings, and you can do too ;), in your code to warn users about
20
    these cases. If you know what you are doing and these warnings point you to
21
    things you are doing intentionally, you can easily switch them off.
22
23
    Note
24
    ----
25
    TODO: Fix ref!
26
    See :ref:`oemof_tools_debugging_suspicioususagewarningsolph_label` for more
27
    information.
28
29
    Examples
30
    --------
31
    >>> import warnings
32
    >>> warnings.filterwarnings("ignore", category=SuspiciousUsageWarning)
33
    """
34
35
36
class ExperimentalFeatureWarning(UserWarning):
37
    """
38
    Warn the user about use of experimental features.
39
40
    New modules first go to "experimental" ti highlight their unmature state.
41
    Sometimes, functionality is added to existing code. We use this warning
42
    to warn users in these cases.
43
    """
44