Skip to content

MovingWindow: Create Interface for requesting data and handling the data copy behaviour #214

@matthias-wende-frequenz

Description

When asking the MovingWindow for a subwindow we might return a slice of the buffer, that means a reference to the underlying numpy based ringbuffer.
There are cases, e.g. when dealing with small window sizes and high sample rates, where the data might get updated from the data stream before the requested subwindow has been processed.

As a solution we want to tell the MovingWindow to return a copy of the data instead of a reference. In order to do that we need to add an interface, such that users can control copy behavior.

We might implement a method for the MovingWindow as follows.

window(
	self,
	start: datetime,
	end: datetime,
	fill_gaps: Optional[Quantity] = None,
	force_copy: Bool = False
)

This method should return a sorted numpy array that holds the resampled data from start to end and fills the gaps with the Value that is provided by fill_gaps.


Summary of the (ongoing) work related to this and what I see essential for v1.0.

Essential for this issue:

Related to moving window:

Metadata

Metadata

Labels

part:data-pipelineAffects the data pipelinetype:enhancementNew feature or enhancement visitble to users

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions