Skip to content

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

Open
@soxofaan

Description

@soxofaan

@mbuchhorn pointed me to this snippet from doc:

job = s2_bands.create_job(
title="Sentinel2",
description="Sentinel-2 L2A bands",
out_format="netCDF",
sample_by_feature=True,
)

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:

def create_job(
self,
out_format: Optional[str] = None,
*,
title: Optional[str] = None,
description: Optional[str] = None,
plan: Optional[str] = None,
budget: Optional[float] = None,
job_options: Optional[dict] = None,
validate: Optional[bool] = None,
auto_add_save_result: bool = True,
# TODO: avoid `format_options` as keyword arguments
**format_options,

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions