Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
336f9d8
feat: implement np.split and np.array_split
Nucs Mar 20, 2026
85ccb4f
feat: implement np.random.weibull distribution
Nucs Mar 20, 2026
2a774aa
feat: implement np.random.standard_cauchy distribution
Nucs Mar 20, 2026
da129ec
feat: implement np.random.vonmises (von Mises / circular normal distr…
Nucs Mar 20, 2026
3c838d6
feat: implement np.random.f (Fisher) distribution
Nucs Mar 20, 2026
3ea3dc8
feat: implement np.random.logseries (logarithmic series distribution)
Nucs Mar 20, 2026
80830e7
feat: add np.random.standard_normal with NumPy-aligned scalar return
Nucs Mar 20, 2026
070736e
feat(random): add np.random.standard_t distribution
Nucs Mar 20, 2026
2ecdf97
feat(random): add np.random.triangular distribution
Nucs Mar 20, 2026
78f27d6
docs: add comprehensive NumPy 2.4.2 API inventory
Nucs Mar 20, 2026
24a1f9e
docs: add NumSharp current API inventory with status tracking
Nucs Mar 20, 2026
d36caec
feat: implement np.hsplit, np.vsplit, np.dsplit array splitting funct…
Nucs Mar 20, 2026
8f5d66e
test: add battle tests for np.hsplit, np.vsplit, np.dsplit
Nucs Mar 20, 2026
140b31a
feat: implement np.random.dirichlet distribution
Nucs Mar 20, 2026
a51696a
feat: implement np.random.gumbel distribution (extreme value type I)
Nucs Mar 20, 2026
ba2c2b4
feat: implement np.random.hypergeometric distribution
Nucs Mar 20, 2026
d1ff43c
feat: implement np.random.laplace distribution (double exponential)
Nucs Mar 20, 2026
0a7f4d9
feat: implement np.random.logistic distribution
Nucs Mar 20, 2026
ef80787
feat: implement np.random.multinomial distribution
Nucs Mar 20, 2026
41512d9
feat: implement np.random.multivariate_normal distribution
Nucs Mar 20, 2026
26350a5
feat: implement np.random.negative_binomial distribution
Nucs Mar 20, 2026
7ed7909
feat: implement np.random.noncentral_chisquare distribution
Nucs Mar 20, 2026
58d683f
feat: implement np.random.noncentral_f distribution
Nucs Mar 20, 2026
7686d5d
feat: implement np.random.pareto distribution (Lomax/Pareto II)
Nucs Mar 20, 2026
5275bb1
feat: implement np.random.power distribution
Nucs Mar 20, 2026
f23609d
feat: implement np.random.rayleigh distribution
Nucs Mar 20, 2026
bca6747
feat: implement np.random.standard_exponential distribution
Nucs Mar 20, 2026
19d1b3a
feat: implement np.random.standard_gamma distribution
Nucs Mar 20, 2026
246771b
feat: implement np.random.wald distribution (inverse Gaussian)
Nucs Mar 20, 2026
2b722c3
feat: implement np.random.zipf distribution (zeta distribution)
Nucs Mar 20, 2026
a9429fe
test: add comprehensive tests for random sampling distributions
Nucs Mar 20, 2026
30652e6
fix: add NextGaussian() method for Box-Muller transform
Nucs Mar 24, 2026
c906694
fix: consolidate Box-Muller to NextGaussian(), fix randn<T>() bug
Nucs Mar 24, 2026
9dd358d
test: add OpenBugs.Random tests for NumPy RNG alignment
Nucs Mar 24, 2026
53cd1a0
docs: add NUMPY_RANDOM.md implementation reference
Nucs Mar 24, 2026
bd17747
docs: add RANDOM_MIGRATION_PLAN.md for NumPy RNG alignment
Nucs Mar 24, 2026
3cca95d
feat: replace Randomizer with MT19937 for NumPy seed compatibility
Nucs Mar 24, 2026
9dd59aa
fix: update random tests for NumPy-compatible scalar returns
Nucs Mar 24, 2026
15e1e9b
feat: align size/axis/seed validation with NumPy
Nucs Mar 25, 2026
1b92123
docs: add comprehensive np.random battletest
Nucs Mar 25, 2026
312d184
docs: comprehensive np.random reference with all implicit behaviors
Nucs Mar 28, 2026
e2a4ede
fix: migrate npalign files to long indexing
Nucs Mar 28, 2026
1f9fbf3
refactor: migrate random distributions to UnmanagedMemoryBlock
Nucs Mar 28, 2026
c45a2e0
fix: remove int downcasts in random sampling functions
Nucs Mar 28, 2026
4cce88a
fix: implement SVD-based multivariate_normal for NumPy alignment
Nucs Mar 28, 2026
715c6e1
fix: match NumPy eigenvector sign convention for multivariate_normal
Nucs Mar 28, 2026
8639844
docs: document multivariate_normal sign convention limitation
Nucs Mar 29, 2026
735e159
refactor(random): standardize size parameter overloads
Nucs Apr 10, 2026
1e82e79
fix: align random distributions with NumPy's legacy algorithms
Nucs Apr 11, 2026
e484b59
fix: resolve stack overflow in noncentral_f and Int64 test mismatches
Nucs Apr 11, 2026
1bccd96
fix: add [NotInParallel] to random tests to prevent race conditions
Nucs Apr 11, 2026
e0fa47b
fix(random): correct size parameter delegation in np.random.* functions
Nucs Apr 11, 2026
e65f663
fix(random): break circular delegation with Shape.ToIntArray
Nucs Apr 11, 2026
168ab23
fix(random): make long the canonical index type, remove all downcasts
Nucs Apr 11, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions .claude/skills/np-function/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
name: np-function
description: Implement numpy np.* functions in NumSharp with full API parity. Use when adding new numpy functions, implementing np.* methods, or aligning NumSharp behavior with numpy 2.4.2.
---

We are looking to support numpy's np.* to the fullest. we are aligning with numpy 2.4.2 as source of truth and are to provide exact same API (np.* overloading) as numpy does.
This session we focusing on: """$ARGUMENTS"""
You job is around interacting with np.* functions (no more than a few. more than one ONLY if they are closely related).

To interact/develop/create a np.* / function, high-level development cycle is as follows:
1. Read how numpy (K:\source\NumSharp\src\numpy) exposes the np function/s you are about to implement. Remember, numpy is the source of truth and if numpy does A, we do A but in NumSharp's C# way.
Definition of Done:
- At the end of this step you understand to 100% how the np function both works, behaves and accepts.
If numpy function uses other np.* functions then you are to report them to the team leader and wait for further instructions. If the function is relative to you then take ownership over it and add it to your group of functions.
2. Implement np methods in the appropriate np class and if custom calculation/math is required via backend then follow the Tensor and IL Kernel way. You are not allowed to implement a hardcoded loop per dtype. Usually other np.* calls is all a numpy function requires. Always reuse existing architecture rather than create a new one.
Definition of Done:
- What Numpy supports, we support.
- We support all dtypes (no hardcoded loops, use il generation via our backend if necessary).
- We have all the apis the np function has and all the overloads.
- We calculate exactly like numpy because only that way we can capture all the design edge cases and implicit behaviors.
3. Then migrate the tests that numpy has from numpy to C# and then produce your own set of tests covering all aspects of the api that you will battletest. Any bugs should be fixed on the spot.
Definition of Done:
- All numpy tests have been migrated to NumSharp C#.
- We used battletesting to find edge cases and other bugs in our implementation where numpy works. Our source of truth for behavior is numpy!
4. Review the implementation, definitions of done and confirm alignment to numpy is as close as possible. Ensure documentation in code.
5. Commit and report completion.

## Tools:
### Battletesting
Use battletesting to test and validate assumptions or even hunt edge cases: which is using 'dotnet run << 'EOF'' and 'python << 'EOF'' to run any code for any of these purposes.

## Instructions to Team Leader
- Create at-least 4 users if the task can be parallelised to that level and if not then use less
- Do not wait for other teammates to complete, always have N teammates developing until all the work is completed by definition of done.
- If user asked for 1 of something there there is only a reason to launch one teammate and not five.
- When the teammate have completed development all the way to last step and all definition of done: finish and shutdown the teammate.
- You are to give the instructions to the teammates word-for-word based on this document with your own adaptation below the original version.
54 changes: 54 additions & 0 deletions .claude/skills/np-tests/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
---
name: np-tests
description: Write and migrate numpy tests for NumSharp functions. Use when adding tests for np.* methods, migrating numpy test suites, or battletesting NumSharp implementations against numpy 2.4.2.
---

We are looking to test numpy's np.* implementations to the fullest. we are aligning with numpy 2.4.2 as source of truth and are to validate exact same behavior as numpy does.
This session we focusing on: """$ARGUMENTS"""
Your job is around writing tests for np.* functions (no more than a few. more than one ONLY if they are closely related).

To interact/develop/create tests for np.* functions, high-level development cycle is as follows:
1. Find and read numpy's tests for the function/s you are about to test. Tests are in K:\source\NumSharp\src\numpy under numpy/_core/tests/, numpy/lib/tests/, etc. Remember, numpy is the source of truth.
Definition of Done:
- At the end of this step you understand 100% what numpy tests: inputs, outputs, edge cases, error conditions, dtype behaviors.
- You have identified all test files and test methods related to your function.
2. Migrate numpy's tests to C# following TUnit framework patterns in test/NumSharp.UnitTest. Match numpy's test structure and assertions exactly.
Definition of Done:
- Every numpy test case has a corresponding C# test.
- We cover all dtypes NumSharp supports (Boolean, Byte, Int16, UInt16, Int32, UInt32, Int64, UInt64, Char, Single, Double, Decimal).
- Test names reflect what they test (e.g., Test_Sort_Axis0_Int32).
- Assertions match numpy's expected values exactly.
3. Battletest to find gaps. Run python and dotnet side-by-side to discover edge cases numpy handles that we might miss.
Definition of Done:
- All numpy tests pass in NumSharp.
- Additional edge cases discovered via battletesting are covered.
- Any bugs found are reported to implementation teammate or fixed on the spot.
4. Review test coverage: empty arrays, scalar inputs, negative axis, broadcasting, NaN/Inf handling, dtype promotion, error conditions.
5. Commit and report completion.

## Tools:
### Battletesting
Use battletesting to validate behavior matches numpy: 'dotnet run << 'EOF'' and 'python << 'EOF'' side-by-side comparison.

### Test Patterns
```csharp
[Test]
public async Task FunctionName_Scenario_Dtype()
{
// Arrange
var input = np.array(new[] { 3, 1, 2 });

// Act
var result = np.sort(input);

// Assert - values from running actual numpy
Assert.That(result.IsContiguous, Is.True);
Assert.That(result.GetAtIndex<int>(0), Is.EqualTo(1));
}
```

## Instructions to Team Leader
- Create at-least 4 users if the task can be parallelised to that level and if not then use less
- Do not wait for other teammates to complete, always have N teammates developing until all the work is completed by definition of done.
- If user asked for 1 of something there there is only a reason to launch one teammate and not five.
- When the teammate have completed development all the way to last step and all definition of done: finish and shutdown the teammate.
Loading
Loading