Skip to content

Commit c54f9c4

Browse files
authored
Merge pull request #23 from AlphaQuantJS/dev
fix: refactor api usage, tests, remove obsolete files
2 parents 89bdd88 + 308ea3a commit c54f9c4

197 files changed

Lines changed: 4493 additions & 2386 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,16 @@ UI.md
5858

5959
# Examples
6060
examples/
61+
62+
# Test fixtures
63+
test/fixtures
64+
65+
# Documentation
66+
docs/
67+
68+
# Test and demo files
69+
arrow-demo.cjs
70+
arrow-test.cjs
71+
test-arrow.js
72+
test-output/
73+
tinyframejs-*.tgz

arrow-demo.cjs

Lines changed: 0 additions & 149 deletions
This file was deleted.

arrow-test.cjs

Lines changed: 0 additions & 77 deletions
This file was deleted.

docs/io-module.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ async function getBitcoinPrices() {
314314
const standardized = applySchema(data, binanceOHLCV);
315315

316316
// Преобразование в DataFrame
317-
return DataFrame.fromRows(standardized);
317+
return DataFrame.fromRecords(standardized);
318318
}
319319

320320
// Использование

fix-test-imports.js

Lines changed: 0 additions & 89 deletions
This file was deleted.

src/core/dataframe/DataFrame.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ export class DataFrame {
3030
value: {
3131
/**
3232
* low-level vector getter (internal)
33-
* @param n
33+
* @param {string} n - Column name
34+
* @returns {import('../storage/ColumnVector.js').ColumnVector|undefined} - Column vector or undefined if not found
3435
*/
3536
getColumn: (n) => this._columns[n]?.vector,
3637
},
@@ -44,7 +45,7 @@ export class DataFrame {
4445
static create = (cols, opts = {}) => new DataFrame(cols, opts);
4546
static fromColumns = (cols, opts = {}) => new DataFrame(cols, opts);
4647

47-
static fromRows(rows = [], opts = {}) {
48+
static fromRecords(rows = [], opts = {}) {
4849
if (!rows.length) return new DataFrame({}, opts);
4950
const cols = {};
5051
for (const k of Object.keys(rows[0])) cols[k] = rows.map((r) => r[k]);
@@ -90,10 +91,12 @@ export class DataFrame {
9091
}
9192

9293
col = (n) => this._columns[n];
94+
get = (n) => this._columns[n];
9395
sum = (n) => this.col(n).sum();
9496
/**
9597
* low-level vector getter
96-
* @param n
98+
* @param {string} n - Column name
99+
* @returns {import('../storage/ColumnVector.js').ColumnVector|undefined} - Column vector or undefined if not found
97100
*/
98101
getVector = (n) => this._columns[n]?.vector;
99102

0 commit comments

Comments
 (0)