Passed
Pull Request — dev (#31)
by Stephan
56s
created

data.config   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 9
dl 0
loc 26
rs 10
c 0
b 0
f 0

1 Function

Rating   Name   Duplication   Size   Complexity  
A datasets() 0 18 2
1
import os
2
3
import yaml
4
5
import egon
6
7
8
def datasets(config_file=None):
9
    """Return dataset configuration.
10
11
    Parameters
12
    ----------
13
    config_file : str
14
        Path of the dataset configuration file
15
16
    Returns
17
    -------
18
    dict
19
        Dataset configuration
20
    """
21
    if not config_file:
22
        package_path = egon.data.__path__[0]
23
        config_file = os.path.join(package_path, "data_sets.yml")
24
25
    return yaml.load(open(config_file), Loader=yaml.SafeLoader)
26