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

Added feature in weather-mv to extract specific date's data from zarr files. #396

Merged
merged 8 commits into from
Sep 23, 2023

Conversation

dabhicusp
Copy link
Collaborator

I have added a feature in weather-mv which can allows users to access data for a specific date from Zarr files. In the existing codebase user have no choice for working with some chunks of the zarr file so user have to work with whole zarr file every time.
One use-case: If user want to ingest specific date's data from the zarr file to BQ then he/she can do this using of this code.

Comment on lines 414 to 416
start_date = open_dataset_kwargs['start_date']
if open_dataset_kwargs is not None:
open_dataset_kwargs.pop('start_date', None)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
start_date = open_dataset_kwargs['start_date']
if open_dataset_kwargs is not None:
open_dataset_kwargs.pop('start_date', None)
start_date = open_dataset_kwargs.pop('start_date', None)

Copy link
Collaborator Author

@dabhicusp dabhicusp Sep 19, 2023

Choose a reason for hiding this comment

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

Hi @alxmrs, it's important to ensure that a open_dataset_kwargs is dictionary or not before using the pop operation directly on it. As in the code on this line mentioned that it is a optional value & default value of it is None.

Copy link
Collaborator

@mahrsee1997 mahrsee1997 left a comment

Choose a reason for hiding this comment

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

LGTM.

Copy link
Collaborator

@alxmrs alxmrs left a comment

Choose a reason for hiding this comment

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

Perfect, change looks great!

@mahrsee1997 mahrsee1997 merged commit 8579907 into main Sep 23, 2023
7 checks passed
@mahrsee1997 mahrsee1997 deleted the zarr_update branch September 23, 2023 05:31
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.

3 participants