Skip to content

Commit

Permalink
0.0.1dev0
Browse files Browse the repository at this point in the history
  • Loading branch information
celik-muhammed committed Dec 11, 2024
1 parent fcf1414 commit d0dcb22
Show file tree
Hide file tree
Showing 113 changed files with 3,918 additions and 321 deletions.
5 changes: 3 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[submodule "lightnumpy/cpp_core/NumCpp"]
path = lightnumpy/cpp_core/NumCpp

[submodule "lightnumpy/_cpp_core/NumCpp"]
path = lightnumpy/_cpp_core/NumCpp
url = https://github.com/scikit-plots/NumCpp.git
branch = gh_numcpp
15 changes: 15 additions & 0 deletions CITATION.bib
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
% ---------------------------------------------------------
% CITATION.bib file for lightnumpy
% This file provides citation information for users
% who want to cite the library, related papers, and books.
% ---------------------------------------------------------
@misc{lightnumpy:vlatest,
author = { scikit-plots developers },
title = { lightnumpy: A lightweight version of NumPy (or similar functionality) },
year = { 2024 },
version = { latest },
url = { https://scikit-plots.github.io },
note = { A lightweight version of NumPy (or similar functionality). },
doi = { 10.5281/zenodo.13367000 }
}
32 changes: 32 additions & 0 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# ---------------------------------------------------------
# CITATION.cff file for lightnumpy
# This file provides citation information for users
# who want to cite the library, related papers, and books.
# ---------------------------------------------------------

cff-version: 1.2.0 # The version of the CFF format used.
message: "If you use this software, please cite it using the following metadata."
title: "lightnumpy: A lightweight version of NumPy (or similar functionality)"
version: "latest"
doi: "10.5281/zenodo.13367000"
date-released: "2024-10-27"

# Authors and contributors of the software project.
authors:
- team: "scikit-plots developers"
website: "https://scikit-plots.github.io"

# Repository information
repository-code: "https://github.com/scikit-plots/lightnumpy"
repository-artifact: "https://zenodo.org/records/13367000"

# License for your softwarelicense: "BSD-3-Clause"
type: software
url: "https://scikit-plots.github.io"

# Keywords related to your software
keywords:
- Software
- Python
- scikit-plots
- Machine Learning Visualization
166 changes: 92 additions & 74 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,84 +21,102 @@ pip install lightnumpy

---

## Project Structure
## LightNumPy Project Structure

```sh
lightnumpy/
├── lightnumpy/ # Core library source code
│ ├── __init__.py # Main package initializer
│ ├── python_api/ # Python API module
│ │ ├── __init__.py # API entry point for `python_api`
│ │ ├── 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
│ ├── c_core/ # C implementation sources
│ │ ├── include/ # C headers
│ │ │ ├── array.h # Array definitions
│ │ │ └── math_ops.h # Math operation headers
│ │ └── src/ # C source files
│ │ ├── array.c # Array operations
│ │ └── math_ops.c # Math implementations
│ ├── cpp_core/ # C++ implementation sources
│ │ ├── include/ # C++ headers
│ │ │ ├── tensor.hpp # Tensor operations
│ │ │ └── utilities.hpp # Helper utilities
│ │ └── src/ # C++ source files
│ │ ├── tensor.cpp # Tensor operation implementations
│ │ └── utilities.cpp # Utility function implementations
│ ├── gpu_core/ # GPU operations
│ │ ├── include/ # GPU headers
│ │ │ ├── gpu_ops.hpp # GPU operation definitions
│ │ │ └── cuda_helpers.hpp # CUDA helper utilities
│ │ └── 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
│ ├── bindings/ # Bindings for Python and native code
│ │ ├── c_bindings.c # C-Python bindings
│ │ ├── cpp_bindings.cpp # C++-Python bindings
│ │ ├── gpu_bindings.cu # CUDA-Python bindings
│ │ ├── tpu_bindings.cpp # TPU-Python bindings
│ │ └── pybind_utils.cpp # Helper functions for bindings
│ └── 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
├── 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
├── .github/ # CI/CD configuration
│ ├── workflows/ # GitHub Actions workflows
│ │ └── ci.yml # Main CI pipeline configuration
│ └── issue_templates/ # GitHub issue templates
├── 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
├── meson.build # Meson build configuration
├── pyproject.toml # Python project configuration
├── setup.cfg # Optional Python packaging configuration
└── README.md # Project overview
├── 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.
│ ├── _c_core/ # Low-level C implementation sources
│ │ ├── include/ # C headers
│ │ │ ├── array.h # Array definitions
│ │ │ └── math_ops.h # Math operation headers
│ │ └── src/ # C source files
│ │ ├── array.c # Array operations
│ │ └── math_ops.c # Math implementations
│ ├── _cpp_core/ # Higher-level C++ implementation sources
│ │ ├── include/ # C++ headers
│ │ │ ├── tensor.hpp # Tensor operations
│ │ │ └── utilities.hpp # Helper utilities
│ │ └── src/ # C++ source files
│ │ ├── tensor.cpp # Tensor operation implementations
│ │ └── utilities.cpp # Utility function implementations
│ ├── _gpu_core/ # GPU operations
│ │ ├── include/ # GPU headers
│ │ │ ├── gpu_ops.hpp # GPU operation definitions
│ │ │ └── cuda_helpers.hpp # CUDA helper utilities
│ │ └── 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/ # Headers
│ │ └── src/ # TPU source files
│ │ ├── array_cy.pyx # Cython implementation of array module
│ │ ├── linalg_cy.pyx # Cython implementation of linalg operations
│ │ ├── utils_cy.pyx # Cython utilities
│ │ ├── gpu_cy.pyx # GPU-specific Cython bindings
│ │ ├── tpu_cy.pyx # TPU-specific Cython bindings
│ │ └── cython_helpers.pxd # Shared Cython declarations (optional)
│ ├── py_bindings/ # Bindings for Python and native code, pybind11 bridging native libraries with Python APIs
│ │ ├── include/ # Headers
│ │ └── src/ # TPU source files
│ │ ├── c_bindings.c # C-Python bindings
│ │ ├── cpp_bindings.cpp # C++-Python bindings
│ │ ├── gpu_bindings.cu # CUDA-Python bindings
│ │ ├── tpu_bindings.cpp # TPU-Python bindings
│ │ └── 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_c_include, get_cpp_include, and get_include for lightnumpy library's C and C++ headers
│ │ ├── 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
```


Expand Down
153 changes: 153 additions & 0 deletions lightnumpy/.clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
---
Language: Cpp
# BasedOnStyle: NumCpp
AccessModifierOffset: -4
AlignAfterOpenBracket: Align
AlignArrayOfStructures: None
AlignConsecutiveMacros: true
AlignConsecutiveAssignments: true
AlignConsecutiveBitFields: None
AlignConsecutiveDeclarations: true
AlignEscapedNewlines: Left
AlignOperands: true
AlignTrailingComments: true
AllowAllArgumentsOnNextLine: false
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortEnumsOnASingleLine: true
AllowShortBlocksOnASingleLine: Empty
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: Empty
AllowShortLambdasOnASingleLine: All
AllowShortIfStatementsOnASingleLine: Never
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: Yes
BinPackArguments: false
BinPackParameters: false
BraceWrapping:
AfterCaseLabel: true
AfterClass: true
AfterControlStatement: Always
AfterEnum: true
AfterFunction: true
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: true
AfterUnion: true
AfterExternBlock: true
BeforeCatch: true
BeforeElse: true
BeforeLambdaBody: false
BeforeWhile: true
IndentBraces: false
SplitEmptyFunction: false
SplitEmptyRecord: false
SplitEmptyNamespace: false
BreakBeforeBinaryOperators: None
BreakBeforeConceptDeclarations: true
BreakBeforeBraces: Allman
BreakBeforeInheritanceComma: false
BreakInheritanceList: AfterColon
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
BreakConstructorInitializers: AfterColon
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: true
ColumnLimit: 120
CommentPragmas: '^ NumCpp pragma:'
QualifierAlignment: Leave
CompactNamespaces: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: false
DeriveLineEnding: true
DerivePointerAlignment: true
DisableFormat: false
EmptyLineAfterAccessModifier: Never
EmptyLineBeforeAccessModifier: Always
ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: true
PackConstructorInitializers: Never
IncludeBlocks: Regroup
IncludeCategories:
- Regex: '^"NumCpp/'
Priority: 4
SortPriority: 0
- Regex: '^"boost/'
Priority: 3
SortPriority: 0
- Regex: '^<'
Priority: 2
SortPriority: 0
- Regex: '.*'
Priority: 1
SortPriority: 0
IncludeIsMainRegex: '$'
IncludeIsMainSourceRegex: ''
IndentAccessModifiers: false
IndentCaseLabels: true
IndentCaseBlocks: false
IndentGotoLabels: true
IndentPPDirectives: None
IndentExternBlock: AfterExternBlock
IndentRequires: true
IndentWidth: 4
IndentWrappedFunctionNames: true
InsertTrailingCommas: None
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: false
LambdaBodyIndentation: Signature
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: All
ObjCBinPackProtocolList: Auto
ObjCBlockIndentWidth: 4
ObjCSpaceAfterProperty: true
ObjCSpaceBeforeProtocolList: true
PenaltyBreakAssignment: 2
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakOpenParenthesis: 0
PenaltyBreakString: 1000
PenaltyBreakTemplateDeclaration: 10
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60
PenaltyIndentedWhitespace: 0
PointerAlignment: Left
ReferenceAlignment: Pointer
ReflowComments: true
SeparateDefinitionBlocks: Always
SortIncludes: CaseSensitive
SortUsingDeclarations: true
SpaceAfterCStyleCast: false
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeCaseColon: false
SpaceBeforeCpp11BracedList: false
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
SpaceAroundPointerQualifiers: Default
SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyBlock: true
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInConditionalStatement: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
SpaceBeforeSquareBrackets: false
Standard: Latest
TabWidth: 4
Standard: c++17
UseCRLF: false
UseTab: Never
...
Loading

0 comments on commit d0dcb22

Please sign in to comment.