Skip to content

Commit

Permalink
DOCS: numpydocs 7 (#5720)
Browse files Browse the repository at this point in the history
* numpydocs

* numpydocs
  • Loading branch information
tkknight authored Jan 30, 2024
1 parent 953f791 commit 8d29df0
Show file tree
Hide file tree
Showing 16 changed files with 204 additions and 199 deletions.
10 changes: 6 additions & 4 deletions lib/iris/fileformats/_ff.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ def vectors(self, subgrid):
Returns
-------
A 2-tuple of X-vector, Y-vector.
A 2-tuple of X-vector, Y-vector.
"""
x_p, x_u = self._x_vectors()
Expand Down Expand Up @@ -223,7 +223,7 @@ def regular_x(self, subgrid):
Returns
-------
A 2-tuple of BZX, BDX.
A 2-tuple of BZX, BDX.
"""
bdx = self.ew_spacing
Expand All @@ -245,7 +245,7 @@ def regular_y(self, subgrid):
Returns
-------
A 2-tuple of BZY, BDY.
A 2-tuple of BZY, BDY.
"""
bdy = self.ns_spacing
Expand Down Expand Up @@ -307,6 +307,7 @@ def __init__(self, filename, word_depth=DEFAULT_FF_WORD_DEPTH):
----------
filename : str
Specify the name of the FieldsFile.
word_depth : int, default=DEFAULT_FF_WORD_DEPTH
Returns
-------
Expand Down Expand Up @@ -445,9 +446,10 @@ def __init__(self, filename, read_data=False, word_depth=DEFAULT_FF_WORD_DEPTH):
----------
filename : str
Specify the name of the FieldsFile.
read_data : bool, optional
read_data : bool, default=False
Specify whether to read the associated PPField data within
the FieldsFile. Default value is False.
word_depth : int, default=DEFAULT_FF_WORD_DEPTH
Returns
-------
Expand Down
1 change: 1 addition & 0 deletions lib/iris/fileformats/_nc_load_rules/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
For now, we are still emulating various aspects of how our original Pyke-based
code used the Pyke 'engine' to hold translation data, both Pyke-specific and
not :
1) basic details from the iris.fileformats.cf analysis of the file are
recorded before translating each output cube, using
"engine.assert_case_specific_fact(name, args)".
Expand Down
9 changes: 6 additions & 3 deletions lib/iris/fileformats/_nc_load_rules/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ def _split_cell_methods(nc_cell_methods: str) -> List[re.Match]:
Parameters
----------
nc_cell_methods :
nc_cell_methods : str
The value of the cell methods attribute to be split.
Returns
Expand Down Expand Up @@ -341,6 +341,7 @@ def parse_cell_methods(nc_cell_methods, cf_name=None):
----------
nc_cell_methods : str
The value of the cell methods attribute to be parsed.
cf_name : optional
Returns
-------
Expand Down Expand Up @@ -1330,8 +1331,10 @@ def build_ancil_var(engine, cf_av_var):
def _is_lat_lon(cf_var, ud_units, std_name, std_name_grid, axis_name, prefixes):
"""Determine whether the CF coordinate variable is a latitude/longitude variable.
Ref: [CF] Section 4.1 Latitude Coordinate.
[CF] Section 4.2 Longitude Coordinate.
Ref:
* [CF] Section 4.1 Latitude Coordinate.
* [CF] Section 4.2 Longitude Coordinate.
"""
is_valid = False
Expand Down
26 changes: 15 additions & 11 deletions lib/iris/fileformats/abf.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,14 @@ class ABFField:
def __init__(self, filename):
"""Create an ABFField object from the given filename.
Args:
Parameters
----------
filename : str
An ABF filename.
* filename - An ABF filename.
Example::
Examples
--------
::
field = ABFField("AVHRRBUVI01.1985feba.abl")
Expand Down Expand Up @@ -194,14 +197,15 @@ def to_cube(self):
def load_cubes(filespecs, callback=None):
"""Load cubes from a list of ABF filenames.
Args:
* filenames - list of ABF filenames to load
Kwargs:
* callback - a function that can be passed to :func:`iris.io.run_callback`
Parameters
----------
filenames :
List of ABF filenames to load
callback : optional
A function that can be passed to :func:`iris.io.run_callback`
Notes
-----
.. note::
The resultant cubes may not be in the same order as in the file.
Expand Down
24 changes: 15 additions & 9 deletions lib/iris/fileformats/cf.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,11 @@ def identify(self, variables, ignore=None, target=None, warn=True):
----------
variables :
Dictionary of netCDF4.Variable instance by variable name.
ignore : optional, default=None
ignore : optional
List of variable names to ignore.
target : optional, default=None
target : optional
Name of a single variable to check.
warn : optional, default=None
warn : bool, default=True
Issue a warning if a missing variable is referenced.
Returns
Expand Down Expand Up @@ -300,8 +300,10 @@ class CFAuxiliaryCoordinateVariable(CFVariable):
Identified by the CF-netCDF variable attribute 'coordinates'.
Also see :class:`iris.fileformats.cf.CFLabelVariable`.
Ref: [CF] Chapter 5. Coordinate Systems.
[CF] Section 6.2. Alternative Coordinates.
Ref:
* [CF] Chapter 5. Coordinate Systems.
* [CF] Section 6.2. Alternative Coordinates.
"""

Expand Down Expand Up @@ -554,8 +556,10 @@ class _CFFormulaTermsVariable(CFVariable):
Identified by the CF-netCDF variable attribute 'formula_terms'.
Ref: [CF] Section 4.3.2. Dimensional Vertical Coordinate.
[CF] Appendix D. Dimensionless Vertical Coordinates.
Ref:
* [CF] Section 4.3.2. Dimensional Vertical Coordinate.
* [CF] Appendix D. Dimensionless Vertical Coordinates.
"""

Expand Down Expand Up @@ -628,8 +632,10 @@ class CFGridMappingVariable(CFVariable):
Identified by the CF-netCDF variable attribute 'grid_mapping'.
Ref: [CF] Section 5.6. Horizontal Coordinate Reference Systems, Grid Mappings, and Projections.
[CF] Appendix F. Grid Mappings.
Ref:
* [CF] Section 5.6. Horizontal Coordinate Reference Systems, Grid Mappings, and Projections.
* [CF] Appendix F. Grid Mappings.
"""

Expand Down
8 changes: 4 additions & 4 deletions lib/iris/fileformats/dot.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def save(cube, target):
Parameters
----------
cube: :class:`iris.cube.Cube`.
target
target :
A filename or open file handle.
See Also
Expand Down Expand Up @@ -94,9 +94,8 @@ def save_png(source, target, launch=False):
target :
A filename or open file handle.
If passing a file handle, take care to open it for binary output.
**kwargs :
* launch
Display the image. Default is False.
launch : bool, default=False
Display the image. Default is False.
See Also
--------
Expand Down Expand Up @@ -342,6 +341,7 @@ def _dot_node(indent, id, name, attributes):
The visual name of the node.
attributes :
An iterable of (name, value) attribute pairs.
""" # noqa: D410, D411
attributes = r"\n".join("%s: %s" % item for item in attributes)
template = """%(indent)s"%(id)s" [
Expand Down
3 changes: 1 addition & 2 deletions lib/iris/fileformats/netcdf/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -562,10 +562,8 @@ def load_cubes(file_sources, callback=None, constraints=None):
file_sources : str or list
One or more NetCDF filenames/OPeNDAP URLs to load from.
OR open datasets.
callback : function, optional
Function which can be passed on to :func:`iris.io.run_callback`.
constraints : optional
Returns
Expand Down Expand Up @@ -801,6 +799,7 @@ def as_dask(self) -> None:
Notes
-----
This function acts as a context manager, for use in a ``with`` block.
"""
old_mode = self.mode
old_var_dim_chunksizes = deepcopy(self.var_dim_chunksizes)
Expand Down
Loading

0 comments on commit 8d29df0

Please sign in to comment.