Skip to content

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

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

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

Conversation

Copy link
Copy Markdown

Copilot AI commented May 17, 2026

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";

const x = arange(5);          // [0, 1, 2, 3, 4]
const y = add([1, 2], [3, 4]); // [4, 6]
const m = mean([1, 2, 3, 4]);  // 2.5
Original prompt

TypeScript port of NumPy

Copilot AI changed the title [WIP] Add TypeScript port of NumPy Initialize TypeScript NumPy-style core API for vector ops May 17, 2026
Copilot finished work on behalf of mrjf May 17, 2026 21:41
Copilot AI requested a review from mrjf May 17, 2026 21:41
Sign up for free to 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