Passed
Pull Request — dev (#31)
by
unknown
54s
created

data.config.datasets()   A

Complexity

Conditions 2

Size

Total Lines 19
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 19
rs 10
c 0
b 0
f 0
cc 2
nop 1
1
import os
2
3
import yaml
4
5
import egon
6
7
8
def datasets(config_file=None):
9
    """
10
    Return data set configuration.
11
12
    Parameters
13
    ----------
14
    config_file : str
15
        Path to the data set configuration file
16
17
    Returns
18
    -------
19
    dict
20
        Data set configuration
21
    """
22
    if not config_file:
23
        package_path = egon.data.__path__[0]
24
        config_file = os.path.join(package_path, "data_sets.yml")
25
26
    return yaml.load(open(config_file), Loader=yaml.SafeLoader)
27