diff --git a/docs/src/further_topics/filtering_warnings.rst b/docs/src/further_topics/filtering_warnings.rst index fb1e09e98e..e4ded0bf88 100644 --- a/docs/src/further_topics/filtering_warnings.rst +++ b/docs/src/further_topics/filtering_warnings.rst @@ -49,7 +49,7 @@ Warnings: ... iris/coord_systems.py:442: IrisUserWarning: Setting inverse_flattening does not affect other properties of the GeogCS object. To change other properties set them explicitly or create a new GeogCS instance. warnings.warn(wmsg, category=iris.exceptions.IrisUserWarning) - iris/coord_systems.py:782: IrisDefaultingWarning: Discarding false_easting and false_northing that are not used by Cartopy. + iris/coord_systems.py:768: IrisDefaultingWarning: Discarding false_easting and false_northing that are not used by Cartopy. warnings.warn( Warnings can be suppressed using the Python warnings filter with the ``ignore`` @@ -130,7 +130,7 @@ Or you can target Warnings raised by specific lines of specific modules, e.g. ... iris/coord_systems.py:442: IrisUserWarning: Setting inverse_flattening does not affect other properties of the GeogCS object. To change other properties set them explicitly or create a new GeogCS instance. warnings.warn(wmsg, category=iris.exceptions.IrisUserWarning) - iris/coord_systems.py:782: IrisDefaultingWarning: Discarding false_easting and false_northing that are not used by Cartopy. + iris/coord_systems.py:768: IrisDefaultingWarning: Discarding false_easting and false_northing that are not used by Cartopy. warnings.warn( :: diff --git a/lib/iris/coord_categorisation.py b/lib/iris/coord_categorisation.py index 96407632c5..f4c3aa6cb4 100644 --- a/lib/iris/coord_categorisation.py +++ b/lib/iris/coord_categorisation.py @@ -40,7 +40,7 @@ def add_categorised_coord(cube, name, from_coord, category_function, units="1"): category_function : callable function(coordinate, value), returning a category value for a coordinate point-value - units : str, optional, default="1" + units : str, default="1" units of the category value, typically 'no_unit' or '1'. """ # Interpret coord, if given as a name @@ -303,7 +303,7 @@ def add_season(cube, coord, name="season", seasons=("djf", "mam", "jja", "son")) it. coord : :class:`iris.coords.Coord` or str Coordinate in 'cube', or its name, representing time. - name : str, optional + name : str, default="season" Name of the created coordinate. Defaults to "season". seasons : :class:`list` of str, optional List of seasons defined by month abbreviations. Each month must @@ -341,7 +341,7 @@ def add_season_number( it. coord : :class:`iris.coords.Coord` or str Coordinate in 'cube', or its name, representing time. - name : str, optional + name : str, default="season" Name of the created coordinate. Defaults to "season_number". seasons : :class:`list` of str, optional List of seasons defined by month abbreviations. Each month must @@ -425,7 +425,7 @@ def add_season_membership(cube, coord, season, name="season_membership"): Coordinate in 'cube', or its name, representing time. season : str Season defined by month abbreviations. - name : str, optional + name : str, default="season_membership" Name of the created coordinate. Defaults to "season_membership". """ diff --git a/lib/iris/coord_systems.py b/lib/iris/coord_systems.py index adc9895ed9..5b4e593d83 100644 --- a/lib/iris/coord_systems.py +++ b/lib/iris/coord_systems.py @@ -157,12 +157,12 @@ def __init__( Parameters ---------- - * semi_major_axis, semi_minor_axis: + semi_major_axis, semi_minor_axis : optional Axes of ellipsoid, in metres. At least one must be given (see note below). - * inverse_flattening: + inverse_flattening : optional Can be omitted if both axes given (see note below). Default 0.0 - * longitude_of_prime_meridian: + longitude_of_prime_meridian : optional Specifies the prime meridian on the ellipsoid, in degrees. Default 0.0 Notes @@ -498,24 +498,21 @@ def __init__( ): """Construct a coordinate system with rotated pole, on an optional :class:`GeogCS`. - Args: - - * grid_north_pole_latitude: + Parameters + ---------- + grid_north_pole_latitude : The true latitude of the rotated pole in degrees. - - * grid_north_pole_longitude: + grid_north_pole_longitude : The true longitude of the rotated pole in degrees. - - Kwargs: - - * north_pole_grid_longitude: + north_pole_grid_longitude : optional Longitude of true north pole in rotated grid, in degrees. - Defaults to 0.0 . - - * ellipsoid (:class:`GeogCS`): + Defaults to 0.0. + ellipsoid : :class:`GeogCS`, optional If given, defines the ellipsoid. - Examples:: + Examples + -------- + :: rotated_cs = RotatedGeogCS(30, 30) another_cs = RotatedGeogCS(30, 30, @@ -606,34 +603,29 @@ def __init__( ): """Construct a TransverseMercator object. - Args: - - * latitude_of_projection_origin: - True latitude of planar origin in degrees. - - * longitude_of_central_meridian: - True longitude of planar origin in degrees. - - Kwargs: - - * false_easting: - X offset from planar origin in metres. - Defaults to 0.0 . - - * false_northing: - Y offset from planar origin in metres. - Defaults to 0.0 . - - * scale_factor_at_central_meridian: - Reduces the cylinder to slice through the ellipsoid - (secant form). Used to provide TWO longitudes of zero - distortion in the area of interest. - Defaults to 1.0 . - - * ellipsoid (:class:`GeogCS`): + Parameters + ---------- + latitude_of_projection_origin : + True latitude of planar origin in degrees. + longitude_of_central_meridian : + True longitude of planar origin in degrees. + false_easting : optional + X offset from planar origin in metres. + Defaults to 0.0. + false_northing : optional + Y offset from planar origin in metres. + Defaults to 0.0. + scale_factor_at_central_meridian : optional + Reduces the cylinder to slice through the ellipsoid + (secant form). Used to provide TWO longitudes of zero + distortion in the area of interest. + Defaults to 1.0 . + ellipsoid : :class:`GeogCS`, optional If given, defines the ellipsoid. - Example:: + Examples + -------- + :: airy1830 = GeogCS(6377563.396, 6356256.909) osgb = TransverseMercator(49, -2, 400000, -100000, 0.9996012717, @@ -727,23 +719,17 @@ def __init__( ): """Construct an Orthographic coord system. - Args: - - * latitude_of_projection_origin: + Parameters + ---------- + latitude_of_projection_origin : True latitude of planar origin in degrees. - - * longitude_of_projection_origin: + longitude_of_projection_origin : True longitude of planar origin in degrees. - - Kwargs: - - * false_easting: - X offset from planar origin in metres. Defaults to 0.0 . - - * false_northing: - Y offset from planar origin in metres. Defaults to 0.0 . - - * ellipsoid (:class:`GeogCS`): + false_easting : optional + X offset from planar origin in metres. Defaults to 0.0. + false_northing : optional + Y offset from planar origin in metres. Defaults to 0.0. + ellipsoid : :class:`GeogCS`, optional If given, defines the ellipsoid. """ @@ -811,27 +797,20 @@ def __init__( ): """Construct a Vertical Perspective coord system. - Args: - - * latitude_of_projection_origin: + Parameters + ---------- + latitude_of_projection_origin : True latitude of planar origin in degrees. - - * longitude_of_projection_origin: + longitude_of_projection_origin : True longitude of planar origin in degrees. - - * perspective_point_height: + perspective_point_height : Altitude of satellite in metres above the surface of the ellipsoid. - - Kwargs: - - * false_easting: - X offset from planar origin in metres. Defaults to 0.0 . - - * false_northing: - Y offset from planar origin in metres. Defaults to 0.0 . - - * ellipsoid (:class:`GeogCS`): + false_easting : optional + X offset from planar origin in metres. Defaults to 0.0. + false_northing : optional + Y offset from planar origin in metres. Defaults to 0.0. + ellipsoid : :class:`GeogCS`, optional If given, defines the ellipsoid. """ @@ -903,29 +882,21 @@ def __init__( ): """Construct a Geostationary coord system. - Args: - - * latitude_of_projection_origin: + Parameters + ---------- + latitude_of_projection_origin : True latitude of planar origin in degrees. - - * longitude_of_projection_origin: + longitude_of_projection_origin : True longitude of planar origin in degrees. - - * perspective_point_height: + perspective_point_height : Altitude of satellite in metres above the surface of the ellipsoid. - - * sweep_angle_axis (string): + sweep_angle_axis : str The axis along which the satellite instrument sweeps - 'x' or 'y'. - - Kwargs: - - * false_easting: - X offset from planar origin in metres. Defaults to 0.0 . - - * false_northing: - Y offset from planar origin in metres. Defaults to 0.0 . - - * ellipsoid (:class:`GeogCS`): + false_easting : optional + X offset from planar origin in metres. Defaults to 0.0. + false_northing : optional + Y offset from planar origin in metres. Defaults to 0.0. + ellipsoid : :class:`GeogCS`, optional If given, defines the ellipsoid. """ @@ -1011,28 +982,23 @@ def __init__( ---------- central_lat : float The latitude of the pole. - central_lon : float The central longitude, which aligns with the y axis. - false_easting : float, optional X offset from planar origin in metres. - false_northing : float, optional Y offset from planar origin in metres. - true_scale_lat : float, optional Latitude of true scale. - scale_factor_at_projection_origin : float, optional Scale factor at the origin of the projection - ellipsoid : :class:`GeogCS`, optional If given, defines the ellipsoid. Notes ----- - It is only valid to provide one of true_scale_lat and scale_factor_at_projection_origin + It is only valid to provide one of true_scale_lat and + scale_factor_at_projection_origin """ #: True latitude of planar origin in degrees. @@ -1054,7 +1020,7 @@ def __init__( scale_factor_at_projection_origin, None, cast_as=_float_or_None ) # N.B. the way we use these parameters, we need them to default to None, - # and *not* to 0.0 . + # and *not* to 0.0. if ( self.true_scale_lat is not None @@ -1123,22 +1089,16 @@ def __init__( ---------- central_lat : {90, -90} The latitude of the pole. - central_lon : float The central longitude, which aligns with the y axis. - false_easting : float, optional X offset from planar origin in metres. - false_northing : float, optional Y offset from planar origin in metres. - true_scale_lat : float, optional Latitude of true scale. - scale_factor_at_projection_origin : float, optional Scale factor at the origin of the projection - ellipsoid : :class:`GeogCS`, optional If given, defines the ellipsoid. @@ -1179,27 +1139,24 @@ def __init__( ): """Construct a LambertConformal coord system. - Kwargs: - - * central_lat: - The latitude of "unitary scale". Defaults to 39.0 . - - * central_lon: - The central longitude. Defaults to -96.0 . - - * false_easting: - X offset from planar origin in metres. Defaults to 0.0 . - - * false_northing: - Y offset from planar origin in metres. Defaults to 0.0 . - - * secant_latitudes (number or iterable of 1 or 2 numbers): - Latitudes of secant intersection. One or two. - Defaults to (33.0, 45.0). - - * ellipsoid (:class:`GeogCS`): + Parameters + ---------- + central_lat : optional + The latitude of "unitary scale". Defaults to 39.0 . + central_lon : optional + The central longitude. Defaults to -96.0 . + false_easting : optional + X offset from planar origin in metres. Defaults to 0.0. + false_northing : optional + Y offset from planar origin in metres. Defaults to 0.0. + secant_latitudes : number or iterable of 1 or 2 numbers, optional + Latitudes of secant intersection. One or two. + Defaults to (33.0, 45.0). + ellipsoid : :class:`GeogCS`, optional If given, defines the ellipsoid. + Notes + ----- .. note: Default arguments are for the familiar USA map: @@ -1285,31 +1242,27 @@ def __init__( ): """Construct a Mercator coord system. - Kwargs: - - * longitude_of_projection_origin: - True longitude of planar origin in degrees. Defaults to 0.0 . - - * ellipsoid (:class:`GeogCS`): + Parameters + ---------- + longitude_of_projection_origin : optional + True longitude of planar origin in degrees. Defaults to 0.0. + ellipsoid : :class:`GeogCS`, optional If given, defines the ellipsoid. - - * standard_parallel: - The latitude where the scale is 1. Defaults to 0.0 . - - * scale_factor_at_projection_origin: + standard_parallel : optional + The latitude where the scale is 1. Defaults to 0.0. + scale_factor_at_projection_origin : optional Scale factor at natural origin. Defaults to unused. - - * false_easting: + false_easting : optional X offset from the planar origin in metres. Defaults to 0.0. - - * false_northing: + false_northing : optional Y offset from the planar origin in metres. Defaults to 0.0. - - * datum: + datum : optional If given, specifies the datumof the coordinate system. Only respected if iris.Future.daum_support is set. - Note: Only one of ``standard_parallel`` and + Notes + ----- + Only one of ``standard_parallel`` and ``scale_factor_at_projection_origin`` should be included. """ @@ -1390,21 +1343,17 @@ def __init__( ): """Construct a Lambert Azimuthal Equal Area coord system. - Kwargs: - - * latitude_of_projection_origin: - True latitude of planar origin in degrees. Defaults to 0.0 . - - * longitude_of_projection_origin: - True longitude of planar origin in degrees. Defaults to 0.0 . - - * false_easting: - X offset from planar origin in metres. Defaults to 0.0 . - - * false_northing: - Y offset from planar origin in metres. Defaults to 0.0 . - - * ellipsoid (:class:`GeogCS`): + Parameters + ---------- + latitude_of_projection_origin : optional + True latitude of planar origin in degrees. Defaults to 0.0. + longitude_of_projection_origin : optional + True longitude of planar origin in degrees. Defaults to 0.0. + false_easting : optional + X offset from planar origin in metres. Defaults to 0.0. + false_northing : optional + Y offset from planar origin in metres. Defaults to 0.0. + ellipsoid : :class:`GeogCS`, optional If given, defines the ellipsoid. """ @@ -1471,26 +1420,21 @@ def __init__( ): """Construct a Albers Conical Equal Area coord system. - Kwargs: - - * latitude_of_projection_origin: - True latitude of planar origin in degrees. Defaults to 0.0 . - - * longitude_of_central_meridian: + Parameters + ---------- + latitude_of_projection_origin : optional + True latitude of planar origin in degrees. Defaults to 0.0. + longitude_of_central_meridian : optional True longitude of planar central meridian in degrees. - Defaults to 0.0 . - - * false_easting: - X offset from planar origin in metres. Defaults to 0.0 . - - * false_northing: - Y offset from planar origin in metres. Defaults to 0.0 . - - * standard_parallels (number or iterable of 1 or 2 numbers): + Defaults to 0.0. + false_easting : optional + X offset from planar origin in metres. Defaults to 0.0. + false_northing : optional + Y offset from planar origin in metres. Defaults to 0.0. + standard_parallels : number or iterable of 1 or 2 numbers, optional The one or two latitudes of correct scale. Defaults to (20.0, 50.0). - - * ellipsoid (:class:`GeogCS`): + ellipsoid : :class:`GeogCS`, optional If given, defines the ellipsoid. """ @@ -1587,14 +1531,14 @@ def __init__( The true latitude of the planar origin in degrees. false_easting: float, optional X offset from the planar origin in metres. - Defaults to 0.0 . + Defaults to 0.0. false_northing: float, optional Y offset from the planar origin in metres. - Defaults to 0.0 . + Defaults to 0.0. scale_factor_at_projection_origin: float, optional Scale factor at the central meridian. Defaults to 1.0 . - ellipsoid: :class:`GeogCS`, optional + ellipsoid : :class:`GeogCS`, optional If given, defines the ellipsoid. Examples @@ -1699,10 +1643,10 @@ def __init__( The true latitude of the planar origin in degrees. false_easting: float, optional X offset from the planar origin in metres. - Defaults to 0.0 . + Defaults to 0.0. false_northing: float, optional Y offset from the planar origin in metres. - Defaults to 0.0 . + Defaults to 0.0. scale_factor_at_projection_origin: float, optional Scale factor at the central meridian. Defaults to 1.0 . diff --git a/lib/iris/coords.py b/lib/iris/coords.py index d4d070921c..a9eae6e2ac 100644 --- a/lib/iris/coords.py +++ b/lib/iris/coords.py @@ -73,16 +73,16 @@ def __init__( ---------- values : The values of the dimensional metadata. - standard_name : optional, default=None + standard_name : optional CF standard name of the dimensional metadata. - long_name : optional, default=None + long_name : optional Descriptive name of the dimensional metadata. - var_name : optional, default=None + var_name : optional The netCDF variable name for the dimensional metadata. - units : optional, default=None + units : optional The :class:`~cf_units.Unit` of the dimensional metadata's values. Can be a string, which will be converted to a Unit object. - attributes : optional, default=None + attributes : optional A dictionary containing other cf and user-defined attributes. """ @@ -263,26 +263,26 @@ def summary( Parameters ---------- - shorten : bool, default = False + shorten : bool, default=False If True, produce an abbreviated one-line summary. If False, produce a multi-line summary, with embedded newlines. - max_values : int or None, default = None + max_values : int or None If more than this many data values, print truncated data arrays instead of full contents. If 0, print only the shape. The default is 5 if :attr:`shorten`\ =True, or 15 otherwise. This overrides ``numpy.get_printoptions['threshold']``\ . - linewidth : int or None, default = None + linewidth : int or None Character-width controlling line splitting of array outputs. If unset, defaults to ``numpy.get_printoptions['linewidth']``\ . edgeitems : int, default=2 Controls truncated array output. Overrides ``numpy.getprintoptions['edgeitems']``\ . - precision : int or None, default = None + precision : int or None Controls number decimal formatting. When :attr:`shorten`\ =True this is defaults to 3, in which case it overrides ``numpy.get_printoptions()['precision']``\ . - convert_dates : bool, default = True + convert_dates : bool, default=True If the units has a calendar, then print array values as date strings instead of the actual numbers. @@ -914,16 +914,16 @@ def __init__( ---------- data : The values of the ancillary variable. - standard_name : optional, default=None + standard_name : optional CF standard name of the ancillary variable. - long_name : optional, default=None + long_name : optional Descriptive name of the ancillary variable. - var_name : optional, default=None + var_name : optional The netCDF variable name for the ancillary variable. - units : optional, default=None + units : optional The :class:`~cf_units.Unit` of the ancillary variable's values. Can be a string, which will be converted to a Unit object. - attributes : optional, default=None + attributes : optional A dictionary containing other cf and user-defined attributes. """ @@ -1014,16 +1014,16 @@ def __init__( The values of the measure for each cell. Either a 'real' array (:class:`numpy.ndarray`) or a 'lazy' array (:class:`dask.array.Array`). - standard_name : optional, default=None + standard_name : optional CF standard name of the coordinate. - long_name : optional, default=None + long_name : optional Descriptive name of the coordinate. - var_name : optional, default=None + var_name : optional The netCDF variable name for the coordinate. - units : optional, default=None + units : optional The :class:`~cf_units.Unit` of the coordinate's values. Can be a string, which will be converted to a Unit object. - attributes : optional, default=None + attributes : optional A dictionary containing other CF and user-defined attributes. measure : optional A string describing the type of measure. Supported values are @@ -1125,10 +1125,10 @@ def __new__( The minimum value of the range to select. maximum : The maximum value of the range to select. - min_inclusive : optional + min_inclusive : bool, default=True If True, coordinate values equal to `minimum` will be included in the selection. Default is True. - max_inclusive : optional + max_inclusive : bool, default=True If True, coordinate values equal to `maximum` will be included in the selection. Default is True. @@ -1452,16 +1452,16 @@ def __init__( points : The values (or value in the case of a scalar coordinate) for each cell of the coordinate. - standard_name : optional, default=None + standard_name : optional CF standard name of the coordinate. - long_name : optional, default=None + long_name : optional Descriptive name of the coordinate. - var_name : optional, default=None + var_name : optional The netCDF variable name for the coordinate. - units : optional, default=None + units : optional The :class:`~cf_units.Unit` of the coordinate's values. Can be a string, which will be converted to a Unit object. - bounds : optional, default=None + bounds : optional An array of values describing the bounds of each cell. Given n bounds for each cell, the shape of the bounds array should be points.shape + (n,). For example, a 1D coordinate with 100 points @@ -1469,13 +1469,13 @@ def __init__( (100, 2) Note if the data is a climatology, `climatological` should be set. - attributes : optional, default=None + attributes : optional A dictionary containing other CF and user-defined attributes. - coord_system : optional, default=None + coord_system : optional A :class:`~iris.coord_systems.CoordSystem` representing the coordinate system of the coordinate, e.g., a :class:`~iris.coord_systems.GeogCS` for a longitude coordinate. - climatological : bool, optional, default=False + climatological : bool, default=False When True: the coordinate is a NetCDF climatological time axis. When True: saving in NetCDF will give the coordinate variable a 'climatology' attribute and will create a boundary variable called @@ -1512,11 +1512,11 @@ def __init__( def copy(self, points=None, bounds=None): """Return a copy of this coordinate. - points : + points : optional A points array for the new coordinate. This may be a different shape to the points of the coordinate being copied. - bounds : + bounds : optional A bounds array for the new coordinate. Given n bounds for each cell, the shape of the bounds array should be points.shape + (n,). For example, a 1d coordinate @@ -1830,10 +1830,10 @@ def _sanity_check_bounds(self): def _discontiguity_in_bounds(self, rtol=1e-5, atol=1e-8): """Check that the bounds of the coordinate are contiguous. - rtol : float, optional + rtol : float, default=1e-5 Relative tolerance that is used when checking contiguity. Defaults to 1e-5. - atol : float, optional + atol : float, default=1e-8 Absolute tolerance that is used when checking contiguity. Defaults to 1e-8. @@ -1933,9 +1933,9 @@ def is_contiguous(self, rtol=1e-05, atol=1e-08): Parameters ---------- - rtol : optional + rtol : float, default=1e-05 The relative tolerance parameter (default is 1e-05). - atol : optional + atol : float, default=1e-08 The absolute tolerance parameter (default is 1e-08). Returns @@ -2196,7 +2196,7 @@ def _guess_bounds(self, bound_position=0.5): Parameters ---------- - bound_position : optional, default=0.5 + bound_position : float, default=0.5 The desired position of the bounds relative to the position of the points. @@ -2268,7 +2268,7 @@ def guess_bounds(self, bound_position=0.5): Parameters ---------- - bound_position : optional, default=0.5 + bound_position : float, default=0.5 The desired position of the bounds relative to the position of the points. @@ -2296,7 +2296,7 @@ def intersect(self, other, return_indices=False): Parameters ---------- - return_indices : optional, default=False + return_indices : bool, default=False If True, changes the return behaviour to return the intersection indices for the "self" coordinate. @@ -2500,7 +2500,7 @@ def from_regular( The numeric difference between successive point values. count : The number of point values. - with_bounds : optional + with_bounds : bool, default=False If True, the resulting DimCoord will possess bound values which are equally spaced around the points. Otherwise no bounds values will be defined. Defaults to False. @@ -2554,16 +2554,16 @@ def __init__( 1D numpy array-like of values (or single value in the case of a scalar coordinate) for each cell of the coordinate. The values must be strictly monotonic and masked values are not allowed. - standard_name : optional, default=None + standard_name : optional CF standard name of the coordinate. - long_name : optional, default=None + long_name : optional Descriptive name of the coordinate. - var_name : optional, default=None + var_name : optional The netCDF variable name for the coordinate. - units : :class:`~cf_units.Unit`, optional, default=None + units : :class:`~cf_units.Unit`, optional The :class:`~cf_units.Unit` of the coordinate's values. Can be a string, which will be converted to a Unit object. - bounds : optional, default=None + bounds : optional An array of values describing the bounds of each cell. Given n bounds and m cells, the shape of the bounds array should be (m, n). For each bound, the values must be strictly monotonic along @@ -2574,16 +2574,16 @@ def __init__( in the same direction. Masked values are not allowed. Note if the data is a climatology, `climatological` should be set. - attributes : optional, default=None + attributes : optional A dictionary containing other CF and user-defined attributes. - coord_system : :class:`~iris.coord_systems.CoordSystem`, optional, default=None + coord_system : :class:`~iris.coord_systems.CoordSystem`, optional A :class:`~iris.coord_systems.CoordSystem` representing the coordinate system of the coordinate, e.g., a :class:`~iris.coord_systems.GeogCS` for a longitude coordinate. - circular : bool, optional, default=False + circular : bool, default=False Whether the coordinate wraps by the :attr:`~iris.coords.DimCoord.units.modulus` i.e., the longitude coordinate wraps around the full great circle. - climatological : bool, optional, default=False + climatological : bool, default=False When True: the coordinate is a NetCDF climatological time axis. When True: saving in NetCDF will give the coordinate variable a 'climatology' attribute and will create a boundary variable called diff --git a/lib/iris/cube.py b/lib/iris/cube.py index 5997eaacf5..f868c2a082 100644 --- a/lib/iris/cube.py +++ b/lib/iris/cube.py @@ -76,7 +76,7 @@ def merged(self, unique=False): Parameters ---------- - unique : bool, optional, default=False + unique : bool, default=False If True, raises `iris.exceptions.DuplicateDataError` if duplicate cubes are detected. @@ -117,7 +117,7 @@ def merged(self, unique=False): Parameters ---------- - unique : bool, optional, default=False + unique : bool, default=False If True, raises `iris.exceptions.DuplicateDataError` if duplicate cubes are detected. @@ -250,7 +250,7 @@ def extract(self, constraints): Parameters ---------- - constraints : :class:`~iris.Constraint` or iterable of constraints + constraints : :class:`~iris.Constraint` or iterable of constraints A single constraint or an iterable. """ @@ -405,7 +405,7 @@ def merge(self, unique=True): Parameters ---------- - unique : bool, optional, default=True + unique : bool, default=True If True, raises `iris.exceptions.DuplicateDataError` if duplicate cubes are detected. @@ -511,20 +511,20 @@ def concatenate_cube( Parameters ---------- - check_aux_coords : bool, optional, default=True + check_aux_coords : bool, default=True Checks if the points and bounds of auxiliary coordinates of the cubes match. This check is not applied to auxiliary coordinates that span the dimension the concatenation is occurring along. Defaults to True. - check_cell_measures : bool, optional, default=True + check_cell_measures : bool, default=True Checks if the data of cell measures of the cubes match. This check is not applied to cell measures that span the dimension the concatenation is occurring along. Defaults to True. - check_ancils : bool, optional, default=True + check_ancils : bool, default=True Checks if the data of ancillary variables of the cubes match. This check is not applied to ancillary variables that span the dimension the concatenation is occurring along. Defaults to True. - check_derived_coords : bool, optional, default=True + check_derived_coords : bool, default=True Checks if the points and bounds of derived coordinates of the cubes match. This check is not applied to derived coordinates that span the dimension the concatenation is occurring along. Note that @@ -584,20 +584,20 @@ def concatenate( Parameters ---------- - check_aux_coords : bool, optional, default=True + check_aux_coords : bool, default=True Checks if the points and bounds of auxiliary coordinates of the cubes match. This check is not applied to auxiliary coordinates that span the dimension the concatenation is occurring along. Defaults to True. - check_cell_measures : bool, optional, default=True + check_cell_measures : bool, default=True Checks if the data of cell measures of the cubes match. This check is not applied to cell measures that span the dimension the concatenation is occurring along. Defaults to True. - check_ancils : bool, optional, default=True + check_ancils : bool, default=True Checks if the data of ancillary variables of the cubes match. This check is not applied to ancillary variables that span the dimension the concatenation is occurring along. Defaults to True. - check_derived_coords : bool, optional, default=True + check_derived_coords : bool, default=True Checks if the points and bounds of derived coordinates of the cubes match. This check is not applied to derived coordinates that span the dimension the concatenation is occurring along. Note that @@ -1199,33 +1199,33 @@ def __init__( array_like (as described in :func:`numpy.asarray`). See :attr:`Cube.data`. - standard_name : optional, default=None + standard_name : optional The standard name for the Cube's data. - long_name : optional, default=None + long_name : optional An unconstrained description of the cube. - var_name : optional, default=None + var_name : optional The NetCDF variable name for the cube. - units : optional, default=None + units : optional The unit of the cube, e.g. ``"m s-1"`` or ``"kelvin"``. - attributes : optional, default=None + attributes : optional A dictionary of cube attributes - cell_methods : optional, default=None + cell_methods : optional A tuple of CellMethod objects, generally set by Iris, e.g. ``(CellMethod("mean", coords='latitude'), )``. - dim_coords_and_dims : optional, default=None + dim_coords_and_dims : optional A list of coordinates with scalar dimension mappings, e.g ``[(lat_coord, 0), (lon_coord, 1)]``. - aux_coords_and_dims : optional, default=None + aux_coords_and_dims : optional A list of coordinates with dimension mappings, e.g ``[(lat_coord, 0), (lon_coord, (0, 1))]``. See also :meth:`Cube.add_dim_coord()` and :meth:`Cube.add_aux_coord()`. - aux_factories : optional, default=None + aux_factories : optional A list of auxiliary coordinate factories. See :mod:`iris.aux_factory`. - cell_measures_and_dims : optional, default=None + cell_measures_and_dims : optional A list of CellMeasures with dimension mappings. - ancillary_variables_and_dims : optional, default=None + ancillary_variables_and_dims : optional A list of AncillaryVariables with dimension mappings. Examples @@ -1381,7 +1381,7 @@ def is_compatible(self, other, ignore=None): other : An instance of :class:`iris.cube.Cube` or :class:`iris.cube.CubeMetadata`. - ignore : optional, default=None + ignore : optional A single attribute key or iterable of attribute keys to ignore when comparing the cubes. Default is None. To ignore all attributes set this to other.attributes. @@ -1472,7 +1472,7 @@ def add_aux_coord(self, coord, data_dims=None): coord : The :class:`iris.coords.DimCoord` or :class:`iris.coords.AuxCoord` instance to add to the cube. - data_dims : optional, default=None + data_dims : optional Integer or iterable of integers giving the data dimensions spanned by the coordinate. @@ -1613,7 +1613,7 @@ def add_cell_measure(self, cell_measure, data_dims=None): cell_measure : The :class:`iris.coords.CellMeasure` instance to add to the cube. - data_dims : optional, default=None + data_dims : optional Integer or iterable of integers giving the data dimensions spanned by the coordinate. @@ -1646,7 +1646,7 @@ def add_ancillary_variable(self, ancillary_variable, data_dims=None): ancillary_variable : The :class:`iris.coords.AncillaryVariable` instance to be added to the cube - data_dims : optional, default=None + data_dims : optional Integer or iterable of integers giving the data dimensions spanned by the ancillary variable. @@ -1686,7 +1686,7 @@ def add_dim_coord(self, dim_coord, data_dim): See Also -------- - See also :meth:`Cube.remove_coord()`. + :meth:`Cube.remove_coord()`. """ if self.coords(dim_coord): @@ -1960,15 +1960,15 @@ def aux_factory(self, name=None, standard_name=None, long_name=None, var_name=No Parameters ---------- - name : optional, default=None + name : optional If not None, matches against factory.name(). - standard_name : optional, default=None + standard_name : optional The CF standard name of the desired coordinate factory. If None, does not check for standard name. - long_name : optional, default=None + long_name : optional An unconstrained description of the coordinate factory. If None, does not check for long_name. - var_name : optional, default=None + var_name : optional The NetCDF variable name of the desired coordinate factory. If None, does not check for var_name. @@ -2036,7 +2036,7 @@ def coords( Parameters ---------- - name_or_coord : optional, default=None + name_or_coord : optional Either, * a :attr:`~iris.common.mixin.CFVariableMixin.standard_name`, @@ -2047,39 +2047,39 @@ def coords( * a coordinate or metadata instance equal to that of the desired coordinate e.g., :class:`~iris.coords.DimCoord` or :class:`~iris.common.metadata.CoordMetadata`. - standard_name : optional, default=None + standard_name : optional The CF standard name of the desired coordinate. If ``None``, does not check for ``standard name``. - long_name : optional, default=None + long_name : optional An unconstrained description of the coordinate. If ``None``, does not check for ``long_name``. - var_name : optional, default=None + var_name : optional The NetCDF variable name of the desired coordinate. If ``None``, does not check for ``var_name``. - attributes : optional, default=None + attributes : optional A dictionary of attributes desired on the coordinates. If ``None``, does not check for ``attributes``. - axis : optional, default=None + axis : optional The desired coordinate axis, see :func:`iris.util.guess_coord_axis`. If ``None``, does not check for ``axis``. Accepts the values ``X``, ``Y``, ``Z`` and ``T`` (case-insensitive). - contains_dimension : optional, default=None + contains_dimension : optional The desired coordinate contains the data dimension. If ``None``, does not check for the dimension. - dimensions : optional, default=None + dimensions : optional The exact data dimensions of the desired coordinate. Coordinates with no data dimension can be found with an empty ``tuple`` or ``list`` i.e., ``()`` or ``[]``. If ``None``, does not check for dimensions. - coord_system : optional, default=None + coord_system : optional Whether the desired coordinates have a coordinate system equal to the given coordinate system. If ``None``, no check is done. - dim_coords : optional, default=None + dim_coords : optional Set to ``True`` to only return coordinates that are the cube's dimension coordinates. Set to ``False`` to only return coordinates that are the cube's auxiliary, mesh and derived coordinates. If ``None``, returns all coordinates. - mesh_coords : optional, default=None + mesh_coords : optional Set to ``True`` to return only coordinates which are :class:`~iris.experimental.ugrid.MeshCoord`\'s. Set to ``False`` to return only non-mesh coordinates. @@ -2192,7 +2192,7 @@ def coord( Parameters ---------- - name_or_coord : optional, default=None + name_or_coord : optional Either, * a :attr:`~iris.common.mixin.CFVariableMixin.standard_name`, @@ -2203,39 +2203,39 @@ def coord( * a coordinate or metadata instance equal to that of the desired coordinate e.g., :class:`~iris.coords.DimCoord` or :class:`~iris.common.metadata.CoordMetadata`. - standard_name : optional, default=None + standard_name : optional The CF standard name of the desired coordinate. If ``None``, does not check for ``standard name``. - long_name : optional, default=None + long_name : optional An unconstrained description of the coordinate. If ``None``, does not check for ``long_name``. - var_name : optional, default=None + var_name : optional The NetCDF variable name of the desired coordinate. If ``None``, does not check for ``var_name``. - attributes : optional, default=None + attributes : optional A dictionary of attributes desired on the coordinates. If ``None``, does not check for ``attributes``. - axis : optional, default=None + axis : optional The desired coordinate axis, see :func:`iris.util.guess_coord_axis`. If ``None``, does not check for ``axis``. Accepts the values ``X``, ``Y``, ``Z`` and ``T`` (case-insensitive). - contains_dimension : optional, default=None + contains_dimension : optional The desired coordinate contains the data dimension. If ``None``, does not check for the dimension. - dimensions : optional, default=None + dimensions : optional The exact data dimensions of the desired coordinate. Coordinates with no data dimension can be found with an empty ``tuple`` or ``list`` i.e., ``()`` or ``[]``. If ``None``, does not check for dimensions. - coord_system : optional, default=None + coord_system : optional Whether the desired coordinates have a coordinate system equal to the given coordinate system. If ``None``, no check is done. - dim_coords : optional, default=None + dim_coords : optional Set to ``True`` to only return coordinates that are the cube's dimension coordinates. Set to ``False`` to only return coordinates that are the cube's auxiliary, mesh and derived coordinates. If ``None``, returns all coordinates. - mesh_coords : optional, default=None + mesh_coords : optional Set to ``True`` to return only coordinates which are :class:`~iris.experimental.ugrid.MeshCoord`\'s. Set to ``False`` to return only non-mesh coordinates. @@ -2303,7 +2303,7 @@ def coord_system(self, spec=None): Parameters ---------- - spec : optional, default=None + spec : optional The the name or type of a coordinate system subclass. E.g. :: @@ -2421,7 +2421,7 @@ def cell_measures(self, name_or_cell_measure=None): Parameters ---------- - name_or_cell_measure : optional, default=None + name_or_cell_measure : optional Either * (a) a :attr:`standard_name`, :attr:`long_name`, or @@ -2508,7 +2508,7 @@ def ancillary_variables(self, name_or_ancillary_variable=None): Parameters ---------- - name_or_ancillary_variable : optional, default=None + name_or_ancillary_variable : optional Either * (a) a :attr:`standard_name`, :attr:`long_name`, or @@ -2784,11 +2784,11 @@ def summary(self, shorten=False, name_padding=35): Parameters ---------- - shorten : bool + shorten : bool, default=False If set, produce a one-line summary of minimal width, showing only the cube name, units and dimensions. When not set (default), produces a full multi-line summary string. - name_padding : int + name_padding : int, default=35 Control the *minimum* width of the cube name + units, i.e. the indent of the dimension map section. @@ -3448,7 +3448,7 @@ def slices(self, ref_to_slice, ordered=True): the dimensions that are not iterated over). A mix of input types can also be provided. They must all be orthogonal (i.e. point to different dimensions). - ordered : bool, optional + ordered : bool, default=True if True, the order which the coords to slice or data_dims are given will be the order in which they represent the data in the resulting cube slices. If False, the order will follow that of @@ -3764,7 +3764,7 @@ def copy(self, data=None): Parameters ---------- - data : optional, default=None + data : optional Replace the data of the cube copy with provided data payload. Returns @@ -4197,7 +4197,7 @@ def aggregated_by(self, coords, aggregator, climatological=False, **kwargs): performed. aggregator : :class:`iris.analysis.Aggregator` Aggregator to be applied to each group. - climatological : bool + climatological : bool, default=False Indicates whether the output is expected to be climatological. For any aggregated time coord(s), this causes the climatological flag to be set and the point for each cell to equal its first bound, thereby @@ -4680,7 +4680,7 @@ def interpolate(self, sample_points, scheme, collapse_scalar=True): * :class:`iris.analysis.Linear`, and * :class:`iris.analysis.Nearest`. - collapse_scalar : bool, optional + collapse_scalar : bool, default=True Whether to collapse the dimension of scalar sample points in the resulting cube. Default is True. diff --git a/lib/iris/experimental/regrid.py b/lib/iris/experimental/regrid.py index 74b356722f..1bea933fbf 100644 --- a/lib/iris/experimental/regrid.py +++ b/lib/iris/experimental/regrid.py @@ -92,7 +92,7 @@ def regrid_area_weighted_rectilinear_src_and_grid(src_cube, grid_cube, mdtol=0): grid_cube : :class:`iris.cube.Cube` An instance of :class:`iris.cube.Cube` that supplies the desired horizontal grid definition. - mdtol : int, optional, default=0 + mdtol : int, default=0 Tolerance of missing data. The value returned in each element of the returned cube's data array will be masked if the fraction of masked data in the overlapping cells of the source cube exceeds mdtol. This diff --git a/lib/iris/experimental/regrid_conservative.py b/lib/iris/experimental/regrid_conservative.py index 07b076b57e..e15b1c29a5 100644 --- a/lib/iris/experimental/regrid_conservative.py +++ b/lib/iris/experimental/regrid_conservative.py @@ -65,6 +65,7 @@ def _make_esmpy_field(x_coord, y_coord, ref_name="field", data=None, mask=None): x_coord, y_coord : :class:`iris.coords.Coord` One-dimensional coordinates of shape (nx,) and (ny,). Their contiguous bounds define an ESMF.Grid of shape (nx, ny). + ref_name : stre, default="field" data : :class:`numpy.ndarray`, shape (nx,ny), optional Set the Field data content. mask : :class:`numpy.ndarray`, bool, shape (nx,ny), optional diff --git a/lib/iris/experimental/representation.py b/lib/iris/experimental/representation.py index 0b98c24395..4ffe176e3a 100644 --- a/lib/iris/experimental/representation.py +++ b/lib/iris/experimental/representation.py @@ -207,18 +207,24 @@ def _make_shapes_row(self): def _make_row(self, title, body=None, col_span=0): """Produce one row for the table body. - For example:: + Parameters + ---------- + body : str, optional + Contains the content for each cell not in the left-most (title) column. + If None, indicates this row is a title row (see below). + title : stre, optional + Contains the row heading. If `body` is None, indicates + that the row contains a sub-heading; + e.g. 'Dimension coordinates:'. + col_span : int, default=0 + Indicates how many columns the string should span. + + Examples + -------- + :: Coord namex-.... - * `body` contains the content for each cell not in the left-most (title) - column. - If None, indicates this row is a title row (see below). - * `title` contains the row heading. If `body` is None, indicates - that the row contains a sub-heading; - e.g. 'Dimension coordinates:'. - * `col_span` indicates how many columns the string should span. - """ row = [''] template = " {content}" diff --git a/lib/iris/experimental/stratify.py b/lib/iris/experimental/stratify.py index 3e5fb1da9f..50f8c21dcf 100644 --- a/lib/iris/experimental/stratify.py +++ b/lib/iris/experimental/stratify.py @@ -20,10 +20,8 @@ def _copy_coords_without_z_dim(src, tgt, z_dim): ---------- src : :class:`~iris.cube.Cube` Incoming cube containing the coordinates to be copied from. - tgt : :class:`~iris.cube.Cube` Outgoing cube for the coordinates to be copied to. - z_dim : int Dimension within the `src` cube that is the z-dimension. This dimension will not be copied. For example, the incoming @@ -67,27 +65,23 @@ def relevel(cube, src_levels, tgt_levels, axis=None, interpolator=None): ---------- cube : :class:`~iris.cube.Cube` The phenomenon data to be re-levelled. - - src_levels : :class:`~iris.cube.Cube`, :class:`~iris.coord.Coord` or string + src_levels : :class:`~iris.cube.Cube`, :class:`~iris.coord.Coord` or str Describes the source levels of the `cube` that will be interpolated over. The `src_levels` must be in the same system as the `tgt_levels`. The dimensions of `src_levels` must be broadcastable to the dimensions of the `cube`. Note that, the coordinate name containing the source levels in the `cube` may be provided. - tgt_levels : array-like Describes the target levels of the `cube` to be interpolated to. The `tgt_levels` must be in the same system as the `src_levels`. The dimensions of the `tgt_levels` must be broadcastable to the dimensions of the `cube`, except in the nominated axis of interpolation. - - axis : int, :class:`~iris.coords.Coord` or string + axis : int, :class:`~iris.coords.Coord` or str, optional The axis of interpolation. Defaults to the first dimension of the `cube`, which is typically the z-dimension. Note that, the coordinate name specifying the z-dimension of the `cube` may be provided. - - interpolator : callable or None + interpolator : callable or None, optional The interpolator to use when computing the interpolation. The function will be passed the following positional arguments:: diff --git a/lib/iris/experimental/ugrid/load.py b/lib/iris/experimental/ugrid/load.py index b8665a499e..b431f1ca96 100644 --- a/lib/iris/experimental/ugrid/load.py +++ b/lib/iris/experimental/ugrid/load.py @@ -127,10 +127,10 @@ def load_mesh(uris, var_name=None): ---------- uris : str or iterable of str One or more filenames/URI's. Filenames can include wildcards. Any URI's - must support OpenDAP. + must support OpenDAP. var_name : str, optional Only return a :class:`~iris.experimental.ugrid.mesh.Mesh` if its - var_name matches this value. + var_name matches this value. Returns ------- @@ -153,17 +153,17 @@ def load_meshes(uris, var_name=None): ---------- uris : str or iterable of str One or more filenames/URI's. Filenames can include wildcards. Any URI's - must support OpenDAP. + must support OpenDAP. var_name : str, optional Only return :class:`~iris.experimental.ugrid.mesh.Mesh`\\ es that have - var_names matching this value. + var_names matching this value. Returns ------- dict A dictionary mapping each mesh-containing file path/URL in the input - ``uris`` to a list of the - :class:`~iris.experimental.ugrid.mesh.Mesh`\\ es returned from each. + ``uris`` to a list of the + :class:`~iris.experimental.ugrid.mesh.Mesh`\\ es returned from each. """ # TODO: rationalise UGRID/mesh handling once experimental.ugrid is folded diff --git a/lib/iris/experimental/ugrid/mesh.py b/lib/iris/experimental/ugrid/mesh.py index 147b1fd513..2494998e4c 100644 --- a/lib/iris/experimental/ugrid/mesh.py +++ b/lib/iris/experimental/ugrid/mesh.py @@ -313,7 +313,7 @@ def indices_by_location(self, indices=None): Parameters ---------- - indices : array + indices : array, optional The array on which to operate. If ``None``, will operate on :attr:`indices`. Default is ``None``. @@ -1260,17 +1260,17 @@ def add_coords( Parameters ---------- - node_x (object) : optional, default=None + node_x : optional The ``x-axis`` like ``node`` :class:`~iris.coords.AuxCoord`. - node_y (object): optional, default=None + node_y : optional The ``y-axis`` like ``node`` :class:`~iris.coords.AuxCoord`. - edge_x (object): optional, default=None + edge_x : optional The ``x-axis`` like ``edge`` :class:`~iris.coords.AuxCoord`. - edge_y (object): optional, default=None + edge_y : optional The ``y-axis`` like ``edge`` :class:`~iris.coords.AuxCoord`. - face_x (object): optional, default=None + face_x : optional The ``x-axis`` like ``face`` :class:`~iris.coords.AuxCoord`. - face_y (object): optional, default=None + face_y : optional The ``y-axis`` like ``face`` :class:`~iris.coords.AuxCoord`. """ @@ -1326,23 +1326,23 @@ def connectivities( the desired objects e.g., :class:`~iris.experimental.ugrid.mesh.Connectivity` or :class:`~iris.experimental.ugrid.metadata.ConnectivityMetadata`. - standard_name : str, optional, default=None + standard_name : str, optional The CF standard name of the desired :class:`~iris.experimental.ugrid.mesh.Connectivity`. If ``None``, does not check for ``standard_name``. - long_name : str, optional, default=None + long_name : str, optional An unconstrained description of the :class:`~iris.experimental.ugrid.mesh.Connectivity`. If ``None``, does not check for ``long_name``. - var_name : str, optional, default=None + var_name : str, optional The NetCDF variable name of the desired :class:`~iris.experimental.ugrid.mesh.Connectivity`. If ``None``, does not check for ``var_name``. - attributes : dict, optional, default=None + attributes : dict, optional A dictionary of attributes desired on the :class:`~iris.experimental.ugrid.mesh.Connectivity`. If ``None``, does not check for ``attributes``. - cf_role : str, optional, default=None + cf_role : str, optional The UGRID ``cf_role`` of the desired :class:`~iris.experimental.ugrid.mesh.Connectivity`. contains_node : bool, optional @@ -1422,23 +1422,23 @@ def connectivity( the desired object e.g., :class:`~iris.experimental.ugrid.mesh.Connectivity` or :class:`~iris.experimental.ugrid.metadata.ConnectivityMetadata`. - standard_name : str, optional, default=None + standard_name : str, optional The CF standard name of the desired :class:`~iris.experimental.ugrid.mesh.Connectivity`. If ``None``, does not check for ``standard_name``. - long_name : str, optional, default=None + long_name : str, optional An unconstrained description of the :class:`~iris.experimental.ugrid.mesh.Connectivity`. If ``None``, does not check for ``long_name``. - var_name : str, optional, default=None + var_name : str, optional The NetCDF variable name of the desired :class:`~iris.experimental.ugrid.mesh.Connectivity`. If ``None``, does not check for ``var_name``. - attributes : dict, optional, default=None + attributes : dict, optional A dictionary of attributes desired on the :class:`~iris.experimental.ugrid.mesh.Connectivity`. If ``None``, does not check for ``attributes``. - cf_role : str, optional, default=None + cf_role : str, optional The UGRID ``cf_role`` of the desired :class:`~iris.experimental.ugrid.mesh.Connectivity`. contains_node : bool, optional @@ -1505,7 +1505,7 @@ def coord( Parameters ---------- - item : str or object, optional, default=None + item : str or object, optional Either, * a :attr:`~iris.common.mixin.CFVariableMixin.standard_name`, @@ -1516,19 +1516,19 @@ def coord( * a coordinate or metadata instance equal to that of the desired coordinate e.g., :class:`~iris.coords.AuxCoord` or :class:`~iris.common.metadata.CoordMetadata`. - standard_name : str, optional, default=None + standard_name : str, optional The CF standard name of the desired coordinate. If ``None``, does not check for ``standard_name``. - long_name : str, optional, default=None + long_name : str, optional An unconstrained description of the coordinate. If ``None``, does not check for ``long_name``. - var_name : str, optional, default=None + var_name : str, optional The NetCDF variable name of the desired coordinate. If ``None``, does not check for ``var_name``. - attributes : dict, optional, default=None + attributes : dict, optional A dictionary of attributes desired on the coordinates. If ``None``, does not check for ``attributes``. - axis : str, optional, default=None + axis : str, optional The desired coordinate axis, see :func:`~iris.util.guess_coord_axis`. If ``None``, does not check for ``axis``. Accepts the values ``X``, ``Y``, ``Z`` and ``T`` (case-insensitive). @@ -1585,7 +1585,7 @@ def coords( Parameters ---------- - item : str or object, optional, default=None + item : str or object, optional Either, * a :attr:`~iris.common.mixin.CFVariableMixin.standard_name`, @@ -1596,19 +1596,19 @@ def coords( * a coordinate or metadata instance equal to that of the desired coordinates e.g., :class:`~iris.coords.AuxCoord` or :class:`~iris.common.metadata.CoordMetadata`. - standard_name : str, optional, default=None + standard_name : str, optional The CF standard name of the desired coordinate. If ``None``, does not check for ``standard_name``. - long_name : str, optional, default=None + long_name : str, optional An unconstrained description of the coordinate. If ``None``, does not check for ``long_name``. - var_name : str, optional, default=None + var_name : str, optional The NetCDF variable name of the desired coordinate. If ``None``, does not check for ``var_name``. - attributes : dict, optional, default=None + attributes : dict, optional A dictionary of attributes desired on the coordinates. If ``None``, does not check for ``attributes``. - axis : str, optional, default=None + axis : str, optional The desired coordinate axis, see :func:`~iris.util.guess_coord_axis`. If ``None``, does not check for ``axis``. Accepts the values ``X``, ``Y``, ``Z`` and ``T`` (case-insensitive). @@ -1661,7 +1661,7 @@ def remove_connectivities( Parameters ---------- - item : str or object, optional, default=None + item : str or object, optional Either, * a :attr:`~iris.common.mixin.CFVariableMixin.standard_name`, @@ -1673,23 +1673,23 @@ def remove_connectivities( the desired objects e.g., :class:`~iris.experimental.ugrid.mesh.Connectivity` or :class:`~iris.experimental.ugrid.metadata.ConnectivityMetadata`. - standard_name : str, optional, default=None + standard_name : str, optional The CF standard name of the desired :class:`~iris.experimental.ugrid.mesh.Connectivity`. If ``None``, does not check for ``standard_name``. - long_name : str, optional, default=None + long_name : str, optional An unconstrained description of the :class:`~iris.experimental.ugrid.mesh.Connectivity`. If ``None``, does not check for ``long_name``. - var_name : str, optional, default=None + var_name : str, optional The NetCDF variable name of the desired :class:`~iris.experimental.ugrid.mesh.Connectivity`. If ``None``, does not check for ``var_name``. - attributes : dict, optional, default=None + attributes : dict, optional A dictionary of attributes desired on the :class:`~iris.experimental.ugrid.mesh.Connectivity`. If ``None``, does not check for ``attributes``. - cf_role : str, optional, default=None + cf_role : str, optional The UGRID ``cf_role`` of the desired :class:`~iris.experimental.ugrid.mesh.Connectivity`. contains_node : bool, optional @@ -1747,7 +1747,7 @@ def remove_coords( Parameters ---------- - item : str or object, optional, default=None + item : str or object, optional Either, * a :attr:`~iris.common.mixin.CFVariableMixin.standard_name`, @@ -1758,19 +1758,19 @@ def remove_coords( * a coordinate or metadata instance equal to that of the desired coordinates e.g., :class:`~iris.coords.AuxCoord` or :class:`~iris.common.metadata.CoordMetadata`. - standard_name : str, optional, default=None + standard_name : str, optional The CF standard name of the desired coordinate. If ``None``, does not check for ``standard_name``. - long_name : str, optional, default=None + long_name : str, optional An unconstrained description of the coordinate. If ``None``, does not check for ``long_name``. - var_name : str, optional, default=None + var_name : str, optional The NetCDF variable name of the desired coordinate. If ``None``, does not check for ``var_name``. - attributes : dict, optional, default=None + attributes : dict, optional A dictionary of attributes desired on the coordinates. If ``None``, does not check for ``attributes``. - axis : str, optional, default=None + axis : str, optional The desired coordinate axis, see :func:`~iris.util.guess_coord_axis`. If ``None``, does not check for ``axis``. Accepts the values ``X``, ``Y``, ``Z`` and ``T`` (case-insensitive). @@ -1908,10 +1908,10 @@ def dimension_names_reset(self, node=False, edge=False, face=False): node : bool, optional, default=False Reset the name of the ``node`` dimension if ``True``. Default is ``False``. - edge : bool, optional, default=False + edge : bool, default=False Reset the name of the ``edge`` dimension if ``True``. Default is ``False``. - face : bool, optional, default=False + face : bool, default=False Reset the name of the ``face`` dimension if ``True``. Default is ``False``. @@ -1930,13 +1930,13 @@ def dimension_names(self, node=None, edge=None, face=None): Parameters ---------- - node : str, optional, default=None + node : str, optional The name to be used for the NetCDF variable representing the ``node`` dimension. - edge : str, optional, default=None + edge : str, optional The name to be used for the NetCDF variable representing the ``edge`` dimension. - face : str, optional, default=None + face : str, optional The name to be used for the NetCDF variable representing the ``face`` dimension. @@ -2842,7 +2842,7 @@ def copy(self, points=None, bounds=None): Parameters ---------- - points, bounds : array) + points, bounds : array, optional Provided solely for signature compatibility with other types of :class:`~iris.coords.Coord`. In this case, if either is not 'None', an error is raised. diff --git a/lib/iris/experimental/ugrid/save.py b/lib/iris/experimental/ugrid/save.py index c78289fe26..40d1c42e90 100644 --- a/lib/iris/experimental/ugrid/save.py +++ b/lib/iris/experimental/ugrid/save.py @@ -16,17 +16,13 @@ def save_mesh(mesh, filename, netcdf_format="NETCDF4"): """Save mesh(es) to a netCDF file. - Args: - - * mesh (:class:`iris.experimental.ugrid.Mesh` or iterable): - mesh(es) to save. - - * filename (string): + Parameters + ---------- + mesh : :class:`iris.experimental.ugrid.Mesh` or iterable + Mesh(es) to save. + filename : str Name of the netCDF file to create. - - Kwargs: - - * netcdf_format (string): + netcdf_format : str, default="NETCDF4" Underlying netCDF file format, one of 'NETCDF4', 'NETCDF4_CLASSIC', 'NETCDF3_CLASSIC' or 'NETCDF3_64BIT'. Default is 'NETCDF4' format.