Skip to content

Modernize repo; new node, tsup, vitest#52

Merged
j6k4m8 merged 8 commits into
masterfrom
modernize-repo
Sep 11, 2025
Merged

Modernize repo; new node, tsup, vitest#52
j6k4m8 merged 8 commits into
masterfrom
modernize-repo

Conversation

@j6k4m8
Copy link
Copy Markdown
Member

@j6k4m8 j6k4m8 commented Aug 27, 2025

No description provided.

@vallsv
Copy link
Copy Markdown
Contributor

vallsv commented Aug 30, 2025

Hi, i have taken a look at this PR so here is few feedback.

  • it's nice to be able to write TS directly.
  • Also now we can directly import the functions, without need to construct first the module ("_npyjs = new npyjs()"). That's much simpler and convenient.

On my side TS was complaining about few things so i have patched the following: 3215e46 37262c9.

The only problem i have is with the merge of parse and load.
Now there is a single function load. This mix the previous parse which was a pure no IO, and the previous load which was doing the IO.
So now, even if you just want to parse, you depend on an async function, while it's not the nature of such function.

@vallsv
Copy link
Copy Markdown
Contributor

vallsv commented Aug 31, 2025

Another small thing, also related to load function.

It tries to support multiple input types

  • string as an URL -> to fetch it
  • ArrayBuffer -> like before for parse function
  • TypedArray -> to get the buffer of the array

A typed array have a specific location and size in an array buffer.
When it get the buf = source.buffer it lose such information. In the following code it will read the wrong location in the buffer.
Offset=0 is most probably always the case in your use cases. But it would be safer to throw an error if the offset from the typed array is not 0.

…handle Array objects (#56)

* Added support to unicode data type

* Added data loading from Blob object

* Fixed header generation for 1D arrays in dump function

* Extended dump function to handle Array objects
- Implemented dtype inference for Array objects
- Implemented dumping of unicode data

* If shape is not specified in the dump function we take the length of the
array
Moved createPyDescription out from dump function

* Removed unused import
@j6k4m8
Copy link
Copy Markdown
Member Author

j6k4m8 commented Sep 10, 2025

Thank you @vallsv and @sebaB003 for contributions on this one!! I need to take a look at why tests are failing, probably this weekend... if either of you want to work that problem out before then, I will merge it and make this the latest tagged version once it's working!!

Reshape was implemented on top of a transposition function that was
working only for 2D matrix.

The new implementation works by computing the new index of each element
for the new reshaped array.

This implementation is more likely to work as the python numpy reshape
method
Added tests for the boolean handling
Fixed some types that were failing on `tsc`
@sebaB003
Copy link
Copy Markdown
Contributor

Thank you @vallsv and @sebaB003 for contributions on this one!! I need to take a look at why tests are failing, probably this weekend... if either of you want to work that problem out before then, I will merge it and make this the latest tagged version once it's working!!

This should be working on #57

Fixed reshape function and booleans handling
@j6k4m8
Copy link
Copy Markdown
Member Author

j6k4m8 commented Sep 11, 2025

INCREDIBLE, thank you @sebaB003 !! Merging and deploying this now!!

@j6k4m8 j6k4m8 merged commit 8ef0192 into master Sep 11, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants