Skip to content

Commit 44f7607

Browse files
authored
Merge pull request #393 from adamgilman/documentation-spelling-correction
correct lenght -> length
2 parents 573d349 + 6403eb8 commit 44f7607

File tree

10 files changed

+31
-31
lines changed

10 files changed

+31
-31
lines changed

src/danfojs-base/core/generic.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ export default class NDframe implements NDframeInterface {
334334
}
335335

336336
/**
337-
* Returns the shape of the NDFrame. Shape is determined by [row lenght, column length]
337+
* Returns the shape of the NDFrame. Shape is determined by [row length, column length]
338338
*/
339339
get shape(): Array<number> {
340340
if (this.$data.length === 0) return [0, 0]

src/danfojs-base/core/series.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1449,7 +1449,7 @@ export default class Series extends NDframe implements SeriesInterface {
14491449
}
14501450

14511451
if (!(lSeries.length === rSeries.length)) {
1452-
throw new Error("LengthError: Lenght of other must be equal to length of Series");
1452+
throw new Error("LengthError: length of other must be equal to length of Series");
14531453
}
14541454

14551455

src/danfojs-base/plotting/plotly/pie.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ export const piePlot = (ndframe: DataFrame | Series, divId: string, plotConfig:
7575

7676
if (config['rowPositions']) {
7777
if (config['rowPositions'].length != cols.length) {
78-
throw Error(`Lenght of rowPositions array must be equal to number of columns. Got ${config['rowPositions'].length}, expected ${cols.length - 1}`);
78+
throw Error(`length of rowPositions array must be equal to number of columns. Got ${config['rowPositions'].length}, expected ${cols.length - 1}`);
7979
}
8080
} else {
8181
let tempArr = [];
@@ -88,7 +88,7 @@ export const piePlot = (ndframe: DataFrame | Series, divId: string, plotConfig:
8888

8989
if (config['columnPositions']) {
9090
if (config['columnPositions'].length != cols.length) {
91-
throw Error(`Lenght of columnPositions array must be equal to number of columns. Got ${config['columnPositions'].length}, expected ${cols.length - 1}`);
91+
throw Error(`length of columnPositions array must be equal to number of columns. Got ${config['columnPositions'].length}, expected ${cols.length - 1}`);
9292
}
9393
} else {
9494
let tempArr = [];

src/danfojs-base/shared/errors.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ import { DATA_TYPES } from "./defaults"
2222
class ErrorThrower {
2323

2424
throwColumnNamesLengthError = (ndframe: NDframe, columns: Array<string>): void => {
25-
const msg = `ParamError: Column names length mismatch. You provided a column of length ${columns.length} but Ndframe columns has lenght of ${ndframe.shape[1]}`
25+
const msg = `ParamError: Column names length mismatch. You provided a column of length ${columns.length} but Ndframe columns has length of ${ndframe.shape[1]}`
2626
throw new Error(msg)
2727
}
2828

2929
throwIndexLengthError = (ndframe: NDframe, index: Array<string | number>): void => {
30-
const msg = `IndexError: You provided an index of length ${index.length} but Ndframe rows has lenght of ${ndframe.shape[0]}`
30+
const msg = `IndexError: You provided an index of length ${index.length} but Ndframe rows has length of ${ndframe.shape[0]}`
3131
throw new Error(msg)
3232
}
3333

@@ -42,7 +42,7 @@ class ErrorThrower {
4242
}
4343

4444
throwDtypesLengthError = (ndframe: NDframe, dtypes: Array<string>): void => {
45-
const msg = `DtypeError: You provided a dtype array of length ${dtypes.length} but Ndframe columns has lenght of ${ndframe.shape[1]}`
45+
const msg = `DtypeError: You provided a dtype array of length ${dtypes.length} but Ndframe columns has length of ${ndframe.shape[1]}`
4646
throw new Error(msg)
4747
}
4848

@@ -52,12 +52,12 @@ class ErrorThrower {
5252
}
5353

5454
throwColumnLengthError = (ndframe: NDframe | DataFrame, arrLen: number): void => {
55-
const msg = `ParamError: Column data length mismatch. You provided data with length ${arrLen} but Ndframe has column of lenght ${ndframe.shape[1]}`
55+
const msg = `ParamError: Column data length mismatch. You provided data with length ${arrLen} but Ndframe has column of length ${ndframe.shape[1]}`
5656
throw new Error(msg)
5757
}
5858

5959
throwRowLengthError = (ndframe: NDframe, arrLen: number): void => {
60-
const msg = `ParamError: Row data length mismatch. You provided data with length ${arrLen} but Ndframe has row of lenght ${ndframe.shape[0]}`
60+
const msg = `ParamError: Row data length mismatch. You provided data with length ${arrLen} but Ndframe has row of length ${ndframe.shape[0]}`
6161
throw new Error(msg)
6262
}
6363

src/danfojs-browser/tests/core/frame.test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,14 +119,14 @@ describe("DataFrame", function () {
119119
assert.deepEqual(df["count"].values, [ 1, 2, 3, 4 ]);
120120
assert.deepEqual(df["sum"].values, [ 20.3, 30.456, 40.90, 90.1 ]);
121121
});
122-
it("throw error for wrong column lenght", function () {
122+
it("throw error for wrong column length", function () {
123123
const data = { alpha: [ "A", "B", "C", "D" ], count: [ 1, 2, 3, 4 ], sum: [ 20.3, 30.456, 40.90, 90.1 ] };
124124
const df = new dfd.DataFrame(data);
125125

126126
assert.throws(function () {
127127
df.addColumn("new_column", new dfd.Series([ "a", "b", "c" ])),
128128
Error,
129-
'ParamError: Column data length mismatch. You provided data with length 3 but Ndframe has column of lenght 4';
129+
'ParamError: Column data length mismatch. You provided data with length 3 but Ndframe has column of length 4';
130130
});
131131

132132
});
@@ -364,7 +364,7 @@ describe("DataFrame", function () {
364364
const values = (await df.sample(2)).values;
365365
assert.deepEqual(values, expected);
366366
});
367-
it("Throw error if n is greater than lenght of Dataframe", async function () {
367+
it("Throw error if n is greater than length of Dataframe", async function () {
368368
const data = [ [ 1, 2, 3 ], [ 4, 5, 6 ], [ 20, 30, 40 ], [ 39, 89, 78 ], [ 100, 200, 300 ] ];
369369
const cols = [ "A", "B", "C" ];
370370
const df = new dfd.DataFrame(data, { columns: cols });

src/danfojs-browser/tests/core/generic.test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ describe("Generic (NDFrame)", function () {
210210
ndframe.$setValues([ [ 20, 20 ], [ 11.4, 211 ], [ 11.4, 211 ] ]);
211211
},
212212
Error,
213-
"Row data length mismatch. You provided data with length 3 but Ndframe has row of lenght 2"
213+
"Row data length mismatch. You provided data with length 3 but Ndframe has row of length 2"
214214
);
215215
});
216216
it("Throws column length error on invalid data length in DataFrame", function () {
@@ -221,7 +221,7 @@ describe("Generic (NDFrame)", function () {
221221
ndframe.$setValues([ [ 20, 211 ], [ 20, 20, 11.4, 211 ] ]);
222222
},
223223
Error,
224-
"Column data length mismatch. You provided data with length 2 but Ndframe has column of lenght 2"
224+
"Column data length mismatch. You provided data with length 2 but Ndframe has column of length 2"
225225
);
226226
});
227227
it("retrieves the col data after row data is replaced in a Series", function () {
@@ -254,7 +254,7 @@ describe("Generic (NDFrame)", function () {
254254
ndframe.$setValues([ 1, 2, 3, 4, 1, 3 ]);
255255
},
256256
Error,
257-
"Row data length mismatch. You provided data with length 6 but Ndframe has row of lenght 4"
257+
"Row data length mismatch. You provided data with length 6 but Ndframe has row of length 4"
258258
);
259259
});
260260

src/danfojs-browser/tests/core/series.test.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ describe("Series Functions", () => {
6060
assert.deepEqual((await sf.sample(-1)).values.length, data.length);
6161
});
6262

63-
it("Throw error if n is greater than lenght of Series", async function () {
63+
it("Throw error if n is greater than length of Series", async function () {
6464
const data = [ 1, 2, 3, 4, 5, 620, 30, 40, 39, 89, 78 ];
6565
const sf = new dfd.Series(data);
6666
try {
@@ -132,7 +132,7 @@ describe("Series Functions", () => {
132132
"DtypeError: String data type does not support add operation"
133133
);
134134
});
135-
it("Throws length error if series lenght mixmatch", function () {
135+
it("Throws length error if series length mixmatch", function () {
136136
const data = [ 1, 2, 3, 4 ];
137137
const data2 = [ 1, 2, 3, 4, 5, 6 ];
138138
const sf = new dfd.Series(data);
@@ -167,7 +167,7 @@ describe("Series Functions", () => {
167167
"DtypeError: String data type does not support sub operation"
168168
);
169169
});
170-
it("Throws length error if series lenght mixmatch", function () {
170+
it("Throws length error if series length mixmatch", function () {
171171
const data = [ 1, 2, 3, 4 ];
172172
const data2 = [ 1, 2, 3, 4, 5, 6 ];
173173
const sf = new dfd.Series(data);
@@ -196,7 +196,7 @@ describe("Series Functions", () => {
196196
const sf2 = new dfd.Series(data2);
197197
assert.throws(() => { sf.mul(sf2); }, Error, "DtypeError: String data type does not support mul operation");
198198
});
199-
it("Throws length error if series lenght mixmatch", function () {
199+
it("Throws length error if series length mixmatch", function () {
200200
const data = [ 1, 2, 3, 4 ];
201201
const data2 = [ 1, 2, 3, 4, 5, 6 ];
202202
const sf = new dfd.Series(data);
@@ -233,7 +233,7 @@ describe("Series Functions", () => {
233233
const sf2 = new dfd.Series(data2);
234234
assert.throws(() => { sf.div(sf2); }, Error, `DtypeError: String data type does not support div operation`);
235235
});
236-
it("Throws length error if series lenght mixmatch", function () {
236+
it("Throws length error if series length mixmatch", function () {
237237
const data = [ 1, 2, 3, 4 ];
238238
const data2 = [ 1, 2, 3, 4, 5, 6 ];
239239
const sf = new dfd.Series(data);

src/danfojs-node/test/core/frame.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,14 +124,14 @@ describe("DataFrame", function () {
124124
assert.deepEqual(df["val_count"].values, [1, 2, 3, 4]);
125125
assert.deepEqual(df["val_sum"].values, [20.3, 30.456, 40.90, 90.1]);
126126
});
127-
it("throw error for wrong column lenght", function () {
127+
it("throw error for wrong column length", function () {
128128
const data = { alpha: ["A", "B", "C", "D"], val_count: [1, 2, 3, 4], val_sum: [20.3, 30.456, 40.90, 90.1] };
129129
const df = new DataFrame(data);
130130

131131
assert.throws(function () {
132132
df.addColumn("new_column", new Series(["a", "b", "c"])),
133133
Error,
134-
'ParamError: Column data length mismatch. You provided data with length 3 but Ndframe has column of lenght 4'
134+
'ParamError: Column data length mismatch. You provided data with length 3 but Ndframe has column of length 4'
135135
})
136136

137137
});
@@ -368,7 +368,7 @@ describe("DataFrame", function () {
368368
const values = (await df.sample(2)).values;
369369
assert.deepEqual(values, expected);
370370
});
371-
it("Throw error if n is greater than lenght of Dataframe", async function () {
371+
it("Throw error if n is greater than length of Dataframe", async function () {
372372
const data = [[1, 2, 3], [4, 5, 6], [20, 30, 40], [39, 89, 78], [100, 200, 300]];
373373
const cols = ["A", "B", "C"];
374374
const df = new DataFrame(data, { columns: cols });

src/danfojs-node/test/core/generic.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ describe("Generic (NDFrame)", function () {
212212
ndframe.$setValues([[20, 20], [11.4, 211], [11.4, 211]])
213213
},
214214
Error,
215-
"Row data length mismatch. You provided data with length 3 but Ndframe has row of lenght 2"
215+
"Row data length mismatch. You provided data with length 3 but Ndframe has row of length 2"
216216
);
217217
});
218218
it("Throws column length error on invalid data length in DataFrame", function () {
@@ -223,7 +223,7 @@ describe("Generic (NDFrame)", function () {
223223
ndframe.$setValues([[20, 211], [20, 20, 11.4, 211]])
224224
},
225225
Error,
226-
"Column data length mismatch. You provided data with length 2 but Ndframe has column of lenght 2"
226+
"Column data length mismatch. You provided data with length 2 but Ndframe has column of length 2"
227227
);
228228
});
229229
it("retrieves the col data after row data is replaced in a Series", function () {
@@ -255,7 +255,7 @@ describe("Generic (NDFrame)", function () {
255255
ndframe.$setValues([1, 2, 3, 4, 1, 3])
256256
},
257257
Error,
258-
"Row data length mismatch. You provided data with length 6 but Ndframe has row of lenght 4"
258+
"Row data length mismatch. You provided data with length 6 but Ndframe has row of length 4"
259259
);
260260
});
261261

src/danfojs-node/test/core/series.test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ describe("Series Functions", () => {
6262
assert.deepEqual((await sf.sample(-1)).values.length, data.length);
6363
});
6464

65-
it("Throw error if n is greater than lenght of Series", async function () {
65+
it("Throw error if n is greater than length of Series", async function () {
6666
const data = [1, 2, 3, 4, 5, 620, 30, 40, 39, 89, 78];
6767
const sf = new Series(data);
6868
try {
@@ -134,7 +134,7 @@ describe("Series Functions", () => {
134134
"DtypeError: String data type does not support add operation"
135135
);
136136
});
137-
it("Throws length error if series lenght mixmatch", function () {
137+
it("Throws length error if series length mixmatch", function () {
138138
const data = [1, 2, 3, 4]
139139
const data2 = [1, 2, 3, 4, 5, 6]
140140
const sf = new Series(data)
@@ -169,7 +169,7 @@ describe("Series Functions", () => {
169169
"DtypeError: String data type does not support sub operation"
170170
);
171171
});
172-
it("Throws length error if series lenght mixmatch", function () {
172+
it("Throws length error if series length mixmatch", function () {
173173
const data = [1, 2, 3, 4]
174174
const data2 = [1, 2, 3, 4, 5, 6]
175175
const sf = new Series(data)
@@ -198,7 +198,7 @@ describe("Series Functions", () => {
198198
const sf2 = new Series(data2)
199199
assert.throws(() => { sf.mul(sf2) }, Error, "DtypeError: String data type does not support mul operation")
200200
})
201-
it("Throws length error if series lenght mixmatch", function () {
201+
it("Throws length error if series length mixmatch", function () {
202202
const data = [1, 2, 3, 4]
203203
const data2 = [1, 2, 3, 4, 5, 6]
204204
const sf = new Series(data)
@@ -235,7 +235,7 @@ describe("Series Functions", () => {
235235
const sf2 = new Series(data2)
236236
assert.throws(() => { sf.div(sf2) }, Error, `DtypeError: String data type does not support div operation`)
237237
})
238-
it("Throws length error if series lenght mixmatch", function () {
238+
it("Throws length error if series length mixmatch", function () {
239239
const data = [1, 2, 3, 4]
240240
const data2 = [1, 2, 3, 4, 5, 6]
241241
const sf = new Series(data)

0 commit comments

Comments
 (0)