Skip to content

Sensors.poll will eventually fail when using sample data #48

@tonyroberts

Description

@tonyroberts

Senors.poll will fail when it advances past the end of the sample data with an IndexError.

Instead it might be better to loop back to the beginning (sensors.py, line 233)

       def poll(self):
            """Pulls data from the pressure and flow sensors"""
            datum = tuple((self._fake_data.pressures[self._data_index],
                           self._fake_data.flow_rates[self._data_index])
                          for _ in range(NUMBER_OF_PATIENTS))
            self._data_index = (self._data_index + 1) % len(self._fake_data)
            return datum

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions