Skip to content

ProcessSampleData can end up with data sets out of alignment #47

@tonyroberts

Description

@tonyroberts

In process_sample_data.py around line 108:

                self._timestamps.append(current_timestamp)
                self._flow_rates.append(current_flow_rate)
                self._tidal_volumes.append(current_tidal_volume)
                if current_pressure != math.inf:
                    self.pressures.append(current_pressure)

These lists should all be the same size, but if for whatever reason there is no pressure data for one line then the pressures list will end up being out of alignment with the others.

My suggested fix is to add None where there is no data, but I don't know enough about the rest of the code to know if that will have any knock on effects or not.

                self._timestamps.append(current_timestamp)
                self._flow_rates.append(current_flow_rate)
                self._tidal_volumes.append(current_tidal_volume)
                self._pressures.append(current_pressure if current_pressure != math.inf else None)

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