-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
localprocessing updates #434
Conversation
Code now parsing correctly band names for geoTIFFs if are present and set them in the metadata.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some quick notes
"tags": [] | ||
}, | ||
"source": [ | ||
"<img src=\"https://avatars.githubusercontent.com/u/74911464?s=200&v=4\"\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not to be fixed in this PR, but I noticed that this logo looks quite ragged. I think we should host a proper version of the logo somewhere
"id": "51a9e53a-481c-4ea5-a175-652d6398828d", | ||
"metadata": {}, | ||
"source": [ | ||
"To use this functionality, you need `3.9<=Python<3.11`.\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why this <3.11
constraint?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comes from here: https://github.com/Open-EO/openeo-processes-dask/blob/6563c1809fc4108581b78763a970b3bea1d5d935/pyproject.toml#L25
@LukeWeidenwalker how could I help to test more Python versions? It would be good to add 3.11 at least.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I initially set up the repo, I put 3.9, 3.10 and 3.11 in the CI matrix for github actions. 3.11 failed for a reason that I can't recall now, and since our backend runs on 3.9, I've just ignored it since. Would be in favor of becoming 3.11 compatible though! I'd start by including 3.11 in the matrix here: https://github.com/Open-EO/openeo-processes-dask/blob/main/.github/workflows/main.yml in a new PR and just seeing what breaks. Once the build passes, we can remove this constraint!
examples/notebooks/Client_Side_Processing/client_side_processing_color_composites.ipynb
Show resolved
Hide resolved
openeo/local/processing.py
Outdated
_log.debug(f"kwargs: {pretty_args}") | ||
_log.debug("-" * 80) | ||
|
||
methods_list = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't call a dictionary a list, that's quite confusing
also: where do these int values come from, is that ad-hoc, or is that defined somewhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They come from the rioxarray - rasterio docs:
https://corteva.github.io/rioxarray/stable/rioxarray.html#rioxarray.raster_array.RasterArray.reproject_match
https://rasterio.readthedocs.io/en/stable/api/rasterio.enums.html#id0
Should I include the link in the code as a comment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would then use the enum attributes directly, something like
"near": rasterio.enums.Resampling.nearest
...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also note that that rasterio enum can handle the mapping itself, so I don't think you need your own:
>>> import rasterio.enums
>>> rasterio.enums.Resampling(5)
<Resampling.average: 5>
>>> rasterio.enums.Resampling(4).name
'lanczos'
>>> rasterio.enums.Resampling["gauss"].value
7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I created this mapping since in openEO we have "near" instead of "nearest" and "cubicspline" instead of "cubic_spline"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
then I would just translate these minor differences, but let rasterio.enums.Resampling
do the heavy lifting, e.g.
method = {
"near": "nearest",
"cubicspline": "cubic_spline"
}.get(method, method)
try:
resampling = rasterio.enums.Resampling[method]
except KeyError:
ValueError(
f'Selected resampling method not available.... select one of {[r.name for r in rasterio.enums.Resampling]}" ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fine. However, if we raise that ValueError, we would list nearest and cubic_spline as allowed resampling methods, that if used in a process graph would make it invalid if there's some validation mechanism in place.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@soxofaan I think that this is the last point open before being able to merge. Can we agree on my latest version?
Co-authored-by: Stefaan Lippens <soxofaan@users.noreply.github.com>
merged (FYI did some post-merge cleanups in fbf69e6 , including removal of unused |
This PR contains: