def testBasicFileParsing(self):
     dataParser = DataParser()
     dataParser.parseFile("/Users/LilyWU/Documents/PAMAP/PAMAP2_Dataset/Protocol/subject101.dat")
     # for sess in dataParser.sessions:
     #   #Session()=session
     #   for sample in sess[1]:
     #      print(1,sample.samples.hand.accX)
     print(dataParser.sessions[1].samples.hand.accX)
Example #2
0
    def parseDataAndPersistIntoDb(self, db_filename):

        raw_data_filenames = [
            "PAMAP2_Dataset/Protocol/subject101.dat",
            "PAMAP2_Dataset/Protocol/subject102.dat",
            "PAMAP2_Dataset/Protocol/subject103.dat",
            "PAMAP2_Dataset/Protocol/subject104.dat",
            "PAMAP2_Dataset/Protocol/subject105.dat",
            "PAMAP2_Dataset/Protocol/subject106.dat",
            "PAMAP2_Dataset/Protocol/subject107.dat",
            "PAMAP2_Dataset/Protocol/subject108.dat",
            "PAMAP2_Dataset/Protocol/subject109.dat"
        ]



        for (index, dataFilename) in enumerate(raw_data_filenames):
            dataParser = DataParser()
            dataParser.parseFile(dataFilename)
            self.__persistDataParserIntoDb(db_filename, dataParser, index)