Skip to content

Initialize TypeScript NumPy-style core API for vector ops - #1

Draft
mrjf with Copilot wants to merge 2 commits into
mainfrom
copilot/typescript-port-of-numpy
Draft

Initialize TypeScript NumPy-style core API for vector ops#1
mrjf with Copilot wants to merge 2 commits into
mainfrom
copilot/typescript-port-of-numpy

Conversation

CopilotAI commented May 17, 2026

Copy link
Copy Markdown

This PR establishes numpst as a TypeScript implementation of core NumPy-like array/vector primitives. It introduces a small, typed baseline API for construction, elementwise math, and reductions.

  • TypeScript package scaffold

    • Added project setup (package.json, tsconfig.json) and build output typing/declarations.
    • Configured module entrypoints for compiled artifacts.
  • NumPy-style API surface

    • Added src/index.ts with:
      • Constructors: array, zeros, ones, arange
      • Elementwise ops: add, subtract, multiply, divide
      • Reductions: sum, mean
    • Included shape checks for binary vector ops and guardrails for invalid inputs (e.g., zero step, empty mean).
  • Docs and usage framing

    • Updated README with concise API list and project purpose.
    • Added .gitignore for generated/build dependency artifacts.
  • Focused behavior coverage

    • Added targeted tests for constructor helpers, vector arithmetic, and reductions.
import{arange,add,mean}from"numpst";constx=arange(5);// [0, 1, 2, 3, 4]consty=add([1,2],[3,4]);// [4, 6]constm=mean([1,2,3,4]);// 2.5
Original prompt

TypeScript port of NumPy

CopilotAI changed the title [WIP] Add TypeScript port of NumPyInitialize TypeScript NumPy-style core API for vector opsMay 17, 2026
CopilotAI requested a review from mrjfMay 17, 2026 21:41
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@mrjf