@@ -136,7 +136,27 @@ def execute(self) -> dict:
136136 """Executes the process graph of the imagery."""
137137 return self ._connection .execute (self .flat_graph ())
138138
139- def download (self , outputfile : Union [str , pathlib .Path ], format : Optional [str ] = None , options : dict = None ):
139+ def download (
140+ self ,
141+ outputfile : Optional [Union [str , pathlib .Path ]] = None ,
142+ format : Optional [str ] = None ,
143+ options : Optional [dict ] = None ,
144+ ) -> Union [None , bytes ]:
145+ """
146+ Execute synchronously and download the vector cube.
147+
148+ The result will be stored to the output path, when specified.
149+ If no output path (or ``None``) is given, the raw download content will be returned as ``bytes`` object.
150+
151+ :param outputfile: (optional) output file to store the result to
152+ :param format: (optional) output format to use.
153+ :param options: (optional) additional output format options.
154+ :return:
155+
156+ .. versionchanged:: 0.21.0
157+ When not specified explicitly, output format is guessed from output file extension.
158+
159+ """
140160 # TODO #401 make outputfile optional (See DataCube.download)
141161 # TODO #401/#449 don't guess/override format if there is already a save_result with format?
142162 if format is None and outputfile :
@@ -163,8 +183,11 @@ def execute_batch(
163183
164184 :param job_options:
165185 :param outputfile: The path of a file to which a result can be written
166- :param out_format: (optional) Format of the job result.
167- :param format_options: String Parameters for the job result format
186+ :param out_format: (optional) output format to use.
187+ :param format_options: (optional) additional output format options
188+
189+ .. versionchanged:: 0.21.0
190+ When not specified explicitly, output format is guessed from output file extension.
168191 """
169192 if out_format is None and outputfile :
170193 # TODO #401/#449 don't guess/override format if there is already a save_result with format?
0 commit comments