lightnumpy

A lightweight version of NumPy or Cupy (or similar functionality).

https://github.com/scikit-plots/lightnumpy

Science Score: 31.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (15.5%) to scientific vocabulary

Keywords

cupy lightnumpy numcpp numpy python
Last synced: 6 months ago · JSON representation ·

Repository

A lightweight version of NumPy or Cupy (or similar functionality).

Basic Info
Statistics
  • Stars: 0
  • Watchers: 0
  • Forks: 1
  • Open Issues: 0
  • Releases: 0
Topics
cupy lightnumpy numcpp numpy python
Created about 1 year ago · Last pushed 11 months ago
Metadata Files
Readme Contributing Funding License Code of conduct Citation Security

README.md

LightNumPy

Lightweight and Fast Numerical Computing Library for Python

A lightweight version of NumPy or Cupy (or similar functionality).

Install|Try LightNumPy - Doc: https://scikit-plots.github.io/dev/devel/index.html

User Installation:

Installing from source (REQUIRED OS/LIB BUILD PACKAGES)

You can also install lightnumpy from source if you want to take advantage of the latest changes: ```sh

Forked repo: https://github.com/scikit-plots/lightnumpy.git

git clone https://github.com/YOUR-USER-NAME/lightnumpy.git cd lightnumpy

bash docker/script/safe_dirs.sh # add safe directories for git git submodule update --init # download submodules

pip install -r ./requirements/all.txt

pip install -r ./requirements/build.txt pip install --no-build-isolation --no-cache-dir -e . -v ```

It is also possible to include optional dependencies:

```sh

(Optionally) Try Development [dev,build,test,docs,gpu]

gpu refer NVIDIA CUDA support like cupy lib

python -m pip install --no-build-isolation --no-cache-dir -e .[dev,build,test,docs] -v

gpu refer NVIDIA CUDA support like cupy lib

pip install "lightnumpy[gpu]"

```

Installing using pip

The easiest way to set up LightNumPy is to install it using pip with the following command:

  • by pypi: sh pip install lightnumpy -U

  • by GITHUB use <branches> or <tags> If any:

    • Branches: bash #pip install git+https://github.com/scikit-plots/scikit-plots.git@<branches> # Latest in Development with C,Cpp,Fortran Support pip install git+https://github.com/scikit-plots/lightnumpy.git@main pip install git+https://github.com/scikit-plots/lightnumpy.git@maintenance/0.0.x
    • Tags: bash #pip install git+https://github.com/scikit-plots/scikit-plots.git@<tags> pip install git+https://github.com/scikit-plots/lightnumpy.git@v0.0.x

Why LightNumPy?

  • Performance-Driven: Optimized for both CPU and hardware accelerators (GPU/TPU).
  • Focused: Includes essential features without unnecessary overhead.
  • Adaptable: Modular structure for customized extensions.
  • Scalable: Ideal for IoT, embedded systems, and resource-limited devices.

See Also

  • [1] https://scikit-plots.github.io/stable/api/scikitplot.numcppapi.html

- [2] https://github.com/dpilger26/NumCpp

LightNumPy Project Structure

