Skip to content

Commit 95609fc

Browse files
committed
Fix test folder structure and typing
1 parent a364386 commit 95609fc

55 files changed

Lines changed: 6236 additions & 8295 deletions

Some content is hidden

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

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
"danfojs-browser/**"
77
],
88
"scripts": {
9-
"install": "cd danfojs-node && yarn && cd ../danfojs-browser && yarn",
10-
"build": "cd danfojs-node && yarn build:clean && cd ../danfojs-browser && yarn build:clean",
11-
"test": "cd danfojs-node && yarn && yarn test:clean && cd ../danfojs-browser && yarn && yarn test:clean"
9+
"install": "cd src/danfojs-base && yarn && cd ../danfojs-browser && yarn && cd ../danfojs-node && yarn",
10+
"build": "cd src/danfojs-node && yarn build:clean && cd ../danfojs-browser && yarn build:clean",
11+
"test": "cd src/danfojs-node && yarn && yarn test:clean && cd ../danfojs-browser && yarn && yarn test:clean"
1212
}
1313
}

src/danfojs-base/aggregators/groupby.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ export default class Groupby {
450450
return this.operations("min")
451451
}
452452

453-
get_group(keys: Array<string>): DataFrame {
453+
getGroup(keys: Array<string | number>): DataFrame {
454454
let dictKey = keys.join("-")
455455
let colDict: { [key: string ]: {} } = {}
456456
colDict[dictKey] = {...this.colDict[dictKey]}

src/danfojs-base/core/frame.ts

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ import NDframe from "./generic";
2525
import { table } from "table";
2626
import Series from './series';
2727
import Groupby from '../aggregators/groupby'
28-
import { PlotlyLib } from "../plotting";
2928

3029
const utils = new Utils();
3130

@@ -2447,17 +2446,4 @@ export default class DataFrame extends NDframe implements DataFrameInterface {
24472446
).group()
24482447

24492448
}
2450-
2451-
/**
2452-
* Make plots of Series or DataFrame.
2453-
* Uses the Plotly as backend, so supports Plotly's configuration parameters
2454-
* @param divId Name of the div to show the plot
2455-
* @returns Plotly class that expoese different plot type
2456-
*/
2457-
plot(divId: string) {
2458-
//TODO: Add support for check plot library to use
2459-
// So we can support other plot library like d3, vega, etc
2460-
const plt = new PlotlyLib(this, divId);
2461-
return plt;
2462-
}
24632449
}

src/danfojs-base/core/series.ts

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ import Dt from './datetime';
2626
import dummyEncode from "../transformers/encoders/dummy.encoder";
2727
import DataFrame from "./frame";
2828
import tensorflow from '../shared/tensorflowlib'
29-
import { PlotlyLib } from "../plotting";
3029

3130
const utils = new Utils();
3231

@@ -1359,18 +1358,4 @@ export default class Series extends NDframe implements SeriesInterface {
13591358
}): DataFrame {
13601359
return dummyEncode(this, options)
13611360
}
1362-
1363-
1364-
/**
1365-
* Make plots of Series or DataFrame.
1366-
* Uses the PlotlyLib as backend, so supports PlotlyLib's configuration parameters
1367-
* @param divId Name of the div to show the plot
1368-
* @returns PlotlyLib class that expoese different plot type
1369-
*/
1370-
plot(divId: string) {
1371-
//TODO: Add support for check plot library to use
1372-
// So we can support other plot library like d3, vega, etc
1373-
const plt = new PlotlyLib(this, divId);
1374-
return plt;
1375-
}
13761361
}

