Skip to content

Commit

Permalink
Merge pull request #145 from zmoon/sp
Browse files Browse the repository at this point in the history
Spelling
  • Loading branch information
zmoon committed Oct 3, 2023
2 parents 817b612 + b96105f commit 9e6f871
Showing 1 changed file with 19 additions and 23 deletions.
42 changes: 19 additions & 23 deletions monet/monet_accessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,11 @@
has_pyresample = False

def wrap_longitudes(lons):
"""Short summary.
"""For longitudes that may be in [0, 360) format, return in [-180, 180) format.
Parameters
----------
lons : type
Returns
-------
type
lons : array-like
"""
return (lons + 180) % 360 - 180

Expand Down Expand Up @@ -363,7 +360,7 @@ def rename_for_monet(self, df=None):
return df

def get_sparse_SwathDefinition(self):
"""Creates a pyreample.geometry.SwathDefinition for a single point.
"""Creates a ``pyreample.geometry.SwathDefinition`` for a single point.
Returns
-------
Expand Down Expand Up @@ -523,7 +520,9 @@ def __init__(self, xray_obj):
self._obj = xray_obj

def wrap_longitudes(self, lon_name="longitude"):
"""Ensures longitudes are from -180 -> 180
"""Ensures longitudes are from -180 -> 180.
Modifies longitude variable in place.
Parameters
----------
Expand Down Expand Up @@ -632,7 +631,7 @@ def cf_to_dt64(x):
return da

def structure_for_monet(self, lat_name="lat", lon_name="lon", return_obj=True):
"""This will attempt to restucture a given DataArray for use within MONET.
"""This will attempt to restructure a given DataArray for use within MONET.
Parameters
----------
Expand Down Expand Up @@ -961,9 +960,10 @@ def _check_kwargs_and_set_defaults(**kwargs):
return kwargs

def quick_imshow(self, map_kws=None, roll_dateline=False, **kwargs):
"""This function takes an xarray DataArray and quickly cerates a figure
using cartopy and the matplotlib imshow. Note that this should only be used for
regular grids.
"""This function takes an xarray DataArray and quickly creates a figure
using cartopy and matplotlib ``imshow``.
Note that this should only be used for regular grids.
Parameters
----------
Expand Down Expand Up @@ -1028,8 +1028,8 @@ def quick_imshow(self, map_kws=None, roll_dateline=False, **kwargs):
return ax

def quick_map(self, map_kws=None, roll_dateline=False, **kwargs):
"""This function takes an xarray DataArray and quickly cerates a figure
using cartopy and the matplotlib pcolormesh
"""This function takes an xarray DataArray and quickly creates a figure
using cartopy and matplotlib ``pcolormesh``.
Parameters
----------
Expand Down Expand Up @@ -1087,8 +1087,8 @@ def quick_map(self, map_kws=None, roll_dateline=False, **kwargs):
return ax

def quick_contourf(self, map_kws=None, roll_dateline=False, **kwargs):
"""This function takes an xarray DataArray and quickly cerates a figure
using cartopy and the matplotlib contourf
"""This function takes an xarray DataArray and quickly creates a figure
using cartopy and matplotlib ``contourf``.
Parameters
----------
Expand Down Expand Up @@ -1155,12 +1155,7 @@ def quick_contourf(self, map_kws=None, roll_dateline=False, **kwargs):
return ax

def _tight_layout(self):
"""Short summary.
Returns
-------
type
"""
"""Apply ``subplots_adjust(0, 0, 1, 1)``."""
from matplotlib.pyplot import subplots_adjust

subplots_adjust(0, 0, 1, 1)
Expand Down Expand Up @@ -2026,8 +2021,9 @@ def combine_point(self, data, suffix=None, pyresample=True, **kwargs):
# raise ValueError("`data` must be an xarray Dataset or DataArray")

def wrap_longitudes(self, lon_name="longitude"):
"""Ensures longitudes are from -180 -> 180
Modifies self in place.
"""Ensures longitudes are from -180 -> 180.
Modifies longitude variable in place.
"""
dset = self._obj
dset[lon_name] = (dset[lon_name] + 180) % 360 - 180
Expand Down

0 comments on commit 9e6f871

Please sign in to comment.