RFC: add `ravel()` (or `flatten()`)

Open
#658 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
numpy, python

Research direction

Review the RFC's discussion of ravel(), flatten(), and the existing reshape workaround. No files or tests are named, so first locate the standard's reshape specification and documentation, then determine whether the desired outcome is a new function or guidance for replacing NumPy functions; done means reaching and recording that decision.

Written by the indexing model from the issue text.

Description

API extension Needs Discussion RFC topic: Manipulation

Should we have a ravel() or flatten() function? Right now you can do it with reshape, but it's maybe not obvious. reshape also has the advantage in that it can be explicit about copying.

If not, I wonder if we should have some page or documentation somewhere to indicate the best workarounds for NumPy functions that aren't included in the standard, like "replace ravel(x) with reshape(x, (x.size,))".

Dominant language
Python
Stars
281
Forks
52
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from data-apis/array-api

All issues in data-apis/array-api

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.