Datasets:
sepfy
commited on
Commit
•
6f3affa
1
Parent(s):
e6f664d
Revert "Remove test.py"
Browse filesThis reverts commit d8b86e5a4ada07a2cba19a3986cefbdea1b13f91.
test.py
ADDED
@@ -0,0 +1,73 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# coding=utf-8
|
2 |
+
|
3 |
+
import pandas as pd
|
4 |
+
import datasets
|
5 |
+
|
6 |
+
_DATA_URL = 'https://frodobots-1k.s3.ap-southeast-1.amazonaws.com/frodobots-1k_20230907_getting-started.zip'
|
7 |
+
|
8 |
+
_DESCRIPTION = '''\
|
9 |
+
'''
|
10 |
+
|
11 |
+
_HOMEPAGE = 'https://www.frodobots.com'
|
12 |
+
|
13 |
+
_LICENSE = ''
|
14 |
+
|
15 |
+
_CITATION = ''
|
16 |
+
|
17 |
+
class Test(datasets.GeneratorBasedBuilder):
|
18 |
+
|
19 |
+
BUILDER_CONFIGS = [
|
20 |
+
datasets.BuilderConfig(
|
21 |
+
name='test',
|
22 |
+
version=datasets.Version('1.0.0', ''),
|
23 |
+
description='',
|
24 |
+
)
|
25 |
+
]
|
26 |
+
|
27 |
+
def _info(self):
|
28 |
+
features = datasets.Features(
|
29 |
+
{
|
30 |
+
'speed': datasets.Value('float32'),
|
31 |
+
'angular': datasets.Value('float32'),
|
32 |
+
'rpm_1': datasets.Value('float32'),
|
33 |
+
'rpm_2': datasets.Value('float32'),
|
34 |
+
'rpm_3': datasets.Value('float32'),
|
35 |
+
'rpm_4': datasets.Value('float32'),
|
36 |
+
'timestamp': datasets.Value('float64'),
|
37 |
+
}
|
38 |
+
)
|
39 |
+
return datasets.DatasetInfo(
|
40 |
+
description=_DESCRIPTION,
|
41 |
+
features=features,
|
42 |
+
supervised_keys=None,
|
43 |
+
homepage=_HOMEPAGE,
|
44 |
+
license=_LICENSE,
|
45 |
+
citation=_CITATION,
|
46 |
+
)
|
47 |
+
|
48 |
+
|
49 |
+
def _split_generators(self, dl_manager):
|
50 |
+
|
51 |
+
archive = dl_manager.download_and_extract(_DATA_URL)
|
52 |
+
return [
|
53 |
+
datasets.SplitGenerator(
|
54 |
+
name=datasets.Split.TRAIN, gen_kwargs={'files': archive + '/frodobots-1k_20230907_getting-started/frodobot2e6388/20230522142406/control_20230522142406.csv', 'split': 'train'}
|
55 |
+
),
|
56 |
+
]
|
57 |
+
|
58 |
+
def _generate_examples(self, files, split):
|
59 |
+
df = pd.read_csv(files)
|
60 |
+
for index, row in df.iterrows():
|
61 |
+
|
62 |
+
yield index, {
|
63 |
+
'speed': row['speed'],
|
64 |
+
'angular': row['angular'],
|
65 |
+
'rpm_1': row['rpm_1'],
|
66 |
+
'rpm_2': row['rpm_2'],
|
67 |
+
'rpm_3': row['rpm_3'],
|
68 |
+
'rpm_4': row['rpm_4'],
|
69 |
+
'timestamp': row['timestamp'],
|
70 |
+
}
|
71 |
+
|
72 |
+
if __name__ == '__main__':
|
73 |
+
Test().download_and_prepare()
|