sh lightnumpy/ │ ├── lightnumpy/ # Core library source code │ ├── __init__.py # Main package initializer │ ├── .clang-format # Code formatting rules for C/C++, code formatting rules like braces placement, and spacing. │ ├── .clang-tidy # Code linting rules for C/C++, code analysis, warnings, and bug detection. │ ├── _core/ # Low-level C and Higher-level C++ implementation sources │ │ ├── include/ # C and C++ headers │ │ │ ├── lightnumpy # lightnumpy core C and C++ headers │ │ │ └── NumCpp # NumCpp Headers [2] immutable │ │ └── src/ # C and C++ source files │ │ ├── dummymodule.c # Sample Module │ │ ├── hello.c # Print and string operations │ │ └── nc_version.cpp # NumCpp Headers versions │ ├── _gpu_core/ # GPU operations │ │ ├── include/ # GPU headers │ │ │ ├── lightnumpy # lightnumpy gpu core C and C++ headers as .cuh │ │ │ └── numC++ # numC++ Headers │ │ └── src/ # GPU source files │ │ ├── gpu_ops.cu # CUDA implementations │ │ └── cuda_helpers.cu # CUDA utility functions │ ├── _tpu_core/ # TPU operations │ │ ├── include/ # TPU headers │ │ │ ├── tpu_ops.hpp # TPU operation definitions │ │ │ └── tpu_helpers.hpp # TPU helper utilities │ │ └── src/ # TPU source files │ │ ├── tpu_ops.cpp # TPU operation implementations (via XLA) │ │ └── tpu_helpers.cpp # TPU utility functions │ ├── cy_bindings/ # Cython implementation, Cython bridging native libraries with Python APIs │ │ ├── __init__.py # Initialize the cython package │ │ ├── include/ # Cython Headers │ │ └── src/ # Cython Source files │ │ └── cython_helpers.pxd # Shared Cython declarations (optional) │ ├── py_bindings/ # Bindings for Python and native code, pybind11 bridging native libraries with Python APIs │ │ ├── include/ # pybind11 Headers │ │ └── src/ # pybind11 Source files │ │ ├── py_math.cpp # Element-wise operations │ │ ├── py_nc_random # Random array functionality pybind11 with NumCpp │ │ └── pybind_utils.cpp # Helper functions for bindings │ ├── python_api/ # Pure Python layer providing user-friendly interfaces for core functionality │ │ ├── __init__.py # API entry point for `python_api` │ │ ├── _utils_impl.py # get_include for lightnumpy library's C and C++ _core Headers with NumCpp Headers [2] │ │ ├── array.py # Array class implementation and basic methods │ │ ├── core.py # Contains core array functionality │ │ ├── linalg.py # Basic linear algebra operations (e.g., dot, transpose) │ │ ├── operations.py # Element-wise operations (e.g., addition, multiplication) (CPU, GPU, TPU) │ │ ├── gpu_operations.py # GPU-specific Python operations │ │ ├── tpu_operations.py # TPU-specific Python operations │ │ └── utils.py # Utility functions for array manipulation │ └── tests/ # Core library tests │ ├── test_array.py # Test for array module │ ├── test_tensor.py # Test for tensor module │ ├── test_gpu_ops.py # Test for GPU operations │ ├── test_tpu_ops.py # Test for TPU operations │ ├── test_cython_array.py # Test for Cython array implementation │ └── test_cython_utils.py # Test for Cython utility functions │ ├── examples/ # Example usage and demos │ ├── array_example.py # Example for arrays │ ├── tensor_example.py # Example for tensors │ ├── gpu_example.py # Example for GPU operations │ └── tpu_example.py # Example for TPU operations │ ├── docs/ # Documentation │ ├── index.md # Documentation index │ ├── api/ # API reference │ │ ├── gpu_api.md # GPU API documentation │ │ └── tpu_api.md # TPU API documentation │ └── developer_guide.md # Developer setup and guide │ ├── .github/ # CI/CD configuration │ ├── issue_templates/ # GitHub issue templates │ └── workflows/ # GitHub Actions workflows │ └── ci.yml # Main CI pipeline configuration │ ├── meson.build # Meson build configuration ├── LICENSE # Project license ├── pyproject.toml # Python project configuration └── README.md # Project overview ├── setup.cfg # Optional Python packaging configuration


FAQs

Q: How does lightnumpy differ from numpy?

A: While numpy is a full-featured numerical library, lightnumpy is a lightweight version, designed to be faster and more efficient for specific use cases. It focuses on essential features, leaving out less commonly used ones.

Q: Is lightnumpy compatible with numpy?

A: For most common operations, yes! It provides a familiar API to help you transition smoothly.

Q: Can I use lightnumpy for GPU/TPU tasks?

A: Absolutely! lightnumpy has built-in support for hardware accelerators.

Owner

  • Name: scikit-plots
  • Login: scikit-plots
  • Kind: organization

Citation (CITATION.bib)

% --------------------------------------------------------------------
% CITATION.bib file for 
% This file provides citation information for users
% who want to cite the library, related papers, and books.
% --------------------------------------------------------------------

