From ee50394c5e2312a810368a3d2850909a416d54a7 Mon Sep 17 00:00:00 2001 From: Tom Kralidis Date: Sat, 23 Mar 2024 09:00:26 -0400 Subject: [PATCH] fixes --- woudc_data_registry/processing.py | 6 +++--- .../product/uv_index/uv_index_generator.py | 12 ++++++------ woudc_data_registry/registry.py | 4 ++-- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/woudc_data_registry/processing.py b/woudc_data_registry/processing.py index fff3ec7..d0bbc25 100644 --- a/woudc_data_registry/processing.py +++ b/woudc_data_registry/processing.py @@ -375,7 +375,7 @@ def add_deployment(self, bypass=False): LOGGER.info('Bypass mode. Skipping permission check.') allow_add_deployment = True else: - response = input(f'Deployment {deployment.deployment_id} not found. Add? (y/n) [n]: ' # noqa + response = input(f'Deployment {deployment.deployment_id} not found. Add? (y/n) [n]: ') # noqa allow_add_deployment = response.lower() in ['y', 'yes'] if not allow_add_deployment: @@ -507,7 +507,7 @@ def add_contribution(self, bypass=False): LOGGER.info('Bypass mode. Skipping permission check') allow_add_contribution = True else: - response = input(f'Contribution {contribution.contribution_id} not found. Add? (y/n) [n]: ') + response = input(f'Contribution {contribution.contribution_id} not found. Add? (y/n) [n]: ') # noqa allow_add_contribution = response.lower() in ['y', 'yes'] if allow_add_contribution: @@ -881,7 +881,7 @@ def check_instrument(self): LOGGER.warning(f'No instrument {instrument.instrument_id} found in registry') # noqa return False else: - LOGGER.debug(f'Found instrument match for {instrument.instrument_id}' # noqa + LOGGER.debug(f'Found instrument match for {instrument.instrument_id}') # noqa self.extcsv.extcsv['INSTRUMENT']['Number'] = response.serial return True diff --git a/woudc_data_registry/product/uv_index/uv_index_generator.py b/woudc_data_registry/product/uv_index/uv_index_generator.py index c2ff8b3..ac8bf3d 100644 --- a/woudc_data_registry/product/uv_index/uv_index_generator.py +++ b/woudc_data_registry/product/uv_index/uv_index_generator.py @@ -349,7 +349,7 @@ def compute_uv_index(ipath, extcsv, dataset, station, try: uv = float(uv) except ValueError as err: - msg = (f'Unable to make UVIndex: {uv} value into a float.' + msg = (f'Unable to make UVIndex: {uv} value into a float.' # noqa f' Time: {time}, file: {ipath}: {err}') LOGGER.error(msg) pass @@ -362,7 +362,7 @@ def compute_uv_index(ipath, extcsv, dataset, station, try: zen_angle = extcsv.extcsv[global_summary_nsf_t]['SZA'][0] except Exception as err: - msg = (f'Unable to get {global_summary_nsf_t}.SZA from file {ipath}: {err}' # noqa + msg = f'Unable to get {global_summary_nsf_t}.SZA from file {ipath}: {err}' # noqa LOGGER.error(msg) pass @@ -374,7 +374,7 @@ def compute_uv_index(ipath, extcsv, dataset, station, intcie_f = float(intcie) except Exception as err: msg = ('Unable to convert to float intcie:' - f' {intcie}. File: {ipath}. Time: {time}: {err}' + f' {intcie}. File: {ipath}. Time: {time}: {err}') # noqa LOGGER.error(msg) continue # compute @@ -392,12 +392,12 @@ def compute_uv_index(ipath, extcsv, dataset, station, extcsv.extcsv[global_summary_t]['ZenAngle'][0] except Exception as err: msg = (f'Unable to get {global_summary_t}.ZenAngle from file: {ipath}' # noqa - 'Time: {time}: {err}') + f'Time: {time}: {err}') LOGGER.error(msg) pass except Exception as err: - msg = (f'Unable to get {global_summary_t}.IntCIE from file: {ipath}. Time: {time}: {err}' # noqa + msg = f'Unable to get {global_summary_t}.IntCIE from file: {ipath}. Time: {time}: {err}' # noqa LOGGER.error(msg) continue @@ -462,7 +462,7 @@ def compute_uv_index(ipath, extcsv, dataset, station, irradiances = extcsv.extcsv['GLOBAL']['Irradiance'] except Exception as err: msg = (f'Unable to get GLOBAL.Irradiance values from file {ipath}:' - '{err}. Trying DIFFUSE.Irradiance') + f'{err}. Trying DIFFUSE.Irradiance') LOGGER.error(msg) # try DIFFUSE if irradiances is None: diff --git a/woudc_data_registry/registry.py b/woudc_data_registry/registry.py index ec67f7f..5688fe3 100644 --- a/woudc_data_registry/registry.py +++ b/woudc_data_registry/registry.py @@ -333,7 +333,7 @@ def save(self, obj=None): self.session.add(obj) # self.session.merge(obj) else: - LOGGER.info(f'Registry persistence for model {obj.__tablename__}} disabled, skipping') # noqa + LOGGER.info(f'Registry persistence for model {obj.__tablename__} disabled, skipping') # noqa return try: @@ -342,7 +342,7 @@ def save(self, obj=None): LOGGER.error(f'Failed to persist {obj} due to: {err}') self.session.rollback() - LOGGER.debug(f'Saving {obj') + LOGGER.debug(f'Saving {obj}') except DataError as err: LOGGER.error(f'Failed to save to registry: {err}') self.session.rollback()