Skip to content
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

jgrss/reorg #319

Open
wants to merge 27 commits into
base: main
Choose a base branch
from
Open

jgrss/reorg #319

wants to merge 27 commits into from

Conversation

jgrss
Copy link
Owner

@jgrss jgrss commented May 18, 2024

What is this PR changing?

Fixes open() height/width results following #311

@@ -40,18 +46,32 @@
logger = logging.getLogger(__name__)


def transform_from_corner(
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New helper method


return height, width
return window_from_bounds(*bounds, transform=transform)
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the main fix.


@check_chunks.register
def _(chunks: tuple) -> dict:
return dict(
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This addresses an Xarray deprecation warning.

@jgrss jgrss mentioned this pull request May 18, 2024
@jgrss
Copy link
Owner Author

jgrss commented May 18, 2024

@mmann1123 this addresses #311. I commented on the relevant changes.

@jgrss jgrss marked this pull request as ready for review May 18, 2024 05:41
@jgrss jgrss requested a review from mmann1123 May 18, 2024 05:41
Copy link
Collaborator

@mmann1123 mmann1123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, I added two comments.

  1. I was not totally clear that you meant by "scatter" in save. I think i'm guessing right but could be clearer.
  2. we should add STAC to the tutorials at some point.

mode (Optional[str]): The file storage mode. Choices are ['w', 'r+'].
nodata (Optional[float | int]): The 'no data' value. If ``None`` (default), the 'no data'
value is taken from the ``DataArray`` metadata.
scatter (Optional[str]): Scatter 'band' or 'time' to separate file. Default is None.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jgrss I am not sure what you mean here. Does it create a new file for each band?

@@ -208,7 +216,7 @@ def _download_worker(item, extra: str, out_path: _Path) -> dict:


def open_stac(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stack is still new to me but at some point we need to bring this into the tutorials in the docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants