mateogianolio / mateogianolio/vectorious
Support constructing array from JSON
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 918
- Forks
- 41
- PR merge metrics
- No merged PRs in 30d
Description
Example:
```ts
import { array, equals } from 'vectorious';
const x = array([1, 2, 3]);
/*
array([ 1, 2, 3 ], dtype=float64)
*/
const serialized = JSON.stringify(x);
/*
'{"data":{"0":1,"1":2,"2":3},"dtype":"float64","length":3,"shape":[3],"strides":[1]}'
*/
const deserialized = JSON.parse(serialized);
/*
{
data: { '0': 1, '1': 2, '2': 3 },
dtype: 'float64',
length: 3,
shape: [ 3 ],
strides: [ 1 ]
}
*/
const y = array(deserialized)
assert(equals(x, y));
```
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the TypeScript implementation of the array constructor and the JSON example in this issue. Determine how the deserialized object should be accepted while preserving data, dtype, length, shape, and strides, then verify that equals(x, y) succeeds for the shown example.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- data
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100