Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removes inputRef / bookmark params from appendRecord #3597

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
f958908
Working on OPF model RST docstrings
rhyolight May 8, 2017
bb5a321
Updated snakecase opf_utils in RST docs
rhyolight May 8, 2017
878c810
Merge branch 'fix-modelresults-rst' into opf-model-docstrings
rhyolight May 8, 2017
b3366ca
Added RecordStreamIFace to RST cause OFP models need it
rhyolight May 8, 2017
19fdf1c
Fully docced OPF Model
rhyolight May 8, 2017
949dc68
Fully docced HTMPredictionModel
rhyolight May 8, 2017
219e831
Finished all OPF model docstrings
rhyolight May 8, 2017
227353b
Updated doc README
rhyolight May 8, 2017
7a93be5
Docced nupic.data.utils
rhyolight May 8, 2017
79f5f81
Docced RecordStream
rhyolight May 8, 2017
3c77ac2
Docced stream reader
rhyolight May 9, 2017
e8e8e12
Merge branch 'opf-model-docstrings' into data-docs
rhyolight May 9, 2017
767be5a
Updated doc readme for nupic.data updates.
rhyolight May 9, 2017
17f6cc9
Merge branch 'data-docs' into remove-recordstream-appendrecord-bookmark
rhyolight May 9, 2017
08541d3
Remove unused argument from appendRecord
rhyolight May 9, 2017
56800d4
Fixed broken test after removing appendRecord param
rhyolight May 9, 2017
700c4f0
Merge branch 'master' of github.com:numenta/nupic into remove-records…
rhyolight May 9, 2017
881f065
Merge branch 'master' of github.com:numenta/nupic into remove-records…
rhyolight May 9, 2017
66fc830
Missed a merge
rhyolight May 9, 2017
25215e3
Fixing up links in RST docs
rhyolight May 9, 2017
245feb6
Removed dangling references to inputRef / bookmark
rhyolight May 9, 2017
ab41b27
Merge branch 'master' of github.com:numenta/nupic into remove-records…
rhyolight May 9, 2017
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
11 changes: 3 additions & 8 deletions src/nupic/data/file_record_stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ def getNextRecord(self, useCache=True):
return record


def appendRecord(self, record, inputBookmark=None):
def appendRecord(self, record):
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed inputRef here in the implementation method.

"""
Saves the record in the underlying csv file.

Expand Down Expand Up @@ -418,22 +418,17 @@ def appendRecord(self, record, inputBookmark=None):
self._recordCount += 1


def appendRecords(self, records, inputRef=None, progressCB=None):
def appendRecords(self, records, progressCB=None):
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed inputRef here in the implementation method.

"""
Saves multiple records in the underlying storage.

:param records: array of records as in
:meth:`~.FileRecordStream.appendRecord`
:param inputRef: reference to the corresponding input (not applicable
in case of a file storage)
:param progressCB: (function) callback to report progress
"""

# input ref is not applicable in case of a file storage
inputRef = inputRef

for record in records:
self.appendRecord(record, None)
self.appendRecord(record)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to send None anymore.

if progressCB is not None:
progressCB()

Expand Down
13 changes: 7 additions & 6 deletions src/nupic/data/record_stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,10 +284,11 @@ def getAggregationMonthsAndSeconds(self):
If there is no aggregation associated with the stream, returns None.

Typically, a raw file or hbase stream will NOT have any aggregation info,
but subclasses of RecordStreamIface, like :class:`~nupic.data.StreamReader`,
will and will return the aggregation period from this call. This call is
used by the :meth:`getNextRecordDict` method to assign a record number to a
record given its timestamp and the aggregation interval
but subclasses of :class:`~nupic.data.record_stream.RecordStreamIface`, like
:class:`~nupic.data.stream_reader.StreamReader`, will and will return the
aggregation period from this call. This call is used by
:meth:`getNextRecordDict` to assign a record number to a record given its
timestamp and the aggregation interval.

:returns: ``None``
"""
Expand All @@ -303,7 +304,7 @@ def getNextRecordIdx(self):


@abstractmethod
def appendRecord(self, record, inputRef=None):
def appendRecord(self, record):
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed inputRef here in the abstract method.

"""
Saves the record in the underlying storage. Should be implemented in
subclasses.
Expand All @@ -313,7 +314,7 @@ def appendRecord(self, record, inputRef=None):


@abstractmethod
def appendRecords(self, records, inputRef=None, progressCB=None):
def appendRecords(self, records, progressCB=None):
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed inputRef here in the abstract method.

"""
Saves multiple records in the underlying storage. Should be implemented in
subclasses.
Expand Down
4 changes: 2 additions & 2 deletions src/nupic/data/stream_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -423,11 +423,11 @@ def getAggregationMonthsAndSeconds(self):
return self._aggMonthsAndSeconds


def appendRecord(self, record, inputRef=None):
def appendRecord(self, record):
raise RuntimeError("Not implemented in StreamReader")


def appendRecords(self, records, inputRef=None, progressCB=None):
def appendRecords(self, records, progressCB=None):
raise RuntimeError("Not implemented in StreamReader")


Expand Down