Skip to content

Commit 40fe98f

Browse files
committed
Condense sources
1 parent 5ce4593 commit 40fe98f

27 files changed

+2210
-2286
lines changed

src/BaselineOfDataFrame/BaselineOfDataFrame.class.st

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Class {
77
{ #category : #baselines }
88
BaselineOfDataFrame >> baseline: spec [
99
<baseline>
10-
spec for: #common do: [
10+
spec for: #common do: [
1111
"External dependencies"
1212
spec
1313
baseline: 'NeoCSV'
@@ -18,9 +18,9 @@ BaselineOfDataFrame >> baseline: spec [
1818
spec
1919
baseline: 'AINormalization'
2020
with: [ spec repository: 'github://pharo-ai/normalization/src' ].
21-
21+
2222
"Packages"
23-
spec
23+
spec
2424
package: 'DataFrame' with: [ spec requires: #('AINormalization') ];
2525
package: 'DataFrame-Tests' with: [ spec requires: #('DataFrame') ];
2626
package: 'DataFrame-Type' with: [ spec requires: #('DataFrame') ];
@@ -29,17 +29,17 @@ BaselineOfDataFrame >> baseline: spec [
2929
package: 'DataFrame-IO-Tests' with: [ spec requires: #('DataFrame-IO') ];
3030
package: 'DataFrame-Math';
3131
package: 'DataFrame-Math-Tests' with: [ spec requires: #('DataFrame-Math') ] ].
32-
32+
3333
spec
3434
for: #'pharo7.x'
3535
do: [
3636
spec
3737
package: 'DataFrame-Pharo67' ].
38-
38+
3939
spec
4040
for: #'pharo6.x'
4141
do: [
4242
spec
4343
package: 'DataFrame-Pharo6';
44-
package: 'DataFrame-Pharo67' ].
44+
package: 'DataFrame-Pharo67' ]
4545
]

src/DataFrame-IO-Tests/DataFrameCsvReaderTest.class.st

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ DataFrameCsvReaderTest >> createFile: aFileReference withContents: aString [
1818
| stream |
1919
stream := aFileReference writeStream.
2020
stream nextPutAll: aString.
21-
stream close.
21+
stream close
2222
]
2323

2424
{ #category : #running }
@@ -75,32 +75,28 @@ DataFrameCsvReaderTest >> setUp [
7575
DataFrameCsvReaderTest >> testReadCsv [
7676
| actualDataFrame |
7777
actualDataFrame := DataFrame readFromCsv: commaCsvFile.
78-
self assert: actualDataFrame equals: dataFrameWithoutRowNames.
79-
78+
self assert: actualDataFrame equals: dataFrameWithoutRowNames
8079
]
8180

8281
{ #category : #tests }
8382
DataFrameCsvReaderTest >> testReadCsvWithRowNames [
8483
| actualDataFrame |
8584
actualDataFrame := DataFrame readFromCsvWithRowNames: commaCsvFile.
86-
self assert: actualDataFrame equals: dataFrameWithRowNames.
87-
85+
self assert: actualDataFrame equals: dataFrameWithRowNames
8886
]
8987

9088
{ #category : #tests }
9189
DataFrameCsvReaderTest >> testReadCsvWithRowNamesWithSeparatorTab [
9290
| actualDataFrame |
9391
actualDataFrame := DataFrame readFromCsvWithRowNames: tabCsvFile separator: Character tab.
94-
self assert: actualDataFrame equals: dataFrameWithRowNames.
95-
92+
self assert: actualDataFrame equals: dataFrameWithRowNames
9693
]
9794

9895
{ #category : #tests }
9996
DataFrameCsvReaderTest >> testReadCsvWithSeparatorTab [
10097
| actualDataFrame |
10198
actualDataFrame := DataFrame readFromCsv: tabCsvFile withSeparator: Character tab.
102-
self assert: actualDataFrame equals: dataFrameWithoutRowNames.
103-
99+
self assert: actualDataFrame equals: dataFrameWithoutRowNames
104100
]
105101

106102
{ #category : #tests }

src/DataFrame-IO-Tests/DataFrameCsvWriterTest.class.st

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ DataFrameCsvWriterTest >> testWriteToCsv [
4141
dataFrame writeToCsv: commaQuoteCsvFile.
4242
actual := self readFile: commaQuoteCsvFile.
4343
expected := TestCsvStrings commaQuoteCsvString.
44-
self assert: actual lines equals: expected lines.
44+
self assert: actual lines equals: expected lines
4545
]
4646

4747
{ #category : #tests }
@@ -52,7 +52,7 @@ DataFrameCsvWriterTest >> testWriteToCsvLineEndLf [
5252
dataFrame writeTo: commaQuoteCsvFile using: writer.
5353
actual := self readFile: commaQuoteCsvFile.
5454
expected := String lf join: TestCsvStrings commaQuoteCsvString lines.
55-
self assert: actual lines equals: expected lines.
55+
self assert: actual lines equals: expected lines
5656
]
5757

5858
{ #category : #tests }
@@ -61,5 +61,5 @@ DataFrameCsvWriterTest >> testWriteToCsvWithSeparatorTab [
6161
dataFrame writeToCsv: tabQuoteCsvFile withSeparator: Character tab.
6262
actual := self readFile: tabQuoteCsvFile.
6363
expected := TestCsvStrings tabQuoteCsvString.
64-
self assertCollection: actual lines equals: expected lines.
64+
self assertCollection: actual lines equals: expected lines
6565
]

src/DataFrame-IO-Tests/DataFrameJsonReaderTest.class.st

Lines changed: 27 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -16,57 +16,53 @@ DataFrameJsonReaderTest >> createFileNamed: name withContents: aString [
1616
| stream |
1717
stream := (directory / name) writeStream.
1818
stream nextPutAll: aString.
19-
stream close.
19+
stream close
2020
]
2121

2222
{ #category : #running }
2323
DataFrameJsonReaderTest >> setUp [
2424
super setUp.
2525
directory := FileSystem memory workingDirectory / 'testDataForJson'.
2626
directory createDirectory.
27-
27+
2828
self createFileNamed: 'column.json' withContents: TestJsonStrings columnJsonString.
2929
self createFileNamed: 'index.json' withContents: TestJsonStrings indexJsonString.
3030
self createFileNamed: 'nonNull1.json' withContents: TestJsonStrings nonNullJsonString1.
3131
self createFileNamed: 'records.json' withContents: TestJsonStrings recordsJsonString.
3232
self createFileNamed: 'split.json' withContents: TestJsonStrings splitJsonString.
3333
self createFileNamed: 'values.json' withContents: TestJsonStrings valuesJsonString.
34-
34+
3535
df := DataFrame withRows: #(
3636
(1 2 nil nil)
3737
(nil 2 3 nil)
3838
(nil nil nil 5)
3939
(1 nil 2 nil)).
40-
40+
4141
dfWithColNames := df deepCopy.
4242
dfWithColNames columnNames: #('col1' 'col2' 'col3' 'col4').
43-
43+
4444
dfWithRowNames := df deepCopy.
4545
dfWithRowNames rowNames: #('row1' 'row2' 'row3' 'row4').
46-
46+
4747
dfWithRowColNames := df deepCopy.
4848
dfWithRowColNames columnNames: #('col1' 'col2' 'col3' 'col4').
49-
dfWithRowColNames rowNames: #('row1' 'row2' 'row3' 'row4').
50-
51-
52-
53-
49+
dfWithRowColNames rowNames: #('row1' 'row2' 'row3' 'row4')
5450
]
5551

5652
{ #category : #running }
5753
DataFrameJsonReaderTest >> sortByRowColNames: inputDf [
5854
"Sorts df according to column and row names"
59-
55+
6056
| sortedRowNames sortedColNames dfColSorted outputDf |
6157
sortedRowNames := inputDf rowNames sorted.
6258
sortedColNames := inputDf columnNames sorted.
63-
59+
6460
dfColSorted := DataFrame withRowNames: inputDf rowNames.
6561
sortedColNames do: [ :col | dfColSorted addColumn: (inputDf column: col) asArray named: col ].
66-
62+
6763
outputDf := DataFrame withColumnNames: dfColSorted columnNames.
6864
sortedRowNames do: [ :row | outputDf addRow: (dfColSorted row: row) asArray named: row ].
69-
65+
7066
^ outputDf
7167
]
7268

@@ -75,74 +71,74 @@ DataFrameJsonReaderTest >> testReadFrom [
7571
| output |
7672

7773
output := DataFrameJsonReader new readFrom: directory / 'nonNull1.json'.
78-
79-
self assert: (self sortByRowColNames: output) equals: dfWithColNames.
74+
75+
self assert: (self sortByRowColNames: output) equals: dfWithColNames
8076
]
8177

8278
{ #category : #tests }
8379
DataFrameJsonReaderTest >> testReadFromColumns [
8480
| output |
8581

8682
output := DataFrameJsonReader new readFrom: directory / 'column.json'.
87-
88-
self assert: (self sortByRowColNames: output) equals: dfWithRowColNames.
83+
84+
self assert: (self sortByRowColNames: output) equals: dfWithRowColNames
8985
]
9086

9187
{ #category : #tests }
9288
DataFrameJsonReaderTest >> testReadFromIndex [
9389
| output |
9490

9591
output := DataFrameJsonReader new readFrom: directory / 'index.json'.
96-
97-
self assert: (self sortByRowColNames: output) equals: dfWithRowColNames transposed.
92+
93+
self assert: (self sortByRowColNames: output) equals: dfWithRowColNames transposed
9894
]
9995

10096
{ #category : #tests }
10197
DataFrameJsonReaderTest >> testReadFromJson [
10298
| output |
10399
output := DataFrame readFromJson: (directory / 'nonNull1.json').
104-
self assert: (self sortByRowColNames: output) equals: dfWithColNames.
100+
self assert: (self sortByRowColNames: output) equals: dfWithColNames
105101
]
106102

107103
{ #category : #tests }
108104
DataFrameJsonReaderTest >> testReadFromJsonOrient [
109105
| output |
110106
output := DataFrame readFromJson: (directory / 'split.json') orient: 'split'.
111-
self assert: (self sortByRowColNames: output) equals: dfWithRowColNames.
107+
self assert: (self sortByRowColNames: output) equals: dfWithRowColNames
112108
]
113109

114110
{ #category : #tests }
115111
DataFrameJsonReaderTest >> testReadFromRecords [
116112
| output |
117113

118114
output := DataFrameJsonReader new readFrom: directory / 'records.json'.
119-
120-
self assert: (self sortByRowColNames: output) equals: dfWithColNames.
115+
116+
self assert: (self sortByRowColNames: output) equals: dfWithColNames
121117
]
122118

123119
{ #category : #tests }
124120
DataFrameJsonReaderTest >> testReadFromSplit [
125121
| output |
126122

127123
output := DataFrameJsonReader new readFrom: directory / 'split.json'.
128-
129-
self assert: (self sortByRowColNames: output) equals: dfWithRowColNames.
124+
125+
self assert: (self sortByRowColNames: output) equals: dfWithRowColNames
130126
]
131127

132128
{ #category : #tests }
133129
DataFrameJsonReaderTest >> testReadFromString [
134130
| output |
135131

136132
output := DataFrameJsonReader new readFrom: TestJsonStrings nonNullJsonString2.
137-
138-
self assert: (self sortByRowColNames: output) equals: dfWithRowColNames.
133+
134+
self assert: (self sortByRowColNames: output) equals: dfWithRowColNames
139135
]
140136

141137
{ #category : #tests }
142138
DataFrameJsonReaderTest >> testReadFromValues [
143139
| output |
144140

145141
output := DataFrameJsonReader new readFrom: directory / 'values.json'.
146-
147-
self assert: (self sortByRowColNames: output) equals: df.
142+
143+
self assert: (self sortByRowColNames: output) equals: df
148144
]

src/DataFrame-IO-Tests/DataFrameJsonWriterTest.class.st

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,23 +22,23 @@ DataFrameJsonWriterTest >> setUp [
2222
super setUp.
2323
directory := FileSystem memory workingDirectory / 'testDataForJson'.
2424
directory createDirectory.
25-
25+
2626
df := DataFrame withRows: #(
2727
(1 2 nil nil)
2828
(nil 2 3 nil)
2929
(nil nil nil 5)
3030
(1 nil 2 nil))
3131
rowNames: #('row1' 'row2' 'row3' 'row4')
32-
columnNames: #('col1' 'col2' 'col3' 'col4').
32+
columnNames: #('col1' 'col2' 'col3' 'col4')
3333
]
3434

3535
{ #category : #tests }
3636
DataFrameJsonWriterTest >> testWriteAsString [
3737
| actual expected |.
3838
actual := DataFrameJsonWriter new writeAsString: df.
39-
expected := '' join: (TestJsonStrings recordsJsonString
39+
expected := '' join: (TestJsonStrings recordsJsonString
4040
regex: '[^\s]+' matchesCollect: [:x|x]).
41-
self assert: actual equals: expected.
41+
self assert: actual equals: expected
4242
]
4343

4444
{ #category : #tests }
@@ -47,9 +47,9 @@ DataFrameJsonWriterTest >> testWriteTo [
4747
file := directory / 'output.json'.
4848
DataFrameJsonWriter new write: df to: file.
4949
actual := self readFile: file.
50-
expected := '' join: (TestJsonStrings recordsJsonString
50+
expected := '' join: (TestJsonStrings recordsJsonString
5151
regex: '[^\s]+' matchesCollect: [:x|x]).
52-
self assert: actual lines equals: expected lines.
52+
self assert: actual lines equals: expected lines
5353
]
5454

5555
{ #category : #tests }
@@ -58,9 +58,9 @@ DataFrameJsonWriterTest >> testWriteToJson [
5858
file := directory / 'output.json'.
5959
df writeToJson: file.
6060
actual := self readFile: file.
61-
expected := '' join: (TestJsonStrings recordsJsonString
61+
expected := '' join: (TestJsonStrings recordsJsonString
6262
regex: '[^\s]+' matchesCollect: [:x|x]).
63-
self assert: actual lines equals: expected lines.
63+
self assert: actual lines equals: expected lines
6464
]
6565

6666
{ #category : #tests }
@@ -69,7 +69,7 @@ DataFrameJsonWriterTest >> testWriteToJsonOrient [
6969
file := directory / 'output.json'.
7070
df writeToJson: file orient: 'values'.
7171
actual := self readFile: file.
72-
expected := '' join: (TestJsonStrings valuesJsonString
72+
expected := '' join: (TestJsonStrings valuesJsonString
7373
regex: '[^\s]+' matchesCollect: [:x|x]).
74-
self assert: actual lines equals: expected lines.
74+
self assert: actual lines equals: expected lines
7575
]

0 commit comments

Comments
 (0)