home / github / issue_comments

Menu
  • Search all tables
  • GraphQL API

issue_comments: 524520588

This data as json

html_url issue_url id node_id user created_at updated_at author_association body reactions performed_via_github_app issue
https://github.com/pydata/xarray/issues/525#issuecomment-524520588 https://api.github.com/repos/pydata/xarray/issues/525 524520588 MDEyOklzc3VlQ29tbWVudDUyNDUyMDU4OA== 1217238 2019-08-24T05:01:54Z 2019-08-24T05:01:54Z MEMBER

For the general xarray method, I think we would probably want something like DataArray.units_convert or DataArray.units_to. Or potentially this could use an accessor, e.g., DataArray.pint.to (which will always be a fallback option).

For the Dataset repr, it would probably be nice to print the units along with some of the array values. So yes, this could probably use some custom logic for recognizing quantity types, among other duck array types. If the number of distinct array types starts to get burdensomely large, we could expose an interface for registering new ones, e.g., xarray.register_inline_array_repr(array_type, inline_repr).

For rolling out a new units attribute and/or IO integration, we will need to be careful to preserve backwards compatibility for now (at least with a warning). I’m sure there is lots of code that expects array.attrs to be a string attribute today, so we should consider our options carefully before breaking all that code. The conservative choice would be to keep existing uses working for now unchanged (as a fallback), and save breaking changes for later once we are confident we know the right solution.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  100295585
Powered by Datasette · Queries took 0.788ms · About: xarray-datasette