Skip to content

AttributeError: np.Inf was removed in the NumPy 2.0 release. Use np.inf instead. #180

@nowmac1207

Description

@nowmac1207

2-amino.zip

Tutorial: MC/SA in GSAS-II
Step 7. Monte Carlo/Simulated Annealing

C:\Windows\System32>call C:\g2\Scripts\activate
Adding GSAS-II location to Python system path
5 values read from C:\Users\mnowa.GSASII\config.ini
GSAS-II binary directory: C:\g2\GSAS-II\GSASII-bin\win_64_p3.13_n2.2
Python/module versions loaded:
Python: 3.13.3 from C:\g2\python.exe.
wx: 4.2.2
matplotlib: 3.10.1
numpy: 2.2.5
scipy: 1.15.2
OpenGL: 3.1.9
Image: 11.1.0 (PIL or Pillow)
Platform: win32 64bit AMD64
Binary ver: 5805, v5.2.0
GSAS-II: 75ce746, 04-May-2025 10:52 (0.3 days old). Tag: #5810, v5.4.3
loading from file: C:\Users\mnowa\Documents\G2tutorials\2-amino.gpx
GPX load successful. Last saved with GSAS-II revision #5810, v5.4.3 git 75ce746
Configuration settings saved as C:\Users\mnowa.GSASII\config.ini
MC/SA run:
Reflection type:PWDR Total No. reflections: 91
Minimum d-spacing used: 2.50 No. reflections used: 36
Number of parameters varied: 7
Traceback (most recent call last):
File "C:\g2\GSAS-II\GSASII\GSASIIphsGUI.py", line 15512, in OnRunSingleMCSA
RunMCSA('single')
~~~~~~~^^^^^^^^^^
File "C:\g2\GSAS-II\GSASII\GSASIIphsGUI.py", line 15574, in RunMCSA
Result,tsum,nsum,rcov = G2mth.mcsaSearch(data,RBdata,reflType,reflData,covData,pgbar)
~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\g2\GSAS-II\GSASII\GSASIImath.py", line 5966, in mcsaSearch
results = anneal(mcsaCalc,x0,args=(refs,rcov,cosTable,ifInv,allFF,RBdata,varyList,parmDict),
schedule=MCSA['Algorithm'], dwell=MCSA['Annealing'][2],maxiter=10000,
...<2 lines>...
lower=lower, upper=upper, slope=MCSA['log slope'],ranStart=MCSA.get('ranStart',False),
ranRange=MCSA.get('ranRange',10.)/100.,autoRan=MCSA.get('autoRan',False),dlg=pgbar)
File "C:\g2\GSAS-II\GSASII\GSASIImath.py", line 5450, in anneal
best_state.cost = numpy.Inf
^^^^^^^^^
File "C:\g2\Lib\site-packages\numpy_init_.py", line 400, in getattr
raise AttributeError(
...<3 lines>...
)
AttributeError: np.Inf was removed in the NumPy 2.0 release. Use np.inf instead.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions