SciSharp / SciSharp/NumSharp

[Discussion] Ground Rules and Library Structure/Architecture

Open
#284 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

architecture further discuss
Dominant language
C#
Stars
1.5k
Forks
205
Avg merge
7d 7h
Merged PRs (30d)
2

Description

I couldn't but notice the inconsistencies around the library, There are functions that returns copies while some don't while some are not even complete.
The strong-typing of C# does surely makes it harder to get stuff done so .tt generators does a nice job helping with that.

I would like to discuss the following:

  1. What are the supported C# primitive types compared to numpy?
    Looking at the implicit conversions of NDArray and other math operations such as np.sum,
    I found that the type support is inconsistent.
    note: Numpy supports both signed and unsigned types. see this.

    image

  2. Do we support Complex?
    because aside of the basic math operations, it is not supported anywhere.

  3. To what rank/ndim the algorithms in C# support?
    I saw some functions that support 2-3 and some up to 6.
    Numpy limitation is 32 dimensions.

  4. NDArray mutable vs immutable
    I think it should be up to the user to decide via a bool parameter.

    • Arithmetic operators should always return a copy
    • Following numpy's lead is the priority ofcouse.
  5. Seperation between np, NDArray and backend engine
    There is a lot of mixup between whats computed where.
    The reality is that they all redirect calls to each other.
    In a perfect scenario:
    we would refer all operations low-level operations to backend engine to perform the wanted task.
    Having a fallback to each method that will compute in C#.
    NDArray is only responsible for casting, initialization, storing data and serialization
    And np is the high-level zone that uses backend.

  6. The incomplete methods should be logged somewhere, preferably in Issues or project here.
    Heres just a few examples from my findings:

    • np.transpose supports only to rank 2 and theres a //todo in the unit test that fails
    • np.flatten wasn't implemented completely but was shipped on release
    • np.sum doesn't support all data types.
      We should start by creating issues for those problems in code and we'll get on from there
  7. Means of communication between the developing team via instant messaging?
    Edit: Did not see the gitter tag on readme.md

Those issues are important to address, simply because this library is and will be the backend of many high-level applications.
That's about it, Best regards.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the .tt generators and the boundaries between NDArray, np, and the backend engine. Inspect the np.transpose unit test TODO and the reported np.flatten and np.sum gaps. Done means reaching documented architectural decisions and splitting concrete implementation problems into scoped follow-up issues.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, numpy
Domain
backend, data
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.