From 016a0f4bf8a9defc18ae7b2cb3067e318d1b87a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yvonne=20Fr=C3=B6hlich?= <94163266+yvonnefroehlich@users.noreply.github.com> Date: Mon, 7 Aug 2023 02:00:22 +0200 Subject: [PATCH] Use consistently "netCDF" (#2620) --- doc/contributing.md | 2 +- examples/gallery/images/track_sampling.py | 2 +- pygmt/src/grdfilter.py | 2 +- pygmt/src/grdtrack.py | 2 +- pygmt/src/nearneighbor.py | 2 +- pygmt/src/surface.py | 2 +- pygmt/tests/test_clib_put_matrix.py | 2 +- pygmt/tests/test_grdimage.py | 4 ++-- pygmt/tests/test_grdtrack.py | 4 ++-- pygmt/tests/test_grdview.py | 2 +- pygmt/tests/test_io.py | 2 +- pygmt/tests/test_nearneighbor.py | 2 +- 12 files changed, 14 insertions(+), 14 deletions(-) diff --git a/doc/contributing.md b/doc/contributing.md index 829c985ce3d..702e2f68f9e 100644 --- a/doc/contributing.md +++ b/doc/contributing.md @@ -67,7 +67,7 @@ the problem: where `` is the name of your test script. Note that this script works only with GMT>=6.4 * If the bug is produced when passing an in-memory data object (e.g., a pandas.DataFrame or xarray.DataArray) to a PyGMT function, try writing the - data to a file (e.g., a NetCDF or ASCII txt file) and passing the data file + data to a file (e.g., a netCDF or ASCII txt file) and passing the data file to the PyGMT function instead. In the GitHub issue, please share the results for both cases along with your code. diff --git a/examples/gallery/images/track_sampling.py b/examples/gallery/images/track_sampling.py index 642d22d30a8..ab9b1558e04 100644 --- a/examples/gallery/images/track_sampling.py +++ b/examples/gallery/images/track_sampling.py @@ -10,7 +10,7 @@ parameter that will be used to name the new column of values sampled from the grid. -Alternatively, a NetCDF file path can be passed to ``grid``. An ASCII file path +Alternatively, a netCDF file path can be passed to ``grid``. An ASCII file path can also be accepted for ``points``. To save an output ASCII file, a file name argument needs to be passed to the ``outfile`` parameter. """ diff --git a/pygmt/src/grdfilter.py b/pygmt/src/grdfilter.py index 1e7f3bae985..ed5c7c3d068 100644 --- a/pygmt/src/grdfilter.py +++ b/pygmt/src/grdfilter.py @@ -124,7 +124,7 @@ def grdfilter(grid, **kwargs): >>> import os >>> import pygmt >>> # Apply a filter of 600 km (full width) to the @earth_relief_30m_g file - >>> # and return a filtered field (saved as NetCDF) + >>> # and return a filtered field (saved as netCDF) >>> pygmt.grdfilter( ... grid="@earth_relief_30m_g", ... filter="m600", diff --git a/pygmt/src/grdtrack.py b/pygmt/src/grdtrack.py index d90cbd2e8b7..62380105407 100644 --- a/pygmt/src/grdtrack.py +++ b/pygmt/src/grdtrack.py @@ -68,7 +68,7 @@ def grdtrack(grid, points=None, newcolname=None, outfile=None, **kwargs): Parameters ---------- grid : xarray.DataArray or str - Gridded array from which to sample values from, or a file name (netcdf + Gridded array from which to sample values from, or a file name (netCDF format). points : str or {table-like} diff --git a/pygmt/src/nearneighbor.py b/pygmt/src/nearneighbor.py index 2a0b63cdd9c..438f03c6411 100644 --- a/pygmt/src/nearneighbor.py +++ b/pygmt/src/nearneighbor.py @@ -93,7 +93,7 @@ def nearneighbor(data=None, x=None, y=None, z=None, **kwargs): close to a node. outgrid : str - Optional. The file name for the output netcdf file with extension .nc + Optional. The file name for the output netCDF file with extension .nc to store the grid in. empty : str diff --git a/pygmt/src/surface.py b/pygmt/src/surface.py index bb6b499d51a..79eea325618 100644 --- a/pygmt/src/surface.py +++ b/pygmt/src/surface.py @@ -86,7 +86,7 @@ def surface(data=None, x=None, y=None, z=None, **kwargs): {region} outgrid : str - Optional. The file name for the output netcdf file with extension .nc + Optional. The file name for the output netCDF file with extension .nc to store the grid in. convergence : float Optional. Convergence limit. Iteration is assumed to have converged diff --git a/pygmt/tests/test_clib_put_matrix.py b/pygmt/tests/test_clib_put_matrix.py index af12296f63a..dd288aacd13 100644 --- a/pygmt/tests/test_clib_put_matrix.py +++ b/pygmt/tests/test_clib_put_matrix.py @@ -66,7 +66,7 @@ def test_put_matrix_fails(): def test_put_matrix_grid(dtypes): """ - Check that assigning a numpy 2-D array to an ASCII and NetCDF grid works. + Check that assigning a numpy 2-D array to an ASCII and netCDF grid works. """ wesn = [10, 15, 30, 40, 0, 0] inc = [1, 1] diff --git a/pygmt/tests/test_grdimage.py b/pygmt/tests/test_grdimage.py index 566d7626caa..b51daedde9d 100644 --- a/pygmt/tests/test_grdimage.py +++ b/pygmt/tests/test_grdimage.py @@ -25,7 +25,7 @@ def fixture_grid_360(grid): 180). """ _grid = grid.copy() # get a copy of original earth_relief grid - _grid.encoding.pop("source") # unlink earth_relief NetCDF source + _grid.encoding.pop("source") # unlink earth_relief netCDF source _grid["lon"] = np.arange(0, 361, 1) # convert longitude from -180:180 to 0:360 return _grid @@ -212,7 +212,7 @@ def test_grdimage_central_meridians(grid, proj_type, lon0): return fig_ref, fig_test -# Cylindrical Equidistant (Q) projections plotted with xarray and NetCDF grids +# Cylindrical Equidistant (Q) projections plotted with xarray and netCDF grids # are still slightly different with an RMS error of 25, see issue at # https://github.com/GenericMappingTools/pygmt/issues/390 # TO-DO remove tol=1.5 and pytest.mark.xfail once bug is solved in upstream GMT diff --git a/pygmt/tests/test_grdtrack.py b/pygmt/tests/test_grdtrack.py index 8d765db7ddb..2447c37c849 100644 --- a/pygmt/tests/test_grdtrack.py +++ b/pygmt/tests/test_grdtrack.py @@ -80,7 +80,7 @@ def test_grdtrack_input_csvfile_and_dataarray(dataarray, expected_array): def test_grdtrack_input_dataframe_and_ncfile(dataframe, expected_array): """ - Run grdtrack by passing in a pandas.DataFrame and netcdf file as inputs. + Run grdtrack by passing in a pandas.DataFrame and netCDF file as inputs. """ output = grdtrack( points=dataframe, grid="@static_earth_relief.nc", newcolname="bathymetry" @@ -92,7 +92,7 @@ def test_grdtrack_input_dataframe_and_ncfile(dataframe, expected_array): def test_grdtrack_input_csvfile_and_ncfile_to_dataframe(expected_array): """ - Run grdtrack by passing in a csv file and netcdf file as inputs with a + Run grdtrack by passing in a csv file and netCDF file as inputs with a pandas.DataFrame output. """ output = grdtrack(points=POINTS_DATA, grid="@static_earth_relief.nc") diff --git a/pygmt/tests/test_grdview.py b/pygmt/tests/test_grdview.py index 5fdd8cc70d7..5ddd395e8fe 100644 --- a/pygmt/tests/test_grdview.py +++ b/pygmt/tests/test_grdview.py @@ -27,7 +27,7 @@ def fixture_grid(): @pytest.fixture(scope="module", name="gridfile") def fixture_gridfile(grid, region): """ - Load the NetCDF grid file from the sample earth_relief file. + Load the netCDF grid file from the sample earth_relief file. """ with GMTTempFile(suffix=".nc") as tmpfile: grdcut(grid=grid, region=region, outgrid=tmpfile.name) diff --git a/pygmt/tests/test_io.py b/pygmt/tests/test_io.py index c111721480e..447e853ff54 100644 --- a/pygmt/tests/test_io.py +++ b/pygmt/tests/test_io.py @@ -10,7 +10,7 @@ def test_io_load_dataarray(): """ - Check that load_dataarray works to read a NetCDF grid with + Check that load_dataarray works to read a netCDF grid with GMTDataArrayAccessor information loaded. """ with GMTTempFile(suffix=".nc") as tmpfile: diff --git a/pygmt/tests/test_nearneighbor.py b/pygmt/tests/test_nearneighbor.py index 088af184999..6ea7034d84e 100644 --- a/pygmt/tests/test_nearneighbor.py +++ b/pygmt/tests/test_nearneighbor.py @@ -81,6 +81,6 @@ def test_nearneighbor_with_outgrid_param(ship_data): assert output is None # check that output is None since outgrid is set assert Path(tmpfile.name).stat().st_size > 0 # check that outgrid exists with xr.open_dataarray(tmpfile.name) as grid: - assert isinstance(grid, xr.DataArray) # ensure netcdf grid loads ok + assert isinstance(grid, xr.DataArray) # ensure netCDF grid loads ok assert grid.shape == (121, 121) npt.assert_allclose(grid.mean(), -2378.2385)