Improving dataselection with strings

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

@sevmag がすでに取り組んでいます。

2025年9月16日 から。

評価

この issue はまだ評価されていません。

説明

feature

Is your feature request related to a problem? Please describe.
When you want to select events from a database that all have a non-Nan value for a truth variable. Ideally, one would have a way to use the selection argument of the graphnet.data.dataset like this:

"energy.notna()"

Where energy is a truth variable and .notna() is a pandas.DataFrame.query-compatible syntax.

Until now, this has not worked since the handling of attributes/functions that are called as attributes is not handled in

https://github.com/graphnet-team/graphnet/blob/631b1a69d70c9e10a71fd906e8b8a74fcc9875d4/src/graphnet/data/utilities/string_selection_resolver.py#L18

more specifically, in

https://github.com/graphnet-team/graphnet/blob/631b1a69d70c9e10a71fd906e8b8a74fcc9875d4/src/graphnet/data/utilities/string_selection_resolver.py#L123-L130

Describe the solution you'd like
One needs to expand the parsing of the string with ast to adapt to this case.

It's quite easy, and I will pull up a PR with a proposed solution.

主要言語
Python
スター
117
フォーク
115
平均マージ
2日 21時間
マージ済み PR(30日)
1

環境構築

  • Dockerfile または Docker Compose ファイルあり
  • プルリクエストのテンプレートなし
  • コントリビューションガイドなし

はじめの一歩

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

graphnet-team/graphnet のほかの issue

graphnet-team/graphnet の issue をすべて見る

似ている issue

Python の issue をもっと見る

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

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