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

Xarray integration #705

Open
1 of 3 tasks
cosmicBboy opened this issue Dec 11, 2021 · 1 comment
Open
1 of 3 tasks

Xarray integration #705

cosmicBboy opened this issue Dec 11, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@cosmicBboy
Copy link
Collaborator

cosmicBboy commented Dec 11, 2021

Is your feature request related to a problem? Please describe.

xarray is a project that provides a dict-like data container abstraction for ndimensional arrays. It shares some commonalities with pandas, but there many key differences (e.g. coords and attrs).

After chatting with @jhamman about this approach, we decided it would be appropriate to park xarray-schema within the pandera codebase. This issue tracks the planned integration of xarray-schema into the pandera codebase.

Describe the solution you'd like

A good start for this integration is to add a pandera.xarray module exposing the schema and schema component classes specific to xarray:

import numpy as np
import xarray as xr
from pandera.xarray import DataArraySchema, DatasetSchema

da = xr.DataArray(np.ones(4, dtype='i4'), dims=['x'], name='foo')

schema = DataArraySchema(dtype=np.integer, name='foo', shape=(4, ), dims=['x'])

schema.validate(da)

TODO

Describe alternatives you've considered

The main alternative to this integration is to keep xarray-schema as a separate project that's interoperable with pandera. However, given that pandera plans on expanding its scope to validate data containers beyond pandas, it would benefit this project to maintain schema interfaces for multiple (not just pandas-like) data container libraries.

Additional context

@leroyvn
Copy link

leroyvn commented Oct 13, 2023

Hi, I've been looking for an xarray validation library for a while now and I was wondering: is integration in Pandera still planned? Thanks!

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

No branches or pull requests

2 participants