@@ -89,23 +89,35 @@ def generate_map(
89
89
output_path : Optional [Union [Path , str ]],
90
90
product_type : WorldCerealProduct = WorldCerealProduct .CROPLAND ,
91
91
out_format : str = "GTiff" ,
92
- ):
92
+ ) -> InferenceResults :
93
93
"""Main function to generate a WorldCereal product.
94
94
95
- Args:
96
- spatial_extent (BoundingBoxExtent): spatial extent of the map
97
- temporal_extent (TemporalContext): temporal range to consider
98
- backend_context (BackendContext): backend to run the job on
99
- output_path (Union[Path, str]): output path to download the product to
100
- product (str, optional): product describer. Defaults to "cropland".
101
- format (str, optional): Output format. Defaults to "GTiff".
102
-
103
- Raises:
104
- ValueError: if the product is not supported
105
- ValueError: if the out_format is not supported
106
- ValueError: if a cropland mask is applied on a cropland workflow
107
-
108
-
95
+ Parameters
96
+ ----------
97
+ spatial_extent : BoundingBoxExtent
98
+ spatial extent of the map
99
+ temporal_extent : TemporalContext
100
+ temporal range to consider
101
+ backend_context : BackendContext
102
+ backend to run the job on
103
+ output_path : Optional[Union[Path, str]]
104
+ output path to download the product to
105
+ product_type : WorldCerealProduct, optional
106
+ product describer, by default WorldCerealProduct.CROPLAND
107
+ out_format : str, optional
108
+ Output format, by default "GTiff"
109
+
110
+ Returns
111
+ -------
112
+ InferenceResults
113
+ Results of the finished WorldCereal job.
114
+
115
+ Raises
116
+ ------
117
+ ValueError
118
+ if the product is not supported
119
+ ValueError
120
+ if the out_format is not supported
109
121
"""
110
122
111
123
if product_type not in PRODUCT_SETTINGS .keys ():
@@ -172,18 +184,20 @@ def collect_inputs(
172
184
temporal_extent : TemporalContext ,
173
185
backend_context : BackendContext ,
174
186
output_path : Union [Path , str ],
175
- ) -> DataCube :
187
+ ):
176
188
"""Function to retrieve preprocessed inputs that are being
177
189
used in the generation of WorldCereal products.
178
190
179
- Args:
180
- spatial_extent (BoundingBoxExtent): spatial extent of the map
181
- temporal_extent (TemporalContext): temporal range to consider
182
- backend_context (BackendContext): backend to run the job on
183
- output_path (Union[Path, str]): output path to download the product to
184
-
185
- Raises:
186
- ValueError: if the product is not supported
191
+ Parameters
192
+ ----------
193
+ spatial_extent : BoundingBoxExtent
194
+ spatial extent of the map
195
+ temporal_extent : TemporalContext
196
+ temporal range to consider
197
+ backend_context : BackendContext
198
+ backend to run the job on
199
+ output_path : Union[Path, str]
200
+ output path to download the product to
187
201
188
202
"""
189
203
@@ -211,11 +225,15 @@ def _cropland_map(inputs: DataCube) -> DataCube:
211
225
"""Method to produce cropland map from preprocessed inputs, using
212
226
a Presto feature extractor and a CatBoost classifier.
213
227
214
- Args:
215
- inputs (DataCube): preprocessed input cube
228
+ Parameters
229
+ ----------
230
+ inputs : DataCube
231
+ preprocessed input cube
216
232
217
- Returns:
218
- DataCube: binary labels and probability
233
+ Returns
234
+ -------
235
+ DataCube
236
+ binary labels and probability
219
237
"""
220
238
221
239
# Run feature computer
@@ -267,12 +285,17 @@ def _croptype_map(inputs: DataCube, cropland_mask: DataCube = None) -> DataCube:
267
285
"""Method to produce croptype map from preprocessed inputs, using
268
286
a Presto feature extractor and a CatBoost classifier.
269
287
270
- Args:
271
- inputs (DataCube): preprocessed input cube
272
- cropland_mask (DataCube): optional cropland mask
273
-
274
- Returns:
275
- DataCube: croptype labels and probability
288
+ Parameters
289
+ ----------
290
+ inputs : DataCube
291
+ preprocessed input cube
292
+ cropland_mask : DataCube, optional
293
+ optional cropland mask, by default None
294
+
295
+ Returns
296
+ -------
297
+ DataCube
298
+ croptype labels and probability
276
299
"""
277
300
278
301
# Run feature computer
0 commit comments