chore: uv support - #282
Conversation
|
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
|
I recommend the |
|
|
Most of the import changes should be |
| @@ -446,9 +446,7 @@ | |||
| ], | |||
There was a problem hiding this comment.
Line #3. f"{RASTER_API_URL}/collections/{item['collection']}/items/{item['id']}/WebMercatorQuad/tilejson.json?&assets=cog_default&color_formula=gamma+r+1.05&colormap_name=viridis&rescale={rescale_values['min']},{rescale_values['max']}",
This requests.get was located inside a for item in items loop but didn't use item and therefore was printing the same URL x times.
Reply via ReviewNB
| @@ -114,517 +114,16 @@ | |||
| }, | |||
There was a problem hiding this comment.
Line #7. cluster = gateway.connect(clusters[0].name) if clusters else GatewayCluster(shutdown_on_close=True)
functionally the same as
if clusters: cluster = gateway.connect(clusters[0].name) else: cluster = GatewayCluster(shutdown_on_close=True)
Reply via ReviewNB
| @@ -683,12 +683,10 @@ | |||
| } | |||
There was a problem hiding this comment.
Several notebooks remove the pandas import as pd is not used when import pandas as pd
Reply via ReviewNB
| @@ -67,7 +67,7 @@ | |||
| }, | |||
There was a problem hiding this comment.
| @@ -93,21 +93,21 @@ | |||
| }, | |||
There was a problem hiding this comment.
Line #3. import contextlib
Main import change here. Uses contextlib in the case where there is a try / except -> pass
try: plt.colormaps.register(cmap_tornado) except ValueError: pass
with contextlib.suppress(ValueError): plt.colormaps.register(cmap_tornado)
Reply via ReviewNB
| @@ -56,26 +56,23 @@ | |||
| "outputs": [], | |||
There was a problem hiding this comment.
This is the only notebook I tried fixing, to no avail (it was previously broken and remains broken). I looked at the VEDA STAC catalog, and this collection did not have COG_DEFAULT variables for rescaling. Here, we're grabbing the render parameters from the listed collection.
Variables are now corrected, but it now seems to run into issues due to image sizes
Reply via ReviewNB
| @@ -81,8 +81,8 @@ | |||
| "import datetime as dt\n", | |||
There was a problem hiding this comment.
Line #6. for _page in range(10):
page was not used, so we preface the variable with an underscore to indicate that it doesn't matter
Reply via ReviewNB
| @@ -96,9 +96,7 @@ | |||
| "metadata": {}, | |||
There was a problem hiding this comment.
with ( fs.open(SOURCE_URI) as fileobj, xr.open_dataset(fileobj, engine="h5netcdf") as ds, ):
Only change here is combining the two context managers into one with - contents underneath got shifted left
Reply via ReviewNB
| @@ -75,29 +75,30 @@ | |||
| }, | |||
There was a problem hiding this comment.
One of the few install cells that isn't commented out - I've done this on MAAP docs before, but % is preferred to ! because % will guarantee installation in the kernel your notebook is running.
Reply via ReviewNB
| @@ -71,7 +71,8 @@ | |||
| "metadata": {}, | |||
There was a problem hiding this comment.
import UTC, functionally the same as the timezone import usage of timezone.utc
datetime.now(tz=timezone.utc) -> datetime.now(tz=UTC)
Reply via ReviewNB
There was a problem hiding this comment.
Noting it's unclear if an empty newline is a qmd format requirement.
There was a problem hiding this comment.
I haven't checked but I think that it applied it to every file. Does it affect qmd's?
There was a problem hiding this comment.
I'm not sure, we probably have to try building with quarto to see if it complains.
There was a problem hiding this comment.
I don't see anything glaring in the build at the top of this PR
| @@ -114,517 +114,16 @@ | |||
| }, | |||
There was a problem hiding this comment.
Line #4. clusters = gateway.list_clusters()
has to skip this cell but I've added back the import that was flagged as "unused". Looks like it was also missing rioxarray.
Reply via ReviewNB
| @@ -48,8 +48,8 @@ | |||
| "metadata": {}, | |||
There was a problem hiding this comment.
Line #5. "query": {"datetime": {"eq": "2021-01-01T00:00:00"}},
changing this to use the top-level datatime search since it no longer goes through query
Reply via ReviewNB
| @@ -67,7 +67,7 @@ | |||
| }, | |||
There was a problem hiding this comment.
| @@ -67,7 +67,7 @@ | |||
| }, | |||
There was a problem hiding this comment.
start_date = datetime.datetime(2022, 4, 1) end_date = datetime.datetime(2022, 5, 12)
this is a ton of data - I shortened the date range when testing
Reply via ReviewNB
| @@ -75,29 +75,30 @@ | |||
| }, | |||
There was a problem hiding this comment.
|
I completed another self-review where I ran all the notebooks on the veda hub. I've added back hvplot and rioxarray imports with a noqa tag. Fixed one STAC search cell and added a comment about EDL EULAs for another. |
|
@jjfrench if you finished testing the notebooks then I'm ok with the PR, but I think we need a @NASA-IMPACT/veda-data-services review of the publication notebooks. |
Description
90% of the PR is whitespace by ruff-pre-commit