From 4ca961c7c3a67b26f710a71023cc86439175b2a8 Mon Sep 17 00:00:00 2001 From: Casper Welzel Andersen Date: Fri, 10 Jan 2020 13:24:23 +0100 Subject: [PATCH] Fetch provider links from optimade.org --- optimade/server/data/test_links.json | 2 +- optimade/server/index_links.json | 2 +- optimade/server/main.py | 4 +--- optimade/server/routers/utils.py | 4 ++-- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/optimade/server/data/test_links.json b/optimade/server/data/test_links.json index b2e42d82a..889532f20 100644 --- a/optimade/server/data/test_links.json +++ b/optimade/server/data/test_links.json @@ -8,6 +8,6 @@ "name": "Index meta-database", "description": "Index for example's OPTiMaDe databases", "base_url": "http://localhost:5001/index/optimade", - "homepage": "https://example.org" + "homepage": "https://example.com" } ] diff --git a/optimade/server/index_links.json b/optimade/server/index_links.json index e627c593b..3c499c549 100644 --- a/optimade/server/index_links.json +++ b/optimade/server/index_links.json @@ -8,6 +8,6 @@ "name": "OPTiMaDe API", "description": "The [Open Databases Integration for Materials Design (OPTiMaDe) consortium](http://http://www.optimade.org/) aims to make materials databases interoperational by developing a common REST API.", "base_url": "http://localhost:5000/optimade", - "homepage": "https://example.org" + "homepage": "https://example.com" } ] diff --git a/optimade/server/main.py b/optimade/server/main.py index c873d66b4..0d8a18886 100644 --- a/optimade/server/main.py +++ b/optimade/server/main.py @@ -47,9 +47,7 @@ def load_entries(endpoint_name: str, endpoint_collection: MongoCollection): bson.json_util.loads(bson.json_util.dumps(data)) ) if endpoint_name == "links": - print( - "adding providers.json to links from github.com/Materials-Consortia/OPTiMaDe" - ) + print("adding Materials-Consortia providers to links from optimade.org") endpoint_collection.collection.insert_many( bson.json_util.loads(bson.json_util.dumps(get_providers())) ) diff --git a/optimade/server/routers/utils.py b/optimade/server/routers/utils.py index 6ce0db252..99cd3122e 100644 --- a/optimade/server/routers/utils.py +++ b/optimade/server/routers/utils.py @@ -243,12 +243,12 @@ def retrieve_queryable_properties(schema: dict, queryable_properties: list) -> d def get_providers(): - """Retrieve providers.json from /Materials-Consortia/OPTiMaDe""" + """Retrieve Materials-Consortia providers (from https://www.optimade.org/providers/links)""" import requests from bson.objectid import ObjectId mat_consortia_providers = requests.get( - "https://raw.githubusercontent.com/Materials-Consortia/OPTiMaDe/master/providers.json" + "https://www.optimade.org/providers/links" ).json() providers_list = []