MCPcopy Create free account
hub / github.com/OpenBMB/BMList / get_model_list

Function get_model_list

main.py:21–36  ·  view source on GitHub ↗

Get a model list from all yaml files in `main_path`.

(main_path)

Source from the content-addressed store, hash-verified

19
20
21def get_model_list(main_path):
22 """
23 Get a model list from all yaml files in `main_path`.
24 """
25 files = os.listdir(main_path)
26 model_list = list()
27
28 for file in files:
29 f = open(os.path.join(main_path, file), "r")
30 data = yaml.load(f.read(), Loader=yaml.FullLoader)
31 model_list.append(data)
32 f.close()
33
34 model_list = sorted(model_list, key=lambda x: (x["release_date"], x["name"]))
35
36 return model_list
37
38
39def write_to_json(model_list, output_file):

Callers 1

main.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected