hiddenSymmetries / simsopt

Simons Stellarator Optimizer Code
https://simsopt.readthedocs.io
MIT License
94 stars 45 forks source link

Fix error with netcdf scalars in scipy v1.12 #390

Closed landreman closed 8 months ago

landreman commented 8 months ago

This change to scipy's netcdf module in scipy v1.12 causes simsopt's netcdf-writing functions to fail when setting scalar (i.e. 0D) values. I'm not sure why that change was made to scipy because numpy.ndarray.itemset does not appear to be deprecated. Anyhow, this pull request makes simsopt's netcdf routines work with scipy 1.12, while also working with earlier scipy versions. No changes to the required versions of numpy or scipy for simsopt are needed.