Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
tomkralidis committed Mar 23, 2024
1 parent 6a8f4d4 commit ee50394
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions woudc_data_registry/processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions woudc_data_registry/product/uv_index/uv_index_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand All @@ -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
Expand All @@ -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

Expand Down Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions woudc_data_registry/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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()
Expand Down

0 comments on commit ee50394

Please sign in to comment.