@software{lightnumpy:vlatest,
  title   = {{ lightnumpy: A lightweight version of NumPy or Cupy (or similar functionality). }},
  author  = { scikit-plots developers },
  month   = { 11 },
  year    = { 2025 },
  doi     = { 10.5281/zenodo.13367000 },
  url     = { https://github.com/scikit-plots/lightnumpy },
  version = { latest },
  message = { A lightweight version of NumPy or Cupy (or similar functionality). },
}

GitHub Events

Total
  • Delete event: 38
  • Issue comment event: 81
  • Push event: 27
  • Pull request event: 76
  • Fork event: 1
  • Create event: 42
Last Year
  • Delete event: 38
  • Issue comment event: 81
  • Push event: 27
  • Pull request event: 76
  • Fork event: 1
  • Create event: 42

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 0
  • Total pull requests: 46
  • Average time to close issues: N/A
  • Average time to close pull requests: 8 days
  • Total issue authors: 0
  • Total pull request authors: 2
  • Average comments per issue: 0
  • Average comments per pull request: 1.93
  • Merged pull requests: 13
  • Bot issues: 0
  • Bot pull requests: 44
Past Year
  • Issues: 0
  • Pull requests: 46
  • Average time to close issues: N/A
  • Average time to close pull requests: 8 days
  • Issue authors: 0
  • Pull request authors: 2
  • Average comments per issue: 0
  • Average comments per pull request: 1.93
  • Merged pull requests: 13
  • Bot issues: 0
  • Bot pull requests: 44
Top Authors
Issue Authors
Pull Request Authors
  • dependabot[bot] (41)
  • celik-muhammed (3)
Top Labels
Issue Labels
Pull Request Labels
documentation (2)

Dependencies

pyproject.toml pypi
.github/meson_actions/action.yml actions
.github/workflows/cffconvert-test.yml actions
  • actions/checkout 11bd71901bbe5b1630ceea73d27597364c9af683 composite
  • citation-file-format/cffconvert-github-action 4cf11baa70a673bfdf9dad0acc7ee33b3f4b6084 composite
.github/workflows/check_changelog.yml actions
  • actions/checkout v4 composite
  • scientific-python/action-towncrier-changelog v1 composite
.github/workflows/codeql.yml actions
  • actions/checkout 11bd71901bbe5b1630ceea73d27597364c9af683 composite
  • actions/setup-python 42375524e23c412d93fb67b49958b491fce71c38 composite
  • github/codeql-action/analyze 5618c9fc1e675841ca52c1c6b1304f5255a905a0 composite
  • github/codeql-action/autobuild 5618c9fc1e675841ca52c1c6b1304f5255a905a0 composite
  • github/codeql-action/init 5618c9fc1e675841ca52c1c6b1304f5255a905a0 composite
.github/workflows/labeler-module.yml actions
  • thomasjpfan/labeler v2.5.1 composite
.github/workflows/labeler-title-regex.yml actions
  • actions/checkout v4 composite
  • actions/setup-python v5 composite
.github/workflows/open_actions.yml actions
  • actions/first-interaction 34f15e814fe48ac9312ccf29db4e74fa767cbab7 composite
  • actions/github-script 60a0d83039c74a4aee543508d2ffcb1c3799cdea composite
  • actions/labeler 8558fd74291d67161a8a78ce36a881fa63b766a9 composite
.github/workflows/publish-to-test-pypi.yml actions
  • actions/checkout 11bd71901bbe5b1630ceea73d27597364c9af683 composite
  • actions/setup-python 42375524e23c412d93fb67b49958b491fce71c38 composite
  • pypa/gh-action-pypi-publish 76f52bc884231f62b9a034ebfe128415bbaabdfc composite
.github/workflows/update-lock-files.yml actions
  • actions/checkout v4 composite
  • peter-evans/create-pull-request v7 composite
.github/workflows/wheels.yml actions
  • actions/checkout 11bd71901bbe5b1630ceea73d27597364c9af683 composite
  • actions/setup-python 0b93645e9fea7318ecaed2b359559ac225c90a2b composite
  • actions/upload-artifact 65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 composite
  • bus1/cabuild/action/msdevshell e22aba57d6e74891d059d66501b6b5aed8123c4d composite
  • conda-incubator/setup-miniconda 505e6394dae86d6a5c7fbb6e3fb8938e3e863830 composite
  • pypa/cibuildwheel ee63bf16da6cddfb925f542f2c7b59ad50e93969 composite
docker/Dockerfile docker
  • ${BASE_IMAGE} latest build
docker/docker-compose.yml docker
  • jupyter/tensorflow-notebook latest
  • nvidia/cuda 12.6.3-cudnn-runtime-ubuntu24.04
environment.yml pypi
requirements/all.txt pypi
requirements/build.txt pypi
  • Cython >=3.0.8
  • build *
  • meson >=1.5.0
  • meson-python >=0.16.0
  • ninja >=1.11.0
  • ninja *
  • pybind11 >=2.13.2
  • pythran >=0.14.0
  • twine *
requirements/ci32_requirements.txt pypi
  • scipy-openblas32 ==0.3.29.0.0
  • spin ==0.13
requirements/ci_requirements.txt pypi
  • scipy-openblas64 ==0.3.29.0.0
requirements/core.txt pypi
  • joblib >=1.2.0
  • lightnumpy *
  • numpy >=1.23.5
  • pooch >=1.6.0
  • scipy >=1.6.0
  • threadpoolctl >=3.1.0
requirements/cpu.txt pypi
requirements/default.txt pypi
  • joblib >=1.2.0
  • numpy >=1.23.5
  • scipy >=1.6.0
  • threadpoolctl >=3.1.0
requirements/dev.txt pypi
  • black >=24.3.0 development
  • cython-lint >=0.12.2 development
  • doit >=0.36.0 development
  • mypy >=1.9.0 development
  • pre-commit * development
  • pycodestyle * development
  • pydevtool * development
  • rich-click * development
  • ruff >=0.5.1 development
  • types-psutil * development
  • typing_extensions * development
requirements/docs.txt pypi
  • colorspacious *
  • intersphinx_registry *
  • jinja2 *
  • jupyter-sphinx *
  • jupyterlite-pyodide-kernel *
  • jupyterlite-sphinx *
  • jupytext *
  • lightnumpy *
  • myst-nb *
  • myst-parser *
  • numpydoc >=1.2.0
  • packaging >=21
  • pydata-sphinx-theme *
  • sphinx >=5.0.0,<100.0.0
  • sphinx-copybutton *
  • sphinx-design *
  • sphinx-gallery *
  • sphinx-prompt *
  • sphinx-remove-toctrees *
  • sphinx-rtd-theme *
  • sphinx-tabs *
  • sphinx-tags *
  • sphinxcontrib-inlinesyntaxhighlight *
  • sphinxcontrib-sass *
  • sphinxcontrib-svg2pdfconverter *
  • sphinxext-opengraph *
  • towncrier >=24.8.0
requirements/emscripten_test_requirements.txt pypi
  • hypothesis ==6.125.3 test
  • pytest ==8.3.4 test
  • pytest-xdist * test
  • pytz ==2025.1 test
requirements/gpu.txt pypi
requirements/maintenance.txt pypi
  • conda-lock ==2.5.7
requirements/test.txt pypi
  • hypothesis >=6.30 test
  • lightnumpy * test
  • pyamg >=4.0.0 test
  • pytest >=7.1.2 test
  • pytest-cov >=2.9.0 test
  • pytest-fail-slow * test
  • pytest-mpl * test
  • pytest-run-parallel * test
  • pytest-timeout * test
  • pytest-xdist * test
requirements/tpu.txt pypi
  • tensorflow *
  • tf-keras *
  • transformers *
tools/0yanked/pypi_packaging/setup.py pypi
tools/azure/debian_32bit_requirements.txt pypi
  • cython *
  • joblib *
  • meson-python *
  • ninja *
  • pytest *
  • pytest-cov *
  • threadpoolctl *
tools/azure/ubuntu_atlas_requirements.txt pypi
  • cython ==3.0.10
  • joblib ==1.2.0
  • meson-python *
  • ninja *
  • pytest *
  • pytest-xdist *
  • threadpoolctl ==3.1.0