openeo-python-client icon indicating copy to clipboard operation
openeo-python-client copied to clipboard

Eliminate confusing job option and format option handling in `create_job` (and related)

Open soxofaan opened this issue 1 year ago • 4 comments

@mbuchhorn pointed me to this snippet from doc: https://github.com/Open-EO/openeo-python-client/blob/7c321be49bcf6f1dbd091f5f4f4ea1c0163ed7e5/docs/cookbook/sampling.md?plain=1#L37-L42

I find this extremely confusing: the sample_by_feature looks like a job option this way, while the kwargs will be passed as format option: https://github.com/Open-EO/openeo-python-client/blob/7c321be49bcf6f1dbd091f5f4f4ea1c0163ed7e5/openeo/rest/datacube.py#L2411-L2423

Note that there is a dedicated argument job_options for the job options, but the kwargs argument goes to format options, which is an optional feature here actually. I think we should get rid of this backwards argument handling

soxofaan avatar Oct 24 '24 07:10 soxofaan

Same problem with:

  • DataCube.create_job(..., **format_options)
  • DataCube.execute_batch(..., **format_options)
  • VectorCube.create_job(..., **format_options)
  • VectorCube.execute_batch(..., **format_options)

soxofaan avatar Oct 24 '24 07:10 soxofaan

I had the same problem yesterday where I tried to pass a title to execute_batch but it treated it as a format option. I believe I got an error back so I changed it to create_job.

bossie avatar Oct 24 '24 14:10 bossie

I had the same problem yesterday where I tried to pass a title to execute_batch but it treated it as a format option. I believe I got an error back so I changed it to create_job.

aargh same here: I was looking into CDSE integration tests that uses cube.execute_batch(title=... and couldn't understand why the tile was not showing up in the job registry

soxofaan avatar Oct 30 '24 12:10 soxofaan

aargh same here: I was looking into CDSE integration tests that uses cube.execute_batch(title=... and couldn't understand why the tile was not showing up in the job registry

fixed with #652

soxofaan avatar Oct 31 '24 14:10 soxofaan