Convert vertices to bounds for nD arrays
まだ誰も着手していません。
評価
調査の方向性
Start with cf_xarray/helpers.py and the vertices_to_bounds entry point shown in the traceback. Reproduce the supplied nD DataArray example and compare it with the working single-profile call. Done means the full array with x, y, time, and test dimensions is accepted and converted into the requested bnds and test bounds.
索引モデルが issue の本文から書いたものです。
説明
Thank you for developing this amazing package, I am only slowly appreciating its full amazingness.
I am currently trying to convert an array of layer depths that varies in time and space, which represent cell vertices in the vertical into a bound style array.
This is my original array lev_vertices:

For a minimal example you can create a similar array with:
lev_vertices = xr.DataArray(np.arange(9), dims='test').expand_dims(x=2,y=2, time=2)
lev_vertices
I would like to convert the dimension test into bounds.
This works as expected when operating on a single profile:
cf_xarray.vertices_to_bounds(
lev_bounds.isel(time=0,x=0, y=0).load(), out_dims=["bnds", "test"]
)

But I cant figure out how to make this work on the full array...
cf_xarray.vertices_to_bounds(
lev_vertices.load(), out_dims=["bnds", "test"]
)
gives
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-76-4487305bbcdc> in <module>
----> 1 cf_xarray.vertices_to_bounds(
2 lev_vertices.load(), out_dims=["bnds", "test"]
3 )
/scratch/gpfs/jbusecke/conda_tigercpu/envs/aguadv_omz_busecke_2021/lib/python3.8/site-packages/cf_xarray/helpers.py in vertices_to_bounds(vertices, out_dims)
116 )
117 else:
--> 118 raise ValueError(
119 f"vertices format not understood. Got {vertices.dims} with shape {vertices.shape}."
120 )
ValueError: vertices format not understood. Got ('x', 'y', 'time', 'test') with shape (2, 2, 2, 9).
I am wondering if I am missing an option to ignore dimensions here? I was thinking of using xr.map_blocks, but that would impose restrictions on my chunking (which might affect performance). So I first wanted to check in here, and see if there is an easy fix.
- 主要言語
- Python
- スター
- 181
- フォーク
- 51
- 平均マージ
- 6時間 39分
- マージ済み PR(30日)
- 1
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
xarray-contrib/cf-xarray のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
xarray-contrib/cf-xarray#623 ·
-
Consider adding opt-in support for circular axes when calling `bounds_to_vertices` (related to #594)オープン
難易度 5/5 1週間以上 初心者へのやさしさ 38/100
xarray-contrib/cf-xarray#596 · コメント 1 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 25/100
xarray-contrib/cf-xarray#570 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 15/100
xarray-contrib/cf-xarray#568 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
xarray-contrib/cf-xarray#566 · コメント 2 件 ·
xarray-contrib/cf-xarray の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
NousResearch/hermes-agent#136483 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信
-
[BUG] LazyStackedTensorDictStore zeroes the last byte of a new key set on the last element対応中かも @peterdsharpe が今日担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
pytorch/tensordict#2307 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
GrokModel.generate/a_generate pass an OpenAI-style list-of-dicts to xai_sdk.chat.user(), so every call crashes with a protobuf TypeError before any network I/O対応中かも @Christian-Sidak が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
confident-ai/deepeval#3436 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信