Skip to content

Commit d8aa7f7

Browse files
committed
DAS-2219 Fix pylint error
1 parent 60fc626 commit d8aa7f7

4 files changed

Lines changed: 4 additions & 9 deletions

File tree

swath_projector/adapter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ def process_item(self, item: Item, source: HarmonySource):
120120
except Exception as err:
121121
logger.error('Reprojection failed: ' + str(err), exc_info=1)
122122
raise HarmonyException(
123-
'Reprojection failed with error: ' + str(err)
123+
f'Reprojection failed with error: {err}'
124124
) from err
125125

126126
finally:

swath_projector/interpolation.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def check_variable_projectability(
7676
# Check 1: Missing coordinates
7777
coordinates_key = create_coordinates_key(variable_cf)
7878
if not coordinates_key:
79-
return str(f'No coordinate variables found for this variable')
79+
return 'No coordinate variables found for this variable'
8080

8181
# Check 2: Validate dimension compatibility with coordinates
8282
try:
@@ -147,7 +147,7 @@ def resample_all_variables(
147147
# Reraise exception as application failures
148148
logger.error(f'Cannot reproject {variable}')
149149
logger.exception(error)
150-
raise CannotReprojectVariable(error)
150+
raise CannotReprojectVariable(error) from error
151151

152152
dataset.close()
153153

swath_projector/reproject.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def reproject(
6868
)
6969
except Exception as err:
7070
logger.error(f'Unable to parse input file variables: {str(err)}')
71-
raise UnableToParseInputFileVariables(err)
71+
raise UnableToParseInputFileVariables(err) from err
7272

7373
science_variables = var_info.get_science_variables()
7474

swath_projector/swath_geometry.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
from typing import List, Tuple
99

1010
import numpy as np
11-
from netCDF4 import Variable
1211
from pyproj import Proj
1312

1413

@@ -141,10 +140,6 @@ def get_valid_coordinates_mask(
141140
a fill value, or contain a NaN. Note, a value of 1 means that the pixel
142141
contains valid data.
143142
144-
When a `netCDF4.Variable` is loaded, the data will automatically be
145-
read as a `numpy.ma.core.MaskedArray`. Values matching the `_FillValue`
146-
as stored in the variable metadata will be masked.
147-
148143
"""
149144
valid_longitudes = np.logical_and(
150145
np.isfinite(longitudes), np.logical_not(longitudes[:].mask)

0 commit comments

Comments
 (0)