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

Last valid point as read_type #298

Open
kjeel-dev opened this issue Dec 7, 2023 · 2 comments
Open

Last valid point as read_type #298

kjeel-dev opened this issue Dec 7, 2023 · 2 comments

Comments

@kjeel-dev
Copy link

Demand for new functionality:

Example call:
df = c.read(['BA:CONC.1'], '05-Jan-2020 08:00:00', '05/01/20 11:30am', 60, read_type=tagreader.ReaderType.LastValid)

This should return data with a time step of 60 seconds. At each time step the data returned should be the last valid data point recorded before this.
Example: for the example call the first time step is 05-Jan-2020 08:00:00. The value given back should here be the last valid data point before this. This data point could be 1 second before or 1 month before, whatever is in the IMS.
The next time step is 05-Jan-2020 08:01:00. The value given back will be the same as for the first time step unless there is new valid time steps between 08:00:00 and 08:01:00. If there are several, the one closest to 05-Jan-2020 08:01:00 should be chosen.

@hakmyo
Copy link

hakmyo commented Sep 10, 2024

Agreed. I have also come across problems where this would be useful.

This function would be equivalent to pandas "forward fill": https://pandas.pydata.org/docs/reference/api/pandas.core.resample.Resampler.ffill.html#pandas.core.resample.Resampler.ffill

A workaround is to export RAW data from tagreader and then resample the data with pandas forward fill.

@Asgmel03
Copy link
Contributor

For the moment we do mostly maintenance and bug fixes for the Tagreader repo and do not implement new functionality at this time. But we have decided to put this issue into our board and discuss if we should look into it. I will update you once we decide what to do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants