From 1acd1854f7a945912b89f55408fa4e3d5e59f418 Mon Sep 17 00:00:00 2001 From: Thomas Kluyver <thomas@kluyver.me.uk> Date: Thu, 25 Aug 2022 13:40:53 +0100 Subject: [PATCH] Remove unused get_run_info() function --- src/cal_tools/tools.py | 31 ------------------------------- 1 file changed, 31 deletions(-) diff --git a/src/cal_tools/tools.py b/src/cal_tools/tools.py index 0d0c0de7f..ae42e894f 100644 --- a/src/cal_tools/tools.py +++ b/src/cal_tools/tools.py @@ -21,11 +21,9 @@ import yaml import zmq from extra_data import H5File, RunDirectory from iCalibrationDB import ConstantMetaData, Versions -from metadata_client.metadata_client import MetadataClient from notebook.notebookapp import list_running_servers from .ana_tools import save_dict_to_hdf5 -from .restful_config import restful_config def parse_runs(runs, return_type=str): @@ -248,35 +246,6 @@ def get_notebook_name(): return environ.get("CAL_NOTEBOOK_NAME", "Unknown Notebook") -def get_run_info(proposal, run): - """Return information about run from the MDC - - :param proposal: proposal number - :param run: run number - :return: dictionary with run information - """ - - mdc_config = restful_config['mdc'] - mdc = MetadataClient( - client_id=mdc_config['user-id'], - client_secret=mdc_config['user-secret'], - user_email=mdc_config['user-email'], - token_url=mdc_config['token-url'], - refresh_url=mdc_config['refresh-url'], - auth_url=mdc_config['auth-url'], - scope=mdc_config['scope'], - base_api_url=mdc_config['base-api-url'], - ) - - mdc_response = mdc.get_proposal_runs( - proposal_number=proposal, run_number=run) - - if mdc_response["success"]: - return mdc_response - else: # empty dictionary for wrong proposal or run. - raise KeyError(mdc_response['app_info']) - - def creation_date_file_metadata( run_folder: Path, ) -> Optional[datetime.datetime]: -- GitLab