Skip to content

Conversation

@headlessNode
Copy link
Member

Resolves stdlib-js/metr-issue-tracker#116.

Description

What is the purpose of this pull request?

This pull request:

  • add ndarray/concat1d

Related Issues

Does this pull request have any related issues?

This pull request has the following related issues:

Questions

Any questions for reviewers of this pull request?

No.

Other

Any other information relevant to this pull request? This may include screenshots, references, and/or implementation notes.

No.

Checklist

Please ensure the following tasks are completed before submitting this pull request.

AI Assistance

When authoring the changes proposed in this PR, did you use any kind of AI assistance?

  • Yes
  • No

If you answered "yes" above, how did you use AI assistance?

  • Code generation (e.g., when writing an implementation or fixing a bug)
  • Test/benchmark generation
  • Documentation (including examples)
  • Research and understanding

Disclosure

If you answered "yes" to using AI assistance, please provide a short disclosure indicating how you used AI assistance. This helps reviewers determine how much scrutiny to apply when reviewing your contribution. Example disclosures: "This PR was written primarily by Claude Code." or "I consulted ChatGPT to understand the codebase, but the proposed changes were fully authored manually by myself.".

{{TODO: add disclosure if applicable}}


@stdlib-js/reviewers

@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label Nov 23, 2025
@headlessNode headlessNode added Feature Issue or pull request for adding a new feature. and removed Needs Review A pull request which needs code review. labels Nov 23, 2025
@stdlib-bot
Copy link
Contributor

stdlib-bot commented Nov 23, 2025

Coverage Report

Package Statements Branches Functions Lines
ndarray/concat1d $\color{red}498/505$
$color{green}+98.61%$
$\color{red}63/66$
$color{green}+95.45%$
$\color{green}6/6$
$color{green}+100.00%$
$\color{red}498/505$
$color{green}+98.61%$

The above coverage report was generated for the changes in this PR.

@headlessNode headlessNode marked this pull request as draft November 23, 2025 08:07
@headlessNode headlessNode marked this pull request as ready for review November 23, 2025 08:24
@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label Nov 23, 2025
@headlessNode headlessNode requested a review from kgryte November 23, 2025 08:24
if ( arrs.length >= 1 ) {
dt = resolveDataTypes( arrs );
ord = resolveOrder( arrs );
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
}
} else {
dt = DEFAULT_DTYPE;
ord = DEFAULT_ORDER;
}

Comment on lines +118 to +119
} else if ( !dt && !ord ) {
args[ i ] = broadcastScalar( args[ i ], DEFAULT_DTYPE, [ 1 ], DEFAULT_ORDER ); // eslint-disable-line max-len
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
} else if ( !dt && !ord ) {
args[ i ] = broadcastScalar( args[ i ], DEFAULT_DTYPE, [ 1 ], DEFAULT_ORDER ); // eslint-disable-line max-len

This branch doesn't seem to be necessary if you resolve defaults above in the case where only scalars have been provided.

args[ i ] = broadcastScalar( args[ i ], dt, [ 1 ], ord );
}
}
return concat( normalizeArrays( args ) );
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are you "normalizing" arrays here? Not clear why this is necessary.

@kgryte kgryte added Needs Changes Pull request which needs changes before being merged. and removed Needs Review A pull request which needs code review. labels Nov 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature Issue or pull request for adding a new feature. Needs Changes Pull request which needs changes before being merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[RFC]: add ndarray/concat1d

3 participants