0xPlaygrounds / 0xPlaygrounds/subgrounds

Timeseries Support

オープン
#7 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
enhancement
主要言語
Python
スター
73
フォーク
12
PR マージ指標
30日以内にマージされた PR はありません

説明

**Is your feature request related to a problem? Please describe.**
## Description
Given a subgrounds fieldpath(s) representing a list of entities, then it should be possible to wrap those fieldpaths in a timeseries which would normalize the data according to time key, interval, aggregation method and interpolation method.

Supported intervals (to start):

* hourly
* daily
* weekly
* monthly

Supported aggregation methods:

* mean
* sum
* first
* last
* median
* min
* max
* count

Supported interpolation methods:

* backward fill (use next value to fill in missing value)
* forward fill (use previous value to fill in missing value)

**Describe the solution you'd like**
```python
sg = Subgrounds()
uniswapV2 = sg.load_subgraph("https://api.thegraph.com/subgraphs/name/uniswap/uniswap-v2")

Swap.price0 = abs(Swap.amount1In - Swap.amount1Out) / abs(Swap.amount0In - Swap.amount0Out)
Swap.price1 = abs(Swap.amount0In - Swap.amount0Out) / abs(Swap.amount1In - Swap.amount1Out)

swaps = uniswapV2.Query.swaps(
orderBy=Swap.timestamp,
orderDirection='desc',
first=500,
)

price0_hourly_close = Timeseries(
x=swaps.timestamp,
y=swaps.price0,
interval='hour',
aggregation='last',
interpolation='ffill'
)
```

*Originally from: cvauclair*

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

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

調査の方向性

The issue proposes a new Timeseries class to wrap Subgrounds fieldpaths. Start by examining the existing Subgrounds codebase to understand how fieldpaths and data fetching work. Look for existing data transformation or normalization modules. The implementation will require designing the Timeseries class, handling time intervals, aggregation methods, and interpolation. Check if there are similar data processing patterns in the code. 'Done' means the Timeseries class works as shown in the example, producing normalized time series data from GraphQL queries.

索引モデルが issue の本文から書いたものです。

評価

技術スタック
graphql, pandas, python
領域
backend-api-design, data, data-engineering
issue の種類
機能追加
難易度
5/5
見積もり時間
1週間以上
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
25/100

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

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