Support for .multi_slice_axis_mut and .multi_slice_axis_move

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

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

評価

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

調査の方向性

Start by reading the existing multi_slice_mut and slice_axis_mut APIs, which the issue identifies as the relevant precedents. Trace how their returned views and axis handling work, then define the corresponding behavior for multi_slice_axis_mut and multi_slice_axis_move. Done means the shown Axis(0) example is supported with the expected four views.

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

説明

enhancement

From #775:

We should add multi_slice_axis_mut and multi_slice_axis_move methods, in the same way that slice_axis_mut is analogous to slice_mut.

Are the methods multi_slice_axis_mut and multi_slice_axis_move still desired? I was looking for such functionality. If so, based on multi_slice_mut, is my understanding correct in that these two methods would make the following possible?

let mut example = array![
   [0, 0, 0],
   [0, 0, 0],
   [1, 2, 3],
   [4, 5, 6],
   [7, 8, 9],
   [0, 0, 0],
   [0, 0, 0],
];

let (mut pad_lo, mut pad_hi, mut edge_lo, mut edge_hi) =
    example.multi_slice_axis_mut(Axis(0), (s![..2], s![5..], s![2], s![4]));
// pad_lo:  [ [ 0, 0, 0 ],
//            [ 0, 0, 0 ] ]
// pad_hi:  [ [ 0, 0, 0 ],
//            [ 0, 0, 0 ] ]
// edge_lo: [ [ 1, 2, 3 ] ] 
// edge_hi: [ [ 7, 8, 9 ] ]

Although I'm still learning a lot about Rust, I would love to give implementing it a try, if the functionality is still on the to-do list.

It'd also come in handy for the ndarray-pad crate I'm working on!


I moved this into its own separate issue to not clutter the mentioned issue.

主要言語
Rust
スター
4.3k
フォーク
391
PR マージ指標
30日以内にマージされた PR はありません

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

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

rust-ndarray/ndarray のほかの issue

rust-ndarray/ndarray の issue をすべて見る

似ている issue

Rust の issue をもっと見る

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

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