Open-EO / openeo-processes-python

A Python representation of (most) openEO processes
Apache License 2.0
11 stars 4 forks source link

Fix tests #187

Closed ValentinaHutter closed 2 years ago

ValentinaHutter commented 2 years ago

Initial review for order process:

  • First things first: This process doesn't look like it's even defined for datacubes (only for arrays, the dimension parameter doesn't follow the spec!), so I don't think the behaviour for more than 1 dimension should be defined. I.e. along which dimension would the sort be done?
    • Also np.flip() only works if the process is only defined for 1D arrays, I think otherwise you'd have to flip the order within the specified dimensions
  • Given that, there are some more comments:

    • arrays.py: 1468: this loads the whole array into memory -
    • nodata doesn't seem to be treated correctly now, there's no distinction between nodata=True and nodata=False
    • Using xr_data_factor isn't really a good dataset to test the xarray implementation - the values are only 3 and 5 and testing only the time dimension doesn't catch much

Pasted image 20220725143251

    - I'd propose testing this by generating a random (1D) dataset, turning that into a 1D xarray so the `exec_xar` method gets called, and compare the result with the original data sorted with `np.argsort`

As the process is defined for arrays, so we now decided to skip the process for cubes.