Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

ReaderType.LAST does not return last value

オープン
#388 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
45/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
python
領域
data

調査の方向性

まず、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時間
マージ済み PR(30日)
2

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

equinor/tagreader-python のほかの issue

equinor/tagreader-python の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。