Skip to content
This repository has been archived by the owner on Sep 1, 2023. It is now read-only.

Removed unimplemented abstract methods #3596

Merged
merged 2 commits into from
May 9, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions src/nupic/data/file_record_stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,18 +387,6 @@ def getNextRecord(self, useCache=True):
return record


def getRecordsRange(self, bookmark=None, range=None):
raise Exception('getRecordsRange() is not supported for the file storage')


def getLastRecords(self, numRecords):
raise Exception('getLastRecords() is not supported for the file storage')


def removeOldData(self):
raise Exception('removeOldData is not supported in this class.')


def appendRecord(self, record, inputBookmark=None):
"""
Saves the record in the underlying csv file.
Expand Down
25 changes: 0 additions & 25 deletions src/nupic/data/record_stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,38 +296,13 @@ def getAggregationMonthsAndSeconds(self):
return None


@abstractmethod
def getRecordsRange(self, bookmark=None, range=None):
"""Returns a range of records, starting from the bookmark. If 'bookmark'
is None, then records read from the first available. If 'range' is
None, all available records will be returned (caution: this could be
a lot of records and require a lot of memory).
"""


@abstractmethod
def getNextRecordIdx(self):
"""Returns the index of the record that will be read next from
getNextRecord()
"""


@abstractmethod
def getLastRecords(self, numRecords):
"""Returns a tuple (successCode, recordsArray), where
successCode - if the stream had enough records to return, True/False
recordsArray - an array of last numRecords records available when
the call was made. Records appended while in the
getLastRecords will be not returned until the next
call to either getNextRecord() or getLastRecords()
"""


@abstractmethod
def removeOldData(self):
"""Deletes all rows from the table if any data was found."""


@abstractmethod
def appendRecord(self, record, inputRef=None):
"""Saves the record in the underlying storage."""
Expand Down
18 changes: 0 additions & 18 deletions src/nupic/data/stream_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -384,20 +384,6 @@ def getDataRowCount(self):
raise RuntimeError('No end of datastream found.')


def getLastRecords(self, numRecords):
"""Saves the record in the underlying storage."""
raise RuntimeError("Not implemented in StreamReader")


def getRecordsRange(self, bookmark=None, range=None):
""" Returns a range of records, starting from the bookmark. If 'bookmark'
is None, then records read from the first available. If 'range' is
None, all available records will be returned (caution: this could be
a lot of records and require a lot of memory).
"""
raise RuntimeError("Not implemented in StreamReader")


def getNextRecordIdx(self):
"""Returns the index of the record that will be read next from
getNextRecord()
Expand Down Expand Up @@ -443,10 +429,6 @@ def appendRecords(self, records, inputRef=None, progressCB=None):
raise RuntimeError("Not implemented in StreamReader")


def removeOldData(self):
raise RuntimeError("Not implemented in StreamReader")


def seekFromEnd(self, numRecords):
"""Seeks to numRecords from the end and returns a bookmark to the new
position.
Expand Down