src/danfojs-base/package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,9 @@
99
"author": "",
1010
"license": "ISC",
1111
"devDependencies": {
12-
"@types/plotly.js-dist-min": "^2.3.0",
1312
"dotenv": "^10.0.0"
1413
},
1514
"dependencies": {
16-
"plotly.js-dist-min": "^2.8.0",
1715
"@tensorflow/tfjs": "3.6.0",
1816
"@tensorflow/tfjs-node": "3.6.1",
1917
"mathjs": "^10.0.0",
Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,2 @@
1-
2-
// This file is auto-generated by prebuild.js. Do not edit!
3-
const tf = require("@tensorflow/tfjs")
4-
export default tf
5-
1+
const tf = require("@tensorflow/tfjs-node")
2+
export default tf

src/danfojs-base/shared/types.ts

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import Dt from '../core/datetime';
1818
import DataFrame from '../core/frame';
1919
import Series from '../core/series';
2020
import { BaseUserConfig, TableUserConfig, } from "table"
21-
import { Config, Layout } from "plotly.js-dist-min"
2221

2322
export type DTYPES = "float32" | "int32" | "string" | "boolean" | "undefined"
2423

@@ -333,21 +332,3 @@ export interface DateTime {
333332
seconds(): Series
334333
minutes(): Series
335334
}
336-
337-
interface CustomConfig extends Config {
338-
x: string
339-
y: string,
340-
values: string,
341-
labels: string,
342-
rowPositions: number[],
343-
columnPositions: number[],
344-
grid: { rows: number, columns: number },
345-
tableHeaderStyle: any,
346-
tableCellStyle: any,
347-
columns: string[];
348-
}
349-
350-
export type PlotConfigObject = {
351-
config: Partial<CustomConfig>
352-
layout: Partial<Layout>
353-
}

src/danfojs-base/yarn.lock

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,6 @@
8989
regenerator-runtime "^0.13.5"
9090
yargs "^16.0.3"
9191

92-
"@types/d3@^3":
93-
version "3.5.46"
94-
resolved "https://registry.yarnpkg.com/@types/d3/-/d3-3.5.46.tgz#8b890138ea035b703ef4cdd2de0d86f8619c1c69"
95-
integrity sha512-jNHfiGd41+JUV43LTMzQNidyp4Hn0XfhoSmy8baE0d/N5pGYpD+yX03JacY/MH+smFxYOQGXlz4HxkRZOuRNOQ==
96-
9792
"@types/node-fetch@^2.1.2":
9893
version "2.5.12"
9994
resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.5.12.tgz#8a6f779b1d4e60b7a57fb6fd48d84fb545b9cc66"
@@ -112,20 +107,6 @@
112107
resolved "https://registry.yarnpkg.com/@types/offscreencanvas/-/offscreencanvas-2019.3.0.tgz#3336428ec7e9180cf4566dfea5da04eb586a6553"
113108
integrity sha512-esIJx9bQg+QYF0ra8GnvfianIY8qWB0GBx54PK5Eps6m+xTj86KLavHv6qDhzKcu5UUOgNfJ2pWaIIV7TRUd9Q==
114109

115-
"@types/plotly.js-dist-min@^2.3.0":
116-
version "2.3.0"
117-
resolved "https://registry.yarnpkg.com/@types/plotly.js-dist-min/-/plotly.js-dist-min-2.3.0.tgz#b1b86b94b86e4628d97beca95cc7dd26c2f30758"
118-
integrity sha512-MPvZbG2RA3zuU+AYgsVysJvNLyf3bvi1nt3ywHARwMW2TB38VQuYhQFD1pTRzBuqiV5ieYif7mLY5bHWGUVZqw==
119-
dependencies:
120-
"@types/plotly.js" "*"
121-
122-
"@types/plotly.js@*":
123-
version "1.54.17"
124-
resolved "https://registry.yarnpkg.com/@types/plotly.js/-/plotly.js-1.54.17.tgz#346844049bed5675907122f83e29640ada4cf411"
125-
integrity sha512-2nk1jEDQ85Ix6SQsC7M7Otl5M8OoYwTl7V/x2ptyX373slUJAj+vQ3njYGy/h9p/rxTq7W0fn3JvXjuxXuA0Qg==
126-
dependencies:
127-
"@types/d3" "^3"
128-
129110
"@types/seedrandom@2.4.27":
130111
version "2.4.27"
131112
resolved "https://registry.yarnpkg.com/@types/seedrandom/-/seedrandom-2.4.27.tgz#9db563937dd86915f69092bc43259d2f48578e41"
@@ -689,11 +670,6 @@ path-is-absolute@^1.0.0:
689670
resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f"
690671
integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18=
691672

692-
plotly.js-dist-min@^2.8.0:
693-
version "2.8.0"
694-
resolved "https://registry.yarnpkg.com/plotly.js-dist-min/-/plotly.js-dist-min-2.8.0.tgz#e489069fd6c4338832a2270c5d82c0e325135d58"
695-
integrity sha512-6OOg/D7OEffYq1WJt4XKNHzJAd9uN3kCuKZcCr0RGvnSB3wvP7fDmfsUpxZR2q0M+3j7SKejJ8qv1HGkarnObg==
696-
697673
process-nextick-args@~2.0.0:
698674
version "2.0.1"
699675
resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2"

src/danfojs-browser/package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,9 @@
2727
"stream-json": "^1.7.3",
2828
"table": "6.7.1",
2929
"xlsx": "^0.17.2",
30-
"seedrandom": "^2.4.3"
31-
},
32-
"peerDependencies": {
30+
"seedrandom": "^2.4.3",
3331
"plotly.js-dist-min": "^2.8.0"
32+
3433
},
3534
"scripts": {
3635
"test": "karma start --single-run --browsers ChromeHeadless karma.conf.js",

src/danfojs-browser/src/core/frame.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import { toCSV, toExcel, toJSON } from "../io";
1616
import BaseDataFrame from "../../../danfojs-base/core/frame"
1717
import { BaseDataOptionType } from "../../../danfojs-base/shared/types";
1818
import { CsvOutputOptionsBrowser, ExcelOutputOptionsBrowser, JsonOutputOptionsBrowser } from "types";
19+
import { PlotlyLib } from "../plotting";
1920

2021

2122
/**
@@ -35,6 +36,19 @@ export default class DataFrame extends BaseDataFrame {
3536
super(data, options)
3637
}
3738

39+
/**
40+
* Make plots of Series or DataFrame.
41+
* Uses the Plotly as backend, so supports Plotly's configuration parameters
42+
* @param divId Name of the div to show the plot
43+
* @returns Plotly class that expoese different plot type
44+
*/
45+
plot(divId: string) {
46+
//TODO: Add support for check plot library to use
47+
// So we can support other plot library like d3, vega, etc
48+
const plt = new PlotlyLib(this, divId);
49+
return plt;
50+
}
51+
3852
/**
3953
* Converts a DataFrame or Series to CSV.
4054
* @param options Configuration object. Supports the following options:

0 commit comments

Comments
 (0)