2017-01-16 5 views
0

私は、ほとんど毎日使っていたnag4pyを必要とする固有値とベクトルを計算するスクリプトを用意しています。コードはこのブログにあります:http://www.walkingrandomly.com/?p=5303に関連するSO投稿(How to use eig with the nobalance option as in MATLAB?)があります。nag4pyのインポートエラー: "INIT_FAILの名前をインポートできません"

昨日nag4pyをアップグレードし、同じ年のために働いてきたスクリプトの実行時に、今、私は次のようなエラーに遭遇:ところで

from nag4py.util import Nag_RowMajor,Nag_NoBalancing,Nag_NotLeftVecs,Nag_RightVecs,Nag_RCondEigVecs,Integer,NagError,INIT_FAIL

ImportError: cannot import name INIT_FAIL

をノーを使用してオクターブをインポートすることで、問題を解決しましたデフォルトではバランス調整オプションです。しかし、私はnag4pyでこの問題を解決したいと思います。

NAGライセンスをテストしたところ、有効です。

答えて

0

nag4pyパッケージのリリースバージョンが埋め込まれたドキュメントに記載されている 'quiet_fail' と 'noisy_fail' を使用しています。

Error or warning cases detected by the NAG C Library are handled in nag4py using a similar NagError mechanism as in the Library itself. The nag4py util module provides two convenience functions ('quiet_fail' and 'noisy_fail') to create a NagError instance with printing of messages disabled or enabled, respectively.

ここでの変更です:

Index: nag4py/util.py 
=================================================================== 
--- nag4py/util.py (revision 104707) 
+++ nag4py/util.py (revision 104708) 
@@ -4736,14 +4736,20 @@ 
    return _arg 


-def INIT_FAIL(fail): 
+def quiet_fail(): 
+ "Returns a NagError instance with printing disabled." 
+ fail = NagError() 
    fail.eprint = Nag_FALSE 
+ return fail 

-def SET_FAIL(fail): 
+def noisy_fail(): 
+ "Returns a NagError instance with printing enabled." 
+ fail = NagError() 
    fail.eprint = Nag_TRUE 
+ return fail 

-__all__.append("INIT_FAIL") 
-__all__.append("SET_FAIL") 
+__all__.append("quiet_fail") 
+__all__.append("noisy_fail") 

def get_input_func(): 
    from sys import version_info 
関連する問題