-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[RFC]: achieve ndarray API parity with built-in JavaScript arrays #61
Comments
@rxbryan this looks good, thanks for the proposal! I am not so familiar with |
Thanks for the review @Pranavchiku.
I don't think there's an issue related to this project. Should I create one? |
@rxbryan thanks for opening this draft proposal! I think overall the projects looks very good, I will ask you to add all the APIs in a list such that we can create in a future a tracking issue like this one. What I am seeing from this proposal is that you are not leaving room for review cycles, specially at the end of the project. It would be nice to leave room for these interactions and maybe if you are interested in writing a blog post for documenting your journey we can add it towards the final month of this proposal (please note that it is completely optional and it is up to you :) ). |
Building on the previous comments, I have a few comments of my own:
|
I assumed here that the user of this APIs ( we could then assign a placeholder to the original elements we want to effectively
Yes the proposal assumes that the input array will be viewed as a flat single dimensional array for the
my intention here was to implement the APIs within existing state of ndarray API which now seems a bit short sighted.
I would have to agree that the slicing semantics would be more appropriate. I think the proposal suffers alot from conforming to the JavaScript SPEC of the APIs
The API documentation was derived from https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array and the JSdoc from existing APIs in I have to admit that is proposal was over enthusiastic. The attempt to cover the entire JavaScript built-in prototype methods have broadened the scope of this proposal than it should have been. Implementing this proposal as it is would require implementing this project idea #43 and Uint64 dtype support. With just one day to end of project submission I don't think this project can be updated reasonably. |
The project idea is not intended to match exact ECMAScript defined semantics for |
Full name
Bryan Elee Atonye
University status
Yes
University name
University of Port Harcourt
University program
Mathematics and Computer Science
Expected graduation
July
Short biography
My name is Bryan Elee. I am in my final year pursuing a degree in Mathematics and Computer Science. I recently completed my final exam and project defense, hence I'm awaiting graduation in the next couple months.
I possess a strong foundation in various programming languages, with over 5 years of programming experience with C/C++, Python, and JavaScript, honed through academic studies, practical projects and internships. I have previously participated in the Google Summer of Code 2022 under the Metacall Organization and in the summer of Bitcoin program last year working under the Ledger Organization. This experiences solidified my ability to work effectively within open-source communities and collaborate with experienced developers.
I'm interested in machine learning, especially the field of reinforcement learning. I did some work on reinforcement learning last year and I am very excited about the possibilities offered by this technology.
Specific Achievements:
Summer of Bitcoin: Developed "Resigner," a general-purpose hot signing service in Python for Ledger Organization. This project demonstrates my ability to tackle complex tasks (Miniscript language, cryptographic functionalities) and deliver real-world solutions. Project Link
Google Summer of Code: Refactored the Metacall core library to a plugin architecture. This experience showcases my proficiency in C/C++ development Project Documentation:
Timezone
UTC +1
Contact details
rxbryn@gmail.com
Platform
Linux
Editor
Sublime Text
Programming experience
I began programming before university in 2018. I started out writing shell scripts, moved on to C/C++, then the Python programming language, Javascript and NodeJS. I am self taught in the above languages, I was usually motivated by some project I was developing. I have worked on a couple projects but I am most proud of Resigner.
Resigner is an easy to program hot signing service for miniscript policies. The Resigner countersigns transactions (according to some rules (spending conditions), set in advance in the configuration file, for example “no more than 1 million satoshis per day” before the transaction is broadcast to the bitcoin network. It provides the following features:
It acts as a trusted third party in multiparty transactions enforcing previously agreed conditions
JavaScript experience
I have about 3 years of experience writing javascript programs. I have two published npm packages http-date and http-preconditions. I also have some experience doing backend web development using NodeJS, Express.
I have contributed Javascript to a few open source projects such as
My favourite feature in javascript would be function prototypes. While this pattern has fallen out of favour being replaced by the class syntax, the prototype pattern provides an interesting approach for dynamic inheritance of object properties and behaviour.
My least favourite feature in Javascript is the event loop. While the event loop is responsible for the asynchronous behaviour in javascript, it is also makes writing true multithreaded javascript applications very difficult. Any attempt at optimising javascript code requires deep understanding of the nature of the event loop and how it affects the specific code being optimised. This experience is not readily available.
Node.js experience
My experience with NodeJS is quite extensive. I have some experience modifying NodeJS source code and compiling the Library for embedding purposes. Some of my experience developing node native addons and embedding NodeJS comes from contributing to the development of the node loader in metacall
core
. This draft PR contains a lot of my work in embedding nodejs. It was used as the base for implementing the feature for exporting classes and objects form nodejs to metacall.I also have some experience developing web applications using nodejs, express.js. I have also published some npm packages as I have elaborated on in the javascript section
C/Fortran experience
The C programming language is the first language I learnt, the second being C++. It is the language that I have clocked the most years of experience. I used C extensively while paticipating in the summer of code 2022 under metacall and I also worked on some personal projects using C.
Some of my contributions to open source projects using C include
metacall/core#289
metacall/core#270
metacall/core#287
metacall/core#298
Some of these merged PRs include C++ code. But still demonstrates my the requisite skill
Interest in stdlib
My interest in Stdlib is twofold.
Version control
Yes
Contributions to stdlib
Merged contributions
refactor: update
blas/ext/base/sapxsumpw
to follow current project conventionsrefactor: update
blas/ext/base/scusumors
to follow current project conventionsrefactor: update
blas/ext/base/scusumpw
to follow current project conventionsrefactor: update
blas/ext/base/sapx
to follow current project conventionsGoals
The goal of this project is to achieve API parity for Stdlib native ndarray with built-in JavaScript Array. Of all the existing JavaScript array method only the at and slice methods exist in ndarray.
Each of the APIs is a standalone package in either the @stdlib/ndarray/base or @stdlib/ndarray directory
Each package would have this file structure
The following APIs will be implemented during the course of this project:
ndarray slice semantics for representing indices
APIs taking an Index or multiple indices will utilise the slice semantics. We shall use the slice API as it is, hence APIs such as
fill
,copywithin
,splice
etc shall take a slice object, array of slice objects or a multislice object.Dimensionality Reduction
In APIs which it would be suitable to support operating over specific axes, we will be utilising approach used by numpy.
A
null
axis, (the default) is would perform the operation over all the dimensions of the input ndarray. If this is an array of ints, a reduction is performed on multiple axes, instead of a single axis or all the axes as before.For example, given a three dimentional ndarray, axis = 0 represent reducing along the depth. 1 represents represent reducing along the row and 2 represents represent reducing along the column
Accessors
ndarray APIs taking a callback such as unary implement optimised accessors for dimensions upto the 10d. We shall use this approach while implementing the APIs requiring callbacks
APIs
APIs that take a callback
Why this project?
Ndarrays are foundational to working with the stdlib library. They provide an efficient way to work with multi-dimensional numerical data. This project is a high priority for Stdlib for the fore-mentioned reason. It adds APIs that would be utilised in every package in the library.
The Knowledge of working with multi-dimensional numerical data is a highly valuable skill for data science and machine learning, career paths I intend on pursuing. A significant portion of data science and machine learning involves working with numerical data, often organized in multi-dimensional structures like matrices and tensors. These structures represent complex relationships between features and observations. Understanding how to manipulate, analyze, and interpret this data is very important, this project hence affords me first hand experience with the ndarray object.
I also stand to gain knowledge optimal techniques and patterns for iterating multidimensional arrays, possibly other optimisation techniques that might be used during the course the project.
Qualifications
I have completed the course work for a degree in Mathematics and Computer science. The relevant courses to this project would be Linear algebra, Numerical analysis, Data structures and algorithms.
I am also acquainted with the book
Algorithms
, 4th Edition by Robert Sedgewick and Kevin Wayne. It helped develop my understanding of both data structures and algorithms.I am also quite familiar with the emcascript specification. The definitions and implementations of the APIs will be informed by it
Prior art
The at and slice methods exist in ndarray. Various ndarray APIs have also being implemented. They will inform and guide our implementation of the project
Commitment
As stated in background section, I recently completed my final exam and project defense. Hence I'm free from any major commitments and will be able to give a ~40hr/week to this project
Schedule
Assuming a 12 week schedule,
Each of the APIs to be implemented is standalone, and will not be considered implemented without its benchmarks, tests, documentations and examples. So rather than having a week for documentation, tests and so on...I intended to submit PRs to atleast 3 APIs per week.
Week 1 - Week 3: start coding
findLast
,includes
,join
,reduceRight
,toreversed
,tosorted
,toSpliced
,values
Week 4 - Week 6: (midterm): implement
filter
,find
,forEach
,includes
,splice
,copywithin
,concat
,sort
,reverse
Week 7 - Week 9: Implement the remaining APIs ,
map
,reduce
,some
,join
,toString
,Week 10 - Week 12: because of the complex nature of the project, I intend to leave the last two weeks for review because I’m expecting a lot of reviews before we can get this code merged
Related issues
No response
Checklist
[RFC]:
and succinctly describes your proposal.The text was updated successfully, but these errors were encountered: