Skip to content

Commit ad9a32c

Browse files
committed
Improve documentation of functions/methods argument types
1 parent 61dd282 commit ad9a32c

3 files changed

Lines changed: 90 additions & 89 deletions

File tree

docs/reference.rst

Lines changed: 47 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ Product
8383

8484
Gets the band corresponding to the specified name.
8585

86-
:param name:
86+
:param str name:
8787
the name of the band
8888
:returns:
8989
the requested :class:`Band` instance, or raises a
@@ -95,7 +95,7 @@ Product
9595
Gets the :class:`Band` at the specified position within the
9696
:class:`product`.
9797

98-
:param index:
98+
:param int index:
9999
the index identifying the position of the :class:`Band`, starting
100100
with 0, must not be negative
101101
:returns:
@@ -107,7 +107,7 @@ Product
107107

108108
Gets the :class:`Dataset` corresponding to the specified dataset name.
109109

110-
:param name:
110+
:param str name:
111111
the :class:`Dataset` name
112112
:returns:
113113
the requested :class:`Dataset` instance
@@ -118,7 +118,7 @@ Product
118118
Gets the :class:`Dataset` at the specified position within the
119119
:class:`Product`.
120120

121-
:param index:
121+
:param int index:
122122
the index identifying the position of the :class:`Dataset`,
123123
starting with 0, must not be negative
124124
:returns:
@@ -132,7 +132,7 @@ Product
132132
Gets the :class:`DSD` (:class:`Dataset` descriptor) at the specified
133133
position within the :class:`Product`.
134134

135-
:param index:
135+
:param int index:
136136
the index identifying the position of the :class:`DSD`,
137137
starting with 0, must not be negative
138138
:returns:
@@ -185,20 +185,20 @@ Product
185185
the a certain dimension and sub-sampling as defined in the
186186
given raster.
187187

188-
:param bm_expr:
188+
:param str bm_expr:
189189
a string holding the logical expression for the definition
190190
of the bit-mask. In a bit-mask expression, any number of
191191
the flag-names (found in the DDDB) can be composed with
192192
"(", ")", "NOT", "AND", "OR". Valid bit-mask expression are
193193
for example ``flags.LAND OR flags.CLOUD`` or
194194
``NOT flags.WATER AND flags.TURBID_S``
195-
:param xoffset:
195+
:param int xoffset:
196196
across-track coordinate in pixel coordinates (zero-based)
197197
of the upper right corner of the source-region
198-
:param yoffset:
198+
:param int yoffset:
199199
along-track coordinate in pixel coordinates (zero-based)
200200
of the upper right corner of the source-region
201-
:param raster:
201+
:param int raster:
202202
the raster for the bit-mask. The data type of the raster
203203
must be either :data:`E_TID_UCHAR` or :data:`E_TID_CHAR`
204204
:returns:
@@ -262,7 +262,7 @@ Product
262262
Return a complex array that is the combination of two bands.
263263

264264
Return a complex array reading the real part from the band named
265-
"iname" and the imaginary part from the band named "qname".
265+
`iname` and the imaginary part from the band named `qname`.
266266

267267
:param str iname:
268268
name of the band containing the real part of the complex array
@@ -274,6 +274,8 @@ Product
274274
`imane` / `qname` does not correspond to the real/imaginary
275275
components (respectively) of the dataset
276276

277+
.. versionadded:: 1.3
278+
277279
.. rubric:: Special methods
278280

279281
The :class:`Product` class provides a custom implementation of the
@@ -365,9 +367,9 @@ Dataset
365367
In both cases, the :class:`Record` in which the data is read into will
366368
be returned.
367369

368-
:param index:
370+
:param int index:
369371
the zero-based :class:`Record` index (default: 0)
370-
:param record:
372+
:param epr.Record record:
371373
a pre-created :class:`Record` to reduce memory reallocation,
372374
can be ``None`` (default) to let the function allocate a new
373375
:class:`Record`
@@ -462,7 +464,7 @@ Record
462464
The :class:`Field` is here identified through the given name.
463465
It contains the :class:`Field` info and all corresponding values.
464466

