From a208ca8b1b4afda87ce9728362fdd5373bd80d94 Mon Sep 17 00:00:00 2001 From: Wei Ji <23487320+weiji14@users.noreply.github.com> Date: Mon, 16 Oct 2023 01:25:57 +1300 Subject: [PATCH] Try removing all noqa: W505 --- .../projections/cyl/cyl_universal_transverse_mercator.py | 2 +- pygmt/datasets/earth_age.py | 5 ++--- pygmt/datasets/earth_free_air_anomaly.py | 2 +- pygmt/datasets/earth_geoid.py | 2 +- pygmt/datasets/earth_magnetic_anomaly.py | 2 +- pygmt/datasets/earth_mask.py | 2 +- pygmt/datasets/earth_relief.py | 2 +- pygmt/datasets/earth_vertical_gravity_gradient.py | 2 +- pygmt/datasets/samples.py | 4 ++-- pygmt/src/nearneighbor.py | 2 +- 10 files changed, 12 insertions(+), 13 deletions(-) diff --git a/examples/projections/cyl/cyl_universal_transverse_mercator.py b/examples/projections/cyl/cyl_universal_transverse_mercator.py index 6d6c6365cf2..1cd0556c303 100644 --- a/examples/projections/cyl/cyl_universal_transverse_mercator.py +++ b/examples/projections/cyl/cyl_universal_transverse_mercator.py @@ -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 diff --git a/pygmt/datasets/earth_age.py b/pygmt/datasets/earth_age.py index 42a598819c9..b9496b98d68 100644 --- a/pygmt/datasets/earth_age.py +++ b/pygmt/datasets/earth_age.py @@ -72,8 +72,7 @@ def load_earth_age(resolution="01d", region=None, registration=None): :class:`xarray.DataArray` grid can be accessed via the GMT accessors (i.e., ``grid.gmt.registration`` and ``grid.gmt.gtype`` respectively). However, these properties may be lost after specific grid operations (such - as slicing) and will need to be manually set before passing the grid to any - PyGMT data processing or plotting functions. Refer to + as slicing) and will need to be manually set before passing the grid to any PyGMT data processing or plotting functions. Refer to :class:`pygmt.GMTDataArrayAccessor` for detailed explanations and workarounds. @@ -91,7 +90,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_", diff --git a/pygmt/datasets/earth_free_air_anomaly.py b/pygmt/datasets/earth_free_air_anomaly.py index cc07507d752..f1cc1c4f9c8 100644 --- a/pygmt/datasets/earth_free_air_anomaly.py +++ b/pygmt/datasets/earth_free_air_anomaly.py @@ -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_", diff --git a/pygmt/datasets/earth_geoid.py b/pygmt/datasets/earth_geoid.py index 27f07f9e29e..140bb39ffe2 100644 --- a/pygmt/datasets/earth_geoid.py +++ b/pygmt/datasets/earth_geoid.py @@ -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_", diff --git a/pygmt/datasets/earth_magnetic_anomaly.py b/pygmt/datasets/earth_magnetic_anomaly.py index 4a52f280824..e9ec6b9a449 100644 --- a/pygmt/datasets/earth_magnetic_anomaly.py +++ b/pygmt/datasets/earth_magnetic_anomaly.py @@ -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_", diff --git a/pygmt/datasets/earth_mask.py b/pygmt/datasets/earth_mask.py index b87250b0010..f9fcc4be5ca 100644 --- a/pygmt/datasets/earth_mask.py +++ b/pygmt/datasets/earth_mask.py @@ -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_", diff --git a/pygmt/datasets/earth_relief.py b/pygmt/datasets/earth_relief.py index 53e8e45ec9a..9236753e413 100644 --- a/pygmt/datasets/earth_relief.py +++ b/pygmt/datasets/earth_relief.py @@ -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"] diff --git a/pygmt/datasets/earth_vertical_gravity_gradient.py b/pygmt/datasets/earth_vertical_gravity_gradient.py index c0590efbe24..0eada0a374c 100644 --- a/pygmt/datasets/earth_vertical_gravity_gradient.py +++ b/pygmt/datasets/earth_vertical_gravity_gradient.py @@ -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_", diff --git a/pygmt/datasets/samples.py b/pygmt/datasets/samples.py index 3d26a039b72..3fb809799a1 100644 --- a/pygmt/datasets/samples.py +++ b/pygmt/datasets/samples.py @@ -330,7 +330,7 @@ def load_sample_data(name): >>> from pprint import pprint >>> from pygmt.datasets import list_sample_data, load_sample_data >>> # use list_sample_data to see the available datasets - >>> pprint(list_sample_data(), width=120) # noqa: W505 + >>> pprint(list_sample_data(), width=120) {'bathymetry': 'Table of ship bathymetric observations off Baja California', 'earth_relief_holes': 'Regional 20 arc-minutes Earth relief grid with holes', 'fractures': 'Table of hypothetical fracture lengths and azimuths', @@ -344,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() diff --git a/pygmt/src/nearneighbor.py b/pygmt/src/nearneighbor.py index ba0bada2e8d..cc9c1e5befd 100644 --- a/pygmt/src/nearneighbor.py +++ b/pygmt/src/nearneighbor.py @@ -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(