Issue with vertcross function when using Fortran-order data from .npy files
まだ誰も着手していません。
評価
調査の方向性
vertcrossのエントリーポイントから開始し、np.loadで読み込んだFortran-orderのデータを使って報告されたValueErrorを再現します。その動作をnp.ascontiguousarray(vorticity)と比較します。完了の条件は、vertcrossが入力を正しく処理するか、データの順序に関する要件を明確に文書化して報告することです。
索引モデルが issue の本文から書いたものです。
説明
I encountered an issue when using the vertcross function from the wrf-python package to perform vertical interpolation on data stored in a .npy file. Specifically, when I load the .npy file , the data is stored in Fortran-order (column-major) format by default.
The vertcross function seems to require C-order (row-major) data storage format to work correctly. When passing Fortran-order data, I received a ValueError: invalid shape for argument 1 (got (38,), expected (360,)), which suggests a misinterpretation of the data shape due to the storage format mismatch.
Steps to Reproduce:
-
Load vorticity data counted by wrfout (e.g., vorticity) from a
.npyfile:vorticity = np.load("vorticity.npy") -
Attempt to use vertcross to perform vertical interpolation:
vs_cross = vertcross(vorticity, z, ...) -
Encounter the error: ValueError: invalid shape for argument 1 (got (38,), expected (360,))
The vertcross function should work correctly when the data is in Fortran-order (which is the default when reading .npy files). If the function requires C-order, it would be helpful to include a clear message in the documentation or provide an automatic conversion inside the function.
solution:
Manually converting the data to C-order format using np.ascontiguousarray() resolves the issue:
vorticity = np.ascontiguousarray(vorticity)
vs_cross = vertcross(vorticity, z, ...)
It would be helpful if the vertcross function could automatically handle Fortran-order data or provide better error handling or documentation related to data format expectations.
- 主要言語
- Python
- スター
- 498
- フォーク
- 178
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
NCAR/wrf-python のほかの issue
-
NCAR/wrf-python#309 · 担当者 1 名 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 38/100
NCAR/wrf-python#307 · コメント 5 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
NCAR/wrf-python#286 · コメント 3 件 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
NCAR/wrf-python#282 · コメント 1 件 ·
-
PyPI releases オープン
NCAR/wrf-python#274 · コメント 5 件 · リアクション 1 件 · 担当者 1 名 ·
NCAR/wrf-python の issue をすべて見る
似ている issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
stephrobert/dsoxlab#238 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
sublimehq/package_control#1780 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
nwg-piotr/nwg-displays#145 ·