holoviz / param

Param: Make your Python code clearer and more reliable by declaring Parameters
https://param.holoviz.org
BSD 3-Clause "New" or "Revised" License
409 stars 69 forks source link

xarray Dataset and other data science oriented parameters #381

Open poplarShift opened 4 years ago

poplarShift commented 4 years ago

I've been enjoying doing my data science pipelines with panel+param lately which makes workflows tidy and parameter sweeps a breeze. There already is a param.DataFrame, how about e.g. Dataset which would hold an xarray.Dataset?

jbednar commented 4 years ago

Sounds great! And presumably xarray.DataArray? The main work is just to figure out how to validate what's given (i.e. to express constraints on the dimensions/coordinates/types/etc), starting by copying param.DataFrame and adapting as needed. (If not for validation, of course, you can already use param.Parameter.) If you're interested in starting a PR, we would love to have it! And then maybe eventually we could adapt xrviz to display the Dataset or DataArray as a Panel.

ceball commented 4 years ago

In case it's useful (haven't investigated yet): traitlets related to numpy, pandas, and xarray: https://github.com/jupyter-widgets/traittypes/

poplarShift commented 4 years ago

traittypes looks interesting but doesn't seem to be checking a lot of the properties (dimensions, coordinates, ...) so I have not tried to use that for inspiration.

And then maybe eventually we could adapt xrviz to display the Dataset or DataArray as a Panel.

The new xarray html repr would be a great starting point for that