Skip to content

Commit

Permalink
fix pylint
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasColombi committed Feb 12, 2025
1 parent 541937e commit 45ccd8a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions climada/util/coordinates.py
Original file line number Diff line number Diff line change
Expand Up @@ -507,14 +507,14 @@ def compute_grid_cell_area(res: float) -> tuple[np.ndarray]:
lat_bins = np.linspace(-90, 90, int(180 / res)) # lat bins
lon_bins = np.linspace(-180, 180, int(360 / res))

R = 6371 # Earth's radius [km]
r = 6371 # Earth's radius [km]

Check warning on line 510 in climada/util/coordinates.py

View check run for this annotation

Jenkins - WCR / Pylint

invalid-name

LOW: Variable name "r" doesn't conform to '(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$' pattern
Raw output
Used when the name doesn't match the regular expression associated to its type(constant, variable, class...).
# Convert to radians
lat_bin_edges = np.radians(lat_bins)
lon_res_rad = np.radians(res)

# Compute area
areas = (
R**2
r**2
* lon_res_rad
* np.abs(np.sin(lat_bin_edges[1:]) - np.sin(lat_bin_edges[:-1]))
)
Expand Down

0 comments on commit 45ccd8a

Please sign in to comment.