MCPcopy Create free account
hub / github.com/ahalev/python-microgrid / get_module

Function get_module

src/pymgrid/convert/get_module.py:5–19  ·  view source on GitHub ↗
(component, nonmodular, raise_errors)

Source from the content-addressed store, hash-verified

3
4
5def get_module(component, nonmodular, raise_errors):
6 if component == 'load':
7 return get_load_module(nonmodular, raise_errors)
8 elif component == 'pv':
9 return get_pv_module(nonmodular, raise_errors)
10 elif component == 'battery':
11 return get_battery_module(nonmodular, raise_errors)
12 elif component == 'genset':
13 return get_genset_module(nonmodular, raise_errors)
14 elif component == 'grid':
15 return get_grid_module(nonmodular, raise_errors)
16 elif component == 'unbalanced_energy':
17 return get_unbalanced_energy_module(nonmodular, raise_errors)
18 else:
19 raise ValueError(f'Cannot parse component {component}.')
20
21
22def get_load_module(nonmodular, raise_errors):

Callers 1

to_modularFunction · 0.90

Calls 6

get_load_moduleFunction · 0.85
get_pv_moduleFunction · 0.85
get_battery_moduleFunction · 0.85
get_genset_moduleFunction · 0.85
get_grid_moduleFunction · 0.85

Tested by

no test coverage detected