Skip to content

Commit

Permalink
Fix W505 line-too-long lint error by moving noqa after the triple quotes
Browse files Browse the repository at this point in the history
  • Loading branch information
weiji14 committed Oct 15, 2023
1 parent 451cb61 commit ece0730
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 23 deletions.
4 changes: 2 additions & 2 deletions examples/projections/cyl/cyl_universal_transverse_mercator.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
.. _GMT_utm_zones:
.. figure:: https://docs.generic-mapping-tools.org/latest/_images/GMT_utm_zones.png # noqa: W505
.. figure:: https://docs.generic-mapping-tools.org/latest/_images/GMT_utm_zones.png
:width: 700 px
:align: center
Expand All @@ -34,7 +34,7 @@
The projection is set with **u** or **U**. *zone* sets the zone for the figure,
and the figure size is set with *scale* or *width*.
"""
""" # noqa: W505

# %%
import pygmt
Expand Down
4 changes: 2 additions & 2 deletions pygmt/datasets/earth_age.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def load_earth_age(resolution="01d", region=None, registration=None):
r"""
Load the Earth seafloor crustal age dataset in various resolutions.
.. figure:: https://www.generic-mapping-tools.org/remote-datasets/_images/GMT_earth_age.png # noqa: W505
.. figure:: https://www.generic-mapping-tools.org/remote-datasets/_images/GMT_earth_age.png
:width: 80 %
:align: center
Expand Down Expand Up @@ -91,7 +91,7 @@ def load_earth_age(resolution="01d", region=None, registration=None):
... region=[120, 160, 30, 60],
... registration="gridline",
... )
"""
""" # noqa: W505
grid = _load_remote_dataset(
dataset_name="earth_age",
dataset_prefix="earth_age_",
Expand Down
4 changes: 2 additions & 2 deletions pygmt/datasets/earth_free_air_anomaly.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def load_earth_free_air_anomaly(resolution="01d", region=None, registration=None
Load the IGPP Global Earth Free-Air Anomaly datatset in various
resolutions.
.. figure:: https://www.generic-mapping-tools.org/remote-datasets/_images/GMT_earth_faa.jpg # noqa: W505
.. figure:: https://www.generic-mapping-tools.org/remote-datasets/_images/GMT_earth_faa.jpg
:width: 80 %
:align: center
Expand Down Expand Up @@ -95,7 +95,7 @@ def load_earth_free_air_anomaly(resolution="01d", region=None, registration=None
... region=[120, 160, 30, 60],
... registration="gridline",
... )
"""
""" # noqa: W505
grid = _load_remote_dataset(
dataset_name="earth_free_air_anomaly",
dataset_prefix="earth_faa_",
Expand Down
4 changes: 2 additions & 2 deletions pygmt/datasets/earth_geoid.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def load_earth_geoid(resolution="01d", region=None, registration=None):
r"""
Load the EGM2008 Global Earth Geoid dataset in various resolutions.
.. figure:: https://www.generic-mapping-tools.org/remote-datasets/_images/GMT_earth_geoid.jpg # noqa: W505
.. figure:: https://www.generic-mapping-tools.org/remote-datasets/_images/GMT_earth_geoid.jpg
:width: 80 %
:align: center
Expand Down Expand Up @@ -84,7 +84,7 @@ def load_earth_geoid(resolution="01d", region=None, registration=None):
... region=[120, 160, 30, 60],
... registration="gridline",
... )
"""
""" # noqa: W505
grid = _load_remote_dataset(
dataset_name="earth_geoid",
dataset_prefix="earth_geoid_",
Expand Down
6 changes: 3 additions & 3 deletions pygmt/datasets/earth_magnetic_anomaly.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ def load_earth_magnetic_anomaly(
* - Global Earth Magnetic Anomaly Model (EMAG2)
- World Digital Magnetic Anomaly Map (WDMAM)
* - .. figure:: https://www.generic-mapping-tools.org/remote-datasets/_images/GMT_earth_mag4km.jpg # noqa: W505
- .. figure:: https://www.generic-mapping-tools.org/remote-datasets/_images/GMT_earth_wdmam.jpg # noqa: W505
* - .. figure:: https://www.generic-mapping-tools.org/remote-datasets/_images/GMT_earth_mag4km.jpg
- .. figure:: https://www.generic-mapping-tools.org/remote-datasets/_images/GMT_earth_wdmam.jpg
The grids are downloaded to a user data directory
(usually ``~/.gmt/server/earth/earth_mag/``,
Expand Down Expand Up @@ -132,7 +132,7 @@ def load_earth_magnetic_anomaly(
>>> grid = load_earth_magnetic_anomaly(
... resolution="20m", registration="gridline", data_source="wdmam"
... )
"""
""" # noqa: W505
magnetic_anomaly_sources = {
"emag2": "earth_mag_",
"emag2_4km": "earth_mag4km_",
Expand Down
4 changes: 2 additions & 2 deletions pygmt/datasets/earth_mask.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def load_earth_mask(resolution="01d", region=None, registration=None):
r"""
Load the GSHHG Global Earth Mask dataset in various resolutions.
.. figure:: https://www.generic-mapping-tools.org/remote-datasets/_images/GMT_earth_mask.png # noqa: W505
.. figure:: https://www.generic-mapping-tools.org/remote-datasets/_images/GMT_earth_mask.png
:width: 80 %
:align: center
Expand Down Expand Up @@ -88,7 +88,7 @@ def load_earth_mask(resolution="01d", region=None, registration=None):
>>> # location (170°E, 50°N) is in oceanic area (0)
>>> grid.sel(lon=170, lat=50).values
array(0, dtype=int8)
"""
""" # noqa: W505
grid = _load_remote_dataset(
dataset_name="earth_mask",
dataset_prefix="earth_mask_",
Expand Down
4 changes: 2 additions & 2 deletions pygmt/datasets/earth_relief.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def load_earth_relief(
Load the Earth relief datasets (topography and bathymetry) in various
resolutions.
.. figure:: https://www.generic-mapping-tools.org/remote-datasets/_images/GMT_earth_gebcosi.jpg # noqa: W505
.. figure:: https://www.generic-mapping-tools.org/remote-datasets/_images/GMT_earth_gebcosi.jpg
:width: 80 %
:align: center
Expand Down Expand Up @@ -136,7 +136,7 @@ def load_earth_relief(
... registration="gridline",
... use_srtm=True,
... )
"""
""" # noqa: W505
# resolutions of original land-only SRTM tiles from NASA
land_only_srtm_resolutions = ["03s", "01s"]

Expand Down
4 changes: 2 additions & 2 deletions pygmt/datasets/earth_vertical_gravity_gradient.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def load_earth_vertical_gravity_gradient(
Load the IGPP Global Earth Vertical Gravity Gradient dataset in various
resolutions.
.. figure:: https://www.generic-mapping-tools.org/remote-datasets/_images/GMT_earth_vgg.jpg # noqa: W505
.. figure:: https://www.generic-mapping-tools.org/remote-datasets/_images/GMT_earth_vgg.jpg
:width: 80 %
:align: center
Expand Down Expand Up @@ -97,7 +97,7 @@ def load_earth_vertical_gravity_gradient(
... region=[120, 160, 30, 60],
... registration="gridline",
... )
"""
""" # noqa: W505
grid = _load_remote_dataset(
dataset_name="earth_vgg",
dataset_prefix="earth_vgg_",
Expand Down
7 changes: 3 additions & 4 deletions pygmt/datasets/samples.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,6 @@ def list_sample_data():


def load_sample_data(name):
# pylint: disable=line-too-long
"""
Load an example dataset from the GMT server.
Expand All @@ -317,8 +316,8 @@ def load_sample_data(name):
Returns
-------
:class:`pandas.DataFrame` or :class:`xarray.DataArray`
Sample dataset loaded as a :class:`pandas.DataFrame` for tabular data or
:class:`xarray.DataArray` for raster data.
Sample dataset loaded as a :class:`pandas.DataFrame` for tabular data
or :class:`xarray.DataArray` for raster data.
See Also
--------
Expand All @@ -345,7 +344,7 @@ def load_sample_data(name):
'usgs_quakes': 'Table of earthquakes from the USGS'}
>>> # load the sample bathymetry dataset
>>> data = load_sample_data("bathymetry")
"""
""" # noqa: W505
if name not in datasets:
raise GMTInvalidInput(f"Invalid dataset name '{name}'.")
return datasets[name].func()
4 changes: 2 additions & 2 deletions pygmt/src/nearneighbor.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def nearneighbor(data=None, x=None, y=None, z=None, **kwargs):
criteria and :math:`r_i` is the distance from the node to the *i*'th data
point. If no data weights are supplied then :math:`w_i = 1`.
.. figure:: https://docs.generic-mapping-tools.org/dev/_images/GMT_nearneighbor.png # noqa: W505
.. figure:: https://docs.generic-mapping-tools.org/dev/_images/GMT_nearneighbor.png
:width: 300 px
:align: center
Expand Down Expand Up @@ -146,7 +146,7 @@ def nearneighbor(data=None, x=None, y=None, z=None, **kwargs):
... region=[245, 255, 20, 30],
... search_radius="10m",
... )
"""
""" # noqa: W505
with GMTTempFile(suffix=".nc") as tmpfile:
with Session() as lib:
table_context = lib.virtualfile_from_data(
Expand Down

0 comments on commit ece0730

Please sign in to comment.