Allow Custom Indexes to define HTML repr for managed coords

未关闭
#11,018 4 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
30/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
停滞
技术栈
pandas, python
领域
data, frontend

调研方向

首先跟踪 Dataset reprs 如何为受管理的 coords 组合 HTML,然后比较现有的 xarray 和 pandas MultiIndex 表示。该 issue 的目标是提供一个 Index 级别的 HTML repr,使 Dataset 能够为其受管理的 coords 进行组合;完成的标准是自定义索引可以减少过多的坐标输出,同时保留有用的信息。

由索引模型根据 Issue 内容生成。

描述

enhancement
Is your feature request related to a problem?

When a complicated index is attached to a dataset it can potentially fill up the coords field with lots of extra low value information. For example for the builtin multiindex the xarray version looks like this:

Image

which is lower signal to noise than the equivalent pandas repr:

Image

or in the case of layered intervals annotating a dimension (https://ianhuntisaak.com/xarray-linked-indexes/) the coords can really get out of hand

Image
Describe the solution you'd like

Allow Indexes to override the default html repr for any coords that they manage. The dataset repr can compose itself out of the reprs for coords from coords, so the would be in charge of returing the html +/- css for those coords

I think the built in multindex could be a nice example use case of this.

Describe alternatives you've considered

No response

Additional context

No response

cc @benbovy @keewis @dcherian

主要语言
Python
星标
4.2k
派生
1.5k
平均合并
2 天 20 小时
30 天内合并 PR
70

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

pydata/xarray 的其他 Issue

查看 pydata/xarray 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。