Skip to content

Remove Dove Classic from Harmonization tool #824

Closed
@kevinlacaille

Description

@kevinlacaille

Is your feature request related to a problem? Please describe.
Similar to PR #780, the OpenAPI spec has changed once again for the Harmonization Tool.

Our SDK allows data harmonization with Dove Classic, and Sentinel-2, however the openAPI spec has removed the Dove Classic option.

Describe the solution you'd like
Current harmonization tool:

def harmonize_tool(target_sensor: str) -> dict:
    '''Create the API spec representation of a harmonize tool.

    Currently, only "PS2" (Dove Classic) and "Sentinel-2" are supported as
    target sensors. The Sentinel-2 target only harmonizes PSScene
    surface reflectance bundle types (analytic_8b_sr_udm2, analytic_sr_udm2).
    The PS2 target only works on analytic bundles from Dove-R (PS2.SD).
    '''

    return _tool('harmonize', {'target_sensor': target_sensor})

Proposed solution:

Either we keep the function the same, but change the docstring, or we go back to the original function definition, but change the docstring.

def harmonize_tool() -> dict:
    '''Create the API spec representation of a harmonize tool.

    Currently, only "Sentinel-2" is supported as a target sensor. 
    The Sentinel-2 target only harmonizes PSScene surface reflectance bundle types 
    (analytic_8b_sr_udm2, analytic_sr_udm2). it will transform only items captured by “PS2.SD” (Dove-R).
    '''
    return _tool('harmonize', {'target_sensor': 'Sentinel-2'})

I suggest we keep the function the same, but change the docstring. This will be more flexible for future target sensors. This way we also won't have to change the tests in tests/unit/test_order_request.py.

I also suggest adding a test for hamonization in tests/unit/test_order_request.py:

@pytest.mark.parametrize("target_sensor", ["PS2", "Sentinel-2"])
def test_harmonization_tool(target_sensor):
    ht = order_request.harmonize_tool(target_sensor)
    expected = {'harmonize': {'target_sensor': target_sensor}}
    assert ht == expected

Lastly, I suggest whoever tackles this ticket also incorporate #793 :)

Describe alternatives you've considered

Additional context
We need something to check the openAPI spec so these surprises can stop happening :)

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