Skip to content

Commit 2c81690

Browse files
authored
Enable ruff's ruff-specific (RUF) rules (#2901)
1 parent a08a6cf commit 2c81690

File tree

13 files changed

+17
-13
lines changed

13 files changed

+17
-13
lines changed

examples/gallery/images/rgb_image.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
Data is sourced from a Cloud-Optimized GeoTIFF (COG) file hosted on
1414
`OpenAerialMap <https://map.openaerialmap.org>`_ under a
1515
`CC BY-NC 4.0 <https://creativecommons.org/licenses/by-nc/4.0/>`_ license.
16-
"""
16+
""" # noqa: RUF002
1717

1818
# %%
1919
import pygmt

examples/gallery/lines/roads.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
:class:`geopandas.GeoDataFrame` as an argument to the ``data`` parameter of
1010
:meth:`pygmt.Figure.plot`, and style the geometry using the ``pen`` parameter.
1111
"""
12+
# ruff: noqa: RUF003
1213

1314
# %%
1415
import geopandas as gpd

examples/projections/conic/conic_lambert.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
This conic projection was designed by the Alsatian mathematician Johann
66
Heinrich Lambert (1772) and has been used extensively for mapping of regions
77
with predominantly east-west orientation, just like the Albers projection.
8-
Unlike the Albers projection, Lamberts conformal projection is not equal-area.
8+
Unlike the Albers projection, Lambert's conformal projection is not equal-area.
99
The parallels are arcs of circles with a common origin, and meridians are the
1010
equally spaced radii of these circles. As with Albers projection, it is only
1111
the two standard parallels that are distortion-free.

examples/projections/conic/polyconic.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
The polyconic projection, in Europe usually referred to as the American
66
polyconic projection, was introduced shortly before 1820 by the Swiss-American
7-
cartographer Ferdinand Rodulph Hassler (17701843). As head of the Survey of
7+
cartographer Ferdinand Rodulph Hassler (1770-1843). As head of the Survey of
88
the Coast, he was looking for a projection that would give the least distortion
99
for mapping the coast of the United States. The projection acquired its name
1010
from the construction of each parallel, which is achieved by projecting the

examples/projections/cyl/cyl_miller.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
American Geographic Society in 1942, is neither equal nor conformal. All
77
meridians and parallels are straight lines. The projection was designed to be a
88
compromise between Mercator and other cylindrical projections. Specifically,
9-
Miller spaced the parallels by using Mercators formula with 0.8 times the
9+
Miller spaced the parallels by using Mercator's formula with 0.8 times the
1010
actual latitude, thus avoiding the singular poles; the result was then divided
1111
by 0.8.
1212

examples/projections/misc/misc_eckertIV.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
The Eckert IV projection, presented by the German cartographer Max
66
Eckert-Greiffendorff in 1906, is a pseudo-cylindrical equal-area projection.
77
Central meridian and all parallels are straight lines; other meridians are
8-
equally spaced elliptical arcs. The scale is true along latitude 40°30.
8+
equally spaced elliptical arcs. The scale is true along latitude 40°30'.
99
1010
**kf**\ [*lon0/*]\ *scale* or **Kf**\ [*lon0/*]\ *width*
1111

examples/projections/misc/misc_eckertVI.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
The Eckert VI projections, presented by the German cartographer Max
66
Eckert-Greiffendorff in 1906, is a pseudo-cylindrical equal-area projection.
77
Central meridian and all parallels are straight lines; other meridians are
8-
equally spaced sinusoids. The scale is true along latitude 49°16.
8+
equally spaced sinusoids. The scale is true along latitude 49°16'.
99
1010
1111
**ks**\ [*lon0/*]\ *scale* or **Ks**\ [*lon0/*]\ *width*

examples/projections/misc/misc_mollweide.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
This pseudo-cylindrical, equal-area projection was developed by the German
66
mathematician and astronomer Karl Brandan Mollweide in 1805. Parallels are
77
unequally spaced straight lines with the meridians being equally spaced
8-
elliptical arcs. The scale is only true along latitudes 40°44 north and south.
8+
elliptical arcs. The scale is only true along latitudes 40°44' north and south.
99
The projection is used mainly for global maps showing data distributions. It is
1010
occasionally referenced under the name homalographic projection.
1111

pygmt/clib/session.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1653,7 +1653,7 @@ def extract_region(self):
16531653
...
16541654
>>> print(", ".join([f"{x:.2f}" for x in wesn]))
16551655
-165.00, -150.00, 15.00, 25.00
1656-
"""
1656+
""" # noqa: RUF002
16571657
c_extract_region = self.get_libgmt_func(
16581658
"GMT_Extract_Region",
16591659
argtypes=[ctp.c_void_p, ctp.c_char_p, ctp.POINTER(ctp.c_double)],

pygmt/helpers/utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
Utilities and common tasks for wrapping the GMT modules.
33
"""
4+
# ruff: noqa: RUF001
45
import os
56
import pathlib
67
import shutil
@@ -224,7 +225,7 @@ def non_ascii_to_octal(argstr):
224225
'@%34%\\41@%%@%34%\\176@%%@%34%\\241@%%@%34%\\376@%%'
225226
>>> non_ascii_to_octal("ABC ±120° DEF α ♥")
226227
'ABC \\261120\\260 DEF @~\\141@~ @%34%\\252@%%'
227-
"""
228+
""" # noqa: RUF002
228229
# Dictionary mapping non-ASCII characters to octal codes
229230
mapping = {}
230231

0 commit comments

Comments
 (0)