Scipy root finders give different answers across operating systems and Python versions

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

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

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

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
12/100
issue の種類
バグ
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
numpy, python

調査の方向性

The failures show up in the tests under tests/, which compare root-finder output with np.allclose() across platforms. The issue proposes options (float64 inputs, better problem scaling and tolerances) but does not choose one, so there is no clear change to make. Start by reproducing one failing test locally and in CI, then ask maintainers which approach to take before writing any patch.

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

説明

enhancement help wanted

The root finders in scipy.optimize give different answers across operating systems and Python versions as has been seen in our unit tests in the ./tests/ directory. We have had tests that pass in the GitHub actions but do not pass locally and vice versa. And the reasons are failing the np.allclose() criteria in comparing objects.

We need to get the solvers in OG-Core to give the same answers to an adequate degree of precision across platforms. Here are some helpful references and proposed potential solutions.

  • Consistent numerical precision across platforms. This articles discusses the relative numerical precision performance of Intel and Apple M1 chips in some famously difficult problems. The Intel and Apple M1 chips give the same wrong answers. The Numpy documentation for "Array types and conversions between types" lists the different numerical types available in Numpy and says the following. We could try setting all our inputs to numerical routines to np.float64 (double precision). There are higher levels of precision, but I don't think we need them.

Since many of these [numerical data types] have platform-dependent definitions, a set of fixed-size aliases are provided (see Sized aliases).

  • Correctly scaled problem and different tolerance levels across solvers. This Stack Overflow question and answer discuss the importance of having a well-posed optimization problem that is correctly scaled. It also discusses the merits of setting the tolerance of the problem to be sufficiently precise.

  • Try other solvers that might be more consistent. I can't find any non-SciPy root finders. I thought that cvxopt might be one, but it is really a minimizer.

cc: @jdebacker

主要言語
Python
スター
85
フォーク
153
平均マージ
1日 19時間
マージ済み PR(30日)
19

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

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

PSLmodels/OG-Core のほかの issue

PSLmodels/OG-Core の issue をすべて見る

似ている issue

Python の issue をもっと見る

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

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