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

Separate kwargs for Opening a Grid File in Open Dataset #390

Merged
merged 10 commits into from
Jul 20, 2023

Conversation

philipc2
Copy link
Member

@philipc2 philipc2 commented Jul 19, 2023

Closes #386

Overview

  • Introduces a new argument (grid_kwargs) to ux.open_dataset and ux.open_mfdataset which allows the user to specify a dictionary of key word arguments that are used when opening up a Grid dataset in ux.open_grid

Expected Usage

import uxarray as ux

grid_path = "/path/to/grid.nc"
data_path = "/path/to/data.nc"
uxds = ux.open_dataset(grid_path, data_path, grid_kwargs={"drop_variables": "Mesh2_face_nodes"})

PR Checklist

General

  • An issue is linked created and linked
  • Add appropriate labels
  • Filled out Overview and Expected Usage (if applicable) sections

Testing

  • Adequate tests are created if there is new functionality
  • Tests cover all possible logical paths in your function
  • Tests are not too basic (such as simply calling a function and nothing else)

Documentation

  • Docstrings have been added to all new functions
  • Docstrings have updated with any function changes

@rajeeja
Copy link
Contributor

rajeeja commented Jul 19, 2023

A test case with example dropping certain columns would be useful. As it will excercise this option also.

@philipc2
Copy link
Member Author

A test case with example dropping certain columns would be useful. As it will excercise this option also.

That's the plan!

@philipc2 philipc2 changed the title DRAFT: Separate kwargs for Opening a Grid File in Open Dataset Separate kwargs for Opening a Grid File in Open Dataset Jul 20, 2023
@philipc2 philipc2 marked this pull request as ready for review July 20, 2023 20:35
Copy link
Member

@aaronzedwick aaronzedwick 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 from what I can see!

Copy link
Collaborator

@ifranda ifranda 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 to me!

@philipc2 philipc2 merged commit 23a9346 into main Jul 20, 2023
@erogluorhan erogluorhan deleted the philipc2/grid-kwargs branch August 11, 2023 16:09
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.

Add additional **kwargs for opening a grid file with ux.open_dataset
5 participants