stdlib-js / stdlib-js/stdlib

[RFC]: replace `copyView` in `ndarray/array/lib/copy_view.js` with `ndarray/copy`

Đang mở
#10,935 5 bình luận 0 reaction 0 người được giao Xem trên GitHub
difficulty: 2 Needs Discussion RFC
Ngôn ngữ chính
JavaScript
Star
6k
Fork
1.3k
Merge trung bình
1 ngày 3 giờ
Pull request đã merge (30 ngày)
611

Mô tả

**Description**

In `ndarray/array/lib/copy_view.js`, the `copyView` function manually creates an output buffer, constructs a plain ndarray-like
object, and uses `ndarray/base/assign` to copy data.

The function contains the following TODO comment:

```js
function copyView( arr, dtype ) { // TODO: consider replacing with `@stdlib/ndarray[/base]/copy` once created
```

Now that `ndarray/copy` exists, the manual logic can be replaced by importing `ndarray/copy`, removing the following unnecessary imports:

- `@stdlib/ndarray/base/assert/is-equal-data-type`
- `@stdlib/buffer/alloc-unsafe`
- `@stdlib/ndarray/base/buffer-ctors`
- `@stdlib/ndarray/order`
- `@stdlib/ndarray/base/numel`
- `@stdlib/ndarray/base/shape2strides`
- `@stdlib/ndarray/base/assign`
- `@stdlib/array/base/zeros`

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Start in ndarray/array/lib/copy_view.js and read the copyView function and its TODO. Replace the manual copying path with ndarray/copy, remove the listed unused imports, and confirm that copyView retains its existing behavior without those dependencies.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
javascript
Lĩnh vực
data
Loại issue
Tái cấu trúc
Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Đặc tả rõ ràng
Mức phù hợp với người mới
55/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.