ReaderType.LAST does not return last value
还没有人认领这个 Issue。
评估
调研方向
首先使用 ReaderType.LAST 和 'SNAPSHOT' 重现该示例,然后跟踪 c.read() 对这些读取类型的处理,并将其与 ACTUAL 结果进行比较。验证返回的时间戳是最新的可用数据点,而不是报告中显示的较早值。
由索引模型根据 Issue 内容生成。
描述
When using ReaderType.ACTUAL or 'SNAPSHOT', the last value retrieved consistently shows an hour offset. Instead of retrieving the actual last data point, it returns the data point from one hour earlier.
This code:
import tagreader
from tagreader import list_sources
from datetime import datetime, timedelta
from tagreader.utils import ReaderType
c = tagreader.IMSClient(datasource='GFC', imstype='aspenone')
try:
c.connect()
print("Connection successful")
except Exception as e:
print(f"Connection failed: {e}")
# Use the read() method to read the tag data
df_LAST = c.read(tags=['GFC.03-ST121.RPM'], read_type=ReaderType.LAST)
df_SNAPSHOT = c.read(tags=['GFC.03-ST121.RPM'], read_type='SNAPSHOT')
df = c.read(tags=['GFC.03-ST121.RPM'], start_time='04-11-24 12:50:00', end_time='04-11-24 13:10:00', read_type=ReaderType.ACTUAL)
# Print the result
print(df_LAST)
print(df_SNAPSHOT)
print(df)
returns:
Connection successful
GFC.03-ST121.RPM
time
2024-11-04 12:05:41+01:00 8988.56543
GFC.03-ST121.RPM
time
2024-11-04 12:05:41+01:00 8988.56543
GFC.03-ST121.RPM
time
2024-11-04 12:50:12.501000+01:00 8978.452148
2024-11-04 12:50:53.505000+01:00 8989.392578
2024-11-04 12:51:03.513000+01:00 9000.988281
2024-11-04 12:51:13.511000+01:00 9011.892578
2024-11-04 12:51:33.513000+01:00 9022.156250
2024-11-04 12:52:27.522000+01:00 9011.138672
2024-11-04 12:52:36.523000+01:00 9000.280273
2024-11-04 12:52:45.524000+01:00 9010.517578
2024-11-04 12:53:15.531000+01:00 9021.043945
2024-11-04 12:53:24.532000+01:00 9032.085938
2024-11-04 12:53:29.532000+01:00 9021.666992
2024-11-04 12:53:33.533000+01:00 9031.952148
2024-11-04 12:53:53.535000+01:00 9042.305664
2024-11-04 12:53:57.535000+01:00 9032.219727
2024-11-04 12:54:12.541000+01:00 9042.305664
2024-11-04 12:54:20.542000+01:00 9031.284180
2024-11-04 12:55:12.551000+01:00 9042.038086
2024-11-04 12:56:31.563000+01:00 9053.131836
2024-11-04 12:57:19.571000+01:00 9042.886719
2024-11-04 12:57:45.574000+01:00 9032.442383
2024-11-04 12:58:31.583000+01:00 9021.310547
where the data point: 2024-11-04 12:58:31.583000+01:00 9021.310547 is the actual last datapoint.
- 主要语言
- Python
- 星标
- 55
- 派生
- 21
- 平均合并
- 11 天 9 小时
- 30 天内合并 PR
- 2
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
equinor/tagreader-python 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 68/100
equinor/tagreader-python#474 · 1 条评论 ·
-
难度 2/5 1 小时以内 新手友好度 55/100
equinor/tagreader-python#473 ·
-
难度 3/5 1-2 天 新手友好度 45/100
equinor/tagreader-python#469 · 1 条评论 ·
-
难度 3/5 1-2 天 新手友好度 35/100
equinor/tagreader-python#447 · 1 条评论 ·
-
难度 5/5 一周以上 新手友好度 25/100
equinor/tagreader-python#393 ·
查看 equinor/tagreader-python 的全部 Issue
相似的 Issue
-
bug confirmed issue
难度 2/5 1-3 小时 新手友好度 75/100
open-webui/open-webui#30750 · 1 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 75/100
-
enhancement
难度 2/5 1-3 小时 新手友好度 75/100
OpenwaterHealth/openmotion-bloodflow-app#604 · 1 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 70/100
-
good first issue
难度 1/5 1 小时以内 新手友好度 90/100