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

Function _extract_observation_spaces

src/pymgrid/utils/space/space.py:28–40  ·  view source on GitHub ↗
(d)

Source from the content-addressed store, hash-verified

26
27
28def _extract_observation_spaces(d):
29 obs_spaces = {}
30 for module_name, module_list in d.items():
31 try:
32 module_list = module_list.to_dict() # module_list is pd.Series
33 spaces = module_list['observation_space']
34 except AttributeError:
35 spaces = [v['observation_space'] for v in module_list]
36
37 if spaces:
38 obs_spaces[module_name] = spaces
39
40 return obs_spaces
41
42
43def _transform_builtins(d, normalized=False):

Callers 1

extract_builtinsFunction · 0.85

Calls 1

to_dictMethod · 0.45

Tested by

no test coverage detected