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

v2: writing a problem reformats all math expressions, including unchanged ones

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

メンテナーはふだん 1 日以内に返信

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

評価

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

調査の方向性

Start with how sympify_petab parses expressions on load and how to_df writes them back via petab_math_str in the petab.v2 modules. The proposed fix needs a decision on storing the original string on the expression model, which is a design question for maintainers before any code. Done means an unchanged formula round-trips to its original text, while a changed expression is still printed from sympy.

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

説明

In petab.v2, math expressions (observable and noise formulas, condition target values, observable/noise parameter overrides) are stored as sympy expressions, parsed with sympify_petab on load. On writing, to_df prints them with petab_math_str; the original string is not kept. Therefore, loading and writing a problem rewrites every expression, changed or not:

Input Written back
a - (b - c) a - b + c
(100*pApB + 200*pApA)/2 100*pApA + 50*pApB
2 * x / 3 0.6666666666666666*x
log10(x) log(x)/log(10)

The results are mathematically equivalent, but this makes diffs between original and written problems hard to read. E.g., when converting PEtab v1 problems to v2 and writing them, actual changes (like reparametrized noise formulas) are mixed with reformatting of unchanged formulas.

Possible approach: when parsing a string, also store the original string (e.g., as a pydantic private attribute), and write it in to_df if the expression is still equal to the parsed one; otherwise, print the expression. This keeps the current API.

Alternatives considered:

  • Storing strings and deriving sympy expressions on demand: breaks the current API.
  • Parsing with evaluate=False: reduces, but does not prevent, reformatting, and changes the expressions returned to users.

🤖 Drafted with AI assistance.

主要言語
Python
スター
18
フォーク
9
平均マージ
2日 4時間
マージ済み PR(30日)
30

環境構築

はじめの一歩

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

PEtab-dev/libpetab-python のほかの issue

PEtab-dev/libpetab-python の issue をすべて見る

似ている issue

Python の issue をもっと見る

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

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