def test_find_entries(names): for name in names: _find_entries(name, None)
url = ( "https://raw.githubusercontent.com/hainegroup/oceanspy/" "master/sciserver_catalogs/datasets_list.yaml" ) f = urllib.request.urlopen(url) SCISERVER_DATASETS = yaml.safe_load(f)["datasets"]["sciserver"] for name in SCISERVER_DATASETS: if name == "Arctic_Control": continue # Section rst.write(".. _" + name + ":\n\n") rst.write("{}\n{}\n{}\n\n".format("-" * len(name), name, "-" * len(name))) cat, entries, url, intake_switch = _find_entries(name, None) metadata = {} for entry in entries: if intake_switch: mtdt = cat[entry].metadata else: mtdt = cat[entry].pop("metadata", None) metadata = {**metadata, **mtdt} # Description toprint = metadata.pop("description", None) for add_str in ["citation", "characteristics", "mates"]: thisprint = metadata.pop(add_str, None) if thisprint is not None: if add_str == "mates": add_str = "see also"