465-
:param name:
467+
:param str name:
466468
the the name of required :class:`Field`
467469
:returns:
468470
the specified :class:`Field` or raises an exception
@@ -474,7 +476,7 @@ Record
474476
Gets a :class:`Field` at the specified position within the
475477
:class:`Record`.
476478

477-
:param index:
479+
:param int index:
478480
the zero-based index (position within :class:`Record`) of the
479481
:class:`Field`
480482
:returns:
@@ -513,9 +515,9 @@ Record
513515
element to the *ostream* text file or (default) the ASCII output
514516
will be printed to standard output (:data:`sys.stdout`).
515517

516-
:param field_index:
518+
:param int field_index:
517519
the index of :class:`Field` in the :class:`Record`
518-
:param element_index:
520+
:param int element_index:
519521
the index of element in the specified :class:`Field`
520522
:param ostream:
521523
the (opened) output file object
@@ -620,7 +622,7 @@ Field
620622

621623
This function is for getting the elements of a :class:`Field`.
622624

623-
:param index:
625+
:param int index:
624626
the zero-based index of element to be returned, must not be
625627
negative. Default: 0.
626628
:returns:
@@ -654,7 +656,7 @@ Field
654656

655657
:param elem:
656658
value of the element to set
657-
:param index:
659+
:param int index:
658660
the zero-based index of element to be set, must not be
659661
negative. Default: 0.
660662

@@ -975,18 +977,18 @@ Band
975977
This step can be set differently for the across track (source_step_x)
976978
and along track (source_step_y) directions.
977979

978-
:param src_width:
980+
:param int src_width:
979981
the width (across track dimension) of the source to be read
980982
into the :class:`Raster`. Default: scene width (see
981983
:attr:`Product.get_scene_width`)
982-
:param src_height:
984+
:param int src_height:
983985
the height (along track dimension) of the source to be read
984986
into the :class:`Raster`. Default: scene height (see
985987
:attr:`Product.get_scene_height`)
986-
:param xstep:
988+
:param int xstep:
987989
the sub-sampling step across track of the source when reading
988990
into the :class:`Raster`. Default: 1.
989-
:param ystep:
991+
:param int ystep:
990992
the sub-sampling step along track of the source when reading
991993
into the :class:`Raster`. Default: 1.
992994
:returns:
@@ -1015,15 +1017,15 @@ Band
10151017
The dimension of the region and the sub-sampling are attributes
10161018
of the :class:`Raster` into which the data are read.
10171019

1018-
:param xoffset:
1020+
:param int xoffset:
10191021
across-track source coordinate in pixel coordinates
10201022
(zero-based) of the upper right corner of the source-region.
10211023
Default 0.
1022-
:param yoffset:
1024+
:param int yoffset:
10231025
along-track source coordinate in pixel coordinates
10241026
(zero-based) of the upper right corner of the source-region.
10251027
Default 0.
1026-
:param raster:
1028+
:param epr.Raster raster:
10271029
:class:`Raster` instance set with appropriate parameters to
10281030
read into. If not provided a new :class:`Raster` is
10291031
instantiated
@@ -1055,26 +1057,26 @@ Band
10551057
The dimension of the region and the sub-sampling are attributes
10561058
of the :class:`Raster` into which the data are read.
10571059

1058-
:param src_width:
1060+
:param int src_width:
10591061
the width (across track dimension) of the source to be read
10601062
into the :class:`Raster`. If not provided reads as much as
10611063
possible
1062-
:param src_height:
1064+
:param int src_height:
10631065
the height (along track dimension) of the source to be read
10641066
into the :class:`Raster`, If not provided reads as much as
10651067
possible
1066-
:param xoffset:
1068+
:param int xoffset:
10671069
across-track source coordinate in pixel coordinates
10681070
(zero-based) of the upper right corner of the source-region.
10691071
Default 0.
1070-
:param yoffset:
1072+
:param int yoffset:
10711073
along-track source coordinate in pixel coordinates
10721074
(zero-based) of the upper right corner of the source-region.
10731075
Default 0.
1074-
:param xstep:
1076+
:param int xstep:
10751077
the sub-sampling step across track of the source when
10761078
reading into the :class:`Raster`. Default: 1
1077-
:param ystep:
1079+
:param int ystep:
10781080
the sub-sampling step along track of the source when
10791081
reading into the :class:`Raster`. Default: 1
10801082
:returns:
@@ -1172,9 +1174,9 @@ Raster
11721174
This function is for getting the values of the elements of a
11731175
:class:`Raster` (i.e. pixel)
11741176

1175-
:param x:
1177+
:param int x:
11761178
the (zero-based) X coordinate of the pixel
1177-
:param y:
1179+
:param int y:
11781180
the (zero-based) Y coordinate of the pixel
11791181
:returns:
11801182
the typed value at the given coordinate
@@ -1234,9 +1236,9 @@ Functions
12341236
reads MPH, SPH and all :class:`DSD`\ s, organized the table with
12351237
parameter of line length and tie points number.
12361238

1237-
:param product_file_path:
1239+
:param PathLike product_file_path:
12381240
the path to the ENVISAT :class:`Product` file
1239-
:param mode:
1241+
:param str mode:
12401242
string that specifies the mode in which the file is opened.
12411243
Allowed values: `rb` for read-only mode, `rb+` for read-write
12421244
mode. Default: mode=`rb`.
@@ -1297,18 +1299,18 @@ Functions
12971299

12981300
.. seealso:: `Data type Identifiers`_
12991301

1300-
:param src_width:
1302+
:param int src_width:
13011303
the width (across track dimension) of the source to be read
13021304
into the :class:`Raster`.
13031305
See description of :meth:`Band.create_compatible_raster`
1304-
:param src_height:
1306+
:param int src_height:
13051307
the height (along track dimension) of the source to be read
13061308
into the :class:`Raster`.
13071309
See description of :meth:`Band.create_compatible_raster`
1308-
:param xstep:
1310+
:param int xstep:
13091311
the sub-sampling step across track of the source when reading
13101312
into the :class:`Raster`. Default: 1.
1311-
:param ystep:
1313+
:param int ystep:
13121314
the sub-sampling step along track of the source when reading
13131315
into the :class:`Raster`. Default: 1.
13141316
:returns:
@@ -1323,16 +1325,16 @@ Functions
13231325

13241326
The :class:`Raster` returned always is of type ``byte``.
13251327

1326-
:param src_width:
1328+
:param int src_width:
13271329
the width (across track dimension) of the source to be read
13281330
into the :class:`Raster`
1329-
:param src_height:
1331+
:param int src_height:
13301332
the height (along track dimension) of the source to be read
13311333
into the :class:`Raster`
1332-
:param xstep:
1334+
:param int xstep:
13331335
the sub-sampling step across track of the source when reading
13341336
into the :class:`Raster`. Default: 1.
1335-
:param ystep:
1337+
:param int ystep:
13361338
the sub-sampling step along track of the source when reading
13371339
into the :class:`Raster`. Default: 1.
13381340
:returns:
@@ -1363,9 +1365,9 @@ EPRError
13631365

13641366
Initializer.
13651367

1366-
:param message:
1368+
:param str message:
13671369
error message
1368-
:param code:
1370+
:param int code:
13691371
EPR error code
13701372

13711373

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ match='(?!(test_|conf)).*\.py'
167167

168168

169169
[tool.codespell]
170-
skip = "*.pdf,*.ipynb,./docs/spelling_wordlist.txt,*.N1,extern,./src/epr/*.c"
170+
skip = "*.pdf,*.ipynb,./docs/spelling_wordlist.txt,*.N1,extern,./src/epr/*.c,./docs/_build"
171171
count = true
172172
quiet-level = 3
173173
# ignore-words-list = ""

0 commit comments

Comments
 (0)