MCPcopy Create free account
hub / github.com/DeepGraphLearning/DiffPack / meshgrid

Function meshgrid

diffpack/util.py:17–32  ·  view source on GitHub ↗
(dict)

Source from the content-addressed store, hash-verified

15
16
17def meshgrid(dict):
18 if len(dict) == 0:
19 yield {}
20 return
21
22 key = next(iter(dict))
23 values = dict[key]
24 sub_dict = dict.copy()
25 sub_dict.pop(key)
26
27 if not isinstance(values, list):
28 values = [values]
29 for value in values:
30 for result in meshgrid(sub_dict):
31 result[key] = value
32 yield result
33
34
35def load_config(cfg_file):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected