Skip to content

Commit 760b1da

Browse files
committed
Prepare package for nodejs build v0.1.9
1 parent de5ef59 commit 760b1da

9 files changed

Lines changed: 24 additions & 24 deletions

File tree

danfojs/src/core/frame.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
* limitations under the License.
1313
*/
1414

15-
// import * as tf from '@tensorflow/tfjs-node'; //Use this import when building optimized version for danfojs-node
16-
import * as tf from "@tensorflow/tfjs"; //Use this import when building optimized version for danfojs browser side
15+
import * as tf from '@tensorflow/tfjs-node'; //Use this import when building optimized version for danfojs-node
16+
// import * as tf from "@tensorflow/tfjs"; //Use this import when building optimized version for danfojs browser side
1717
import Ndframe from "./generic";
1818
import { Series } from "./series";
1919
import { Utils } from "./utils";

danfojs/src/core/generic.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
*
1414
*/
1515

16-
// import * as tf from '@tensorflow/tfjs-node'; //Use this import when building optimized version for danfojs-node
17-
import * as tf from "@tensorflow/tfjs"; //Use this import when building optimized version for danfojs browser side
16+
import * as tf from '@tensorflow/tfjs-node'; //Use this import when building optimized version for danfojs-node
17+
// import * as tf from "@tensorflow/tfjs"; //Use this import when building optimized version for danfojs browser side
1818
import { table } from "table";
1919
import { Utils } from "./utils";
2020
import { Configs } from "../config/config";

danfojs/src/core/series.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
*/
1515

1616

17-
// import * as tf from '@tensorflow/tfjs-node'; //Use this import when building optimized version for danfojs-node
18-
import * as tf from '@tensorflow/tfjs'; //Use this import when building optimized version for danfojs browser sideimport { std, variance } from 'mathjs'
17+
import * as tf from '@tensorflow/tfjs-node'; //Use this import when building optimized version for danfojs-node
18+
// import * as tf from '@tensorflow/tfjs'; //Use this import when building optimized version for danfojs browser sideimport { std, variance } from 'mathjs'
1919
import { variance, std } from 'mathjs';
2020
import { Utils } from "./utils";
2121
import { Str } from "./strings";

danfojs/src/core/utils.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// import * as tf from '@tensorflow/tfjs-node';
2-
import * as tf from "@tensorflow/tfjs";
1+
import * as tf from '@tensorflow/tfjs-node';
2+
// import * as tf from "@tensorflow/tfjs";
33
import { Configs } from "../config/config";
44

55
const config = new Configs();
@@ -167,7 +167,7 @@ export class Utils {
167167
}
168168
rows_arr.push(temp_row);
169169
}
170-
return [rows_arr, col_names];
170+
return [ rows_arr, col_names ];
171171
}
172172

173173
//converts a 2D array of array to 1D for Series Class
@@ -695,7 +695,7 @@ export class Utils {
695695
} else {
696696
temp_obj[val] = {};
697697
temp_obj[val]["count"] = 1;
698-
temp_obj[val]["index"] = [index];
698+
temp_obj[val]["index"] = [ index ];
699699
}
700700
});
701701

@@ -720,14 +720,14 @@ export class Utils {
720720
*/
721721
_sort_arr_with_index(arr1, arr2, dtype) {
722722
let sorted_idx = arr1.map((item, index) => {
723-
return [arr2[index], item];
723+
return [ arr2[index], item ];
724724
});
725725
if (dtype == "string") {
726726
sorted_idx.sort();
727727
} else {
728-
sorted_idx.sort(([arg1], [arg2]) => arg2 - arg1);
728+
sorted_idx.sort(([ arg1 ], [ arg2 ]) => arg2 - arg1);
729729
}
730730

731-
return sorted_idx.map(([, item]) => item);
731+
return sorted_idx.map(([ , item ]) => item);
732732
}
733733
}

danfojs/src/io/reader.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { DataFrame } from "../core/frame";
2-
// import * as tf from '@tensorflow/tfjs-node'
3-
import * as tf from "@tensorflow/tfjs";
2+
import * as tf from '@tensorflow/tfjs-node';
3+
// import * as tf from "@tensorflow/tfjs";
44
import { Utils } from "../core/utils";
55
import fetch from "node-fetch";
66
import XLSX from "xlsx";
@@ -64,7 +64,7 @@ export const read_json = async (source) => {
6464
let fs = await import("fs");
6565
return new Promise((resolve, reject) => {
6666
fs.readFile(source, (err, data) => {
67-
if (err) reject(error);
67+
if (err) reject(err);
6868
let df = new DataFrame(JSON.parse(data));
6969
resolve(df);
7070
});
@@ -192,7 +192,7 @@ export const read = async (
192192
}
193193
}
194194

195-
if (["csv", "xls", "xlsx"].includes(await file.descriptor.format)) {
195+
if ([ "csv", "xls", "xlsx" ].includes(await file.descriptor.format)) {
196196
if (header) {
197197
let df = new DataFrame(rows.slice(1), { columns: rows[0] });
198198
return df;

danfojs/src/plotting/plot.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { newPlot } from 'plotly.js'; //comment out when building for Node Version
1+
// import { newPlot } from 'plotly.js'; //comment out when building for Node Version
22
import { Utils } from "../core/utils";
33
import { Series } from "../core/series";
44

danfojs/src/preprocessing/scalers.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// import * as tf from '@tensorflow/tfjs-node';
2-
import * as tf from "@tensorflow/tfjs";
1+
import * as tf from '@tensorflow/tfjs-node';
2+
// import * as tf from "@tensorflow/tfjs";
33
import { Series } from "../core/series";
44
import { DataFrame } from "../core/frame";
55
import { Utils } from "../core/utils";

danfojs/tests/core/series.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { assert } from "chai";
22
import { Series } from "../../src/core/series";
3-
// import * as tf from '@tensorflow/tfjs-node';
4-
import * as tf from "@tensorflow/tfjs";
3+
import * as tf from '@tensorflow/tfjs-node';
4+
// import * as tf from "@tensorflow/tfjs";
55

66
describe("Series", function () {
77
describe("tensor", function () {

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"name": "danfojs",
3-
"version": "0.1.5",
2+
"name": "danfojs-node",
3+
"version": "0.1.9",
44
"description": "JavaScript library providing high performance, intuitive, and easy to use data structures for manipulating and processing structured data.",
55
"main": "dist/index.js",
66
"types": "danfojs/types/index.d.ts",

0 commit comments

Comments
 (0)