Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

`scipy.spatial.transform.Rotation` Integration

オープン
#392 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
python
領域
data

調査の方向性

再現された scipy.spatial.transform.Rotation.apply 呼び出しから始め、VectorObject3D と VectorNumpy3D のインターフェースを調べます。直接の Rotation 入力と、動作する配列リスト入力を比較し、完了条件を、両方のベクトル形式で Rotation インスタンスが受け入れられ、示された回転が期待される結果を生成することと定義します。

索引モデルが issue の本文から書いたものです。

説明

feature
Vector Version

1.1.1.post1

Python Version

3.10.9

OS / Environment

OS: KAli Linux 2023.3
Environment: scipy==1.11.1

Describe the bug

First of all thanks for the awesome work on the library

there are some errors with Rotation.apply

these are some ways to reproduce

from scipy.spatial.transform import Rotation
from vector import VectorObject3D, VectorNumpy3D

v_object = VectorObject3D(x=1, y=0, z=0)
v_array = VectorNumpy3D({"x": [1], "y": [0], "z": [0]})
r = Rotation.from_quat((0, 0, 1, 1))

# _r = r.as_quat()
# print(v.rotate_quaternion(_r[3], _r[0], _r[1], _r[2]))
# Returns: VectorObject3D(x=0.0, y=0.9999999999999998, z=0.0)

# print(r.apply(v_object))  # Raises: IndexError(tuple index out of range)
print(r.apply(v_object.__array__().tolist()))
# Returns: [0. 1. 0.]

# print(r.apply(v_array))  # Raises: ValueError(Expected input of shape (3,) or (P, 3), got (1,).)
print(r.apply(v_array.tolist()))
# Returns: [[0. 1. 0.]]

I think it would be a good idea to add rotate method to Vector that accepts the Rotation instance as input and applies the rotation on Vector

from scipy.spatial.transform import Rotation

def rotate(self, rot: Rotation):
    pass
Any additional but relevant log output

No response

主要言語
Python
スター
101
フォーク
43
平均マージ
3時間 38分
マージ済み PR(30日)
7

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

scikit-hep/vector のほかの issue

scikit-hep/vector の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。