- Notifications
You must be signed in to change notification settings - Fork245
Open
Labels
Description
When runningmorris.analyze.enhanced_hdmr
withmax_order=1
, an error is raised.
Traceback (mostrecentcalllast):File"/Users/wusher_1/repository/SALib/tests/test_enhanced_hdmr.py",line53,in<module>Si=enhanced_hdmr.analyze(problem,X,Y,**options)^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^File"/Users/wusher_1/repository/SALib/src/SALib/analyze/enhanced_hdmr.py",line232,inanalyzeSi=_finalize(hdmr,Si,alpha,return_emulator)^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^File"/Users/wusher_1/repository/SALib/src/SALib/analyze/enhanced_hdmr.py",line1439,in_finalizeTS=hdmr.S[r, :]^^^^^^AttributeError:'CoreParams'objecthasnoattribute'S'
The following code reproduces the error as seen in SALibv1.4.7
:
importnumpyasnpfromSALib.analyzeimportenhanced_hdmrfromSALib.sampleimportlatin# Create a problem dictionaryproblem= {"num_vars":12,"names": ["PA|Agriculture|Kc","PA|Agriculture|Soil Water Capacity","PA|Agriculture|Root Zone Conductivity","PA|Agriculture|Runoff Resistance Factor","PA|Forest|Kc","PA|Forest|Soil Water Capacity","PA|Forest|Root Zone Conductivity","PA|Forest|Runoff Resistance Factor","PA|Grassland|Kc","PA|Grassland|Soil Water Capacity","PA|Grassland|Root Zone Conductivity","PA|Grassland|Runoff Resistance Factor", ],"bounds": [ [0.8,1.4], [300,600], [2,8], [.05,.5], [.2,.4], [150,900], [2,5], [.5,1.5], [.6,1.3], [250,600], [3,7], [0.1,1.2] ]}X=latin.sample(problem,1000,seed=101)# Run the model to obtain Y (using randomly generated values)rng=np.random.default_rng()Y=rng.standard_normal(1000)# SALib-HDMR optionsoptions= {"max_order":1,"max_iter":100,"alpha":0.95,"print_to_console":True,"seed":101,}# Run SALib-HDMRSi=enhanced_hdmr.analyze(problem,X,Y,**options)