Skip to content

TypeError: only 0-dimensional arrays can be converted to Python scalars #101

@XD1001

Description

@XD1001

After upgrading the PDSim to the newest version with Python=3.12.12, cython=3.2.3, numpy=2.4.0, an error raises when running the scroll compressor example code examples/scroll_compressor.py (error message listed below):

Traceback (most recent call last):
  File "c:\scroll\scroll_example.py", line 436, in <module>
    Compressor(Scroll)
  File "c:\scroll\scroll_example.py", line 267, in Compressor
    ScrollComp.set_disc_geo('2Arc',r2 = 0)
  File "C:\ProgramData\Anaconda3\envs\pdsim\Lib\site-packages\PDSim\scroll\core.py", line 883, in set_disc_geo
    scroll_geo.setDiscGeo(self.geo,Type,r2,**kwargs)
  File "PDSim/scroll/symm_scroll_geo.pyx", line 256, in PDSim.scroll.symm_scroll_geo.setDiscGeo
  File "PDSim/scroll/common_scroll_geo.pxd", line 108, in PDSim.scroll.common_scroll_geo.geoVals.xa_arc2.__set__
    cdef public double xa_arc2,ya_arc2,ra_arc2,t1_arc2,t2_arc2
TypeError: only 0-dimensional arrays can be converted to Python scalars

It seems that this error is because that somehow the type of xa_arc2 becomes arrays instead of double. My guess is that this is caused by some issues during the discharge tip geometry calculation process? Not sure if this is caused by new features in the new python and cython version?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions