limbo018 / DREAMPlace

Deep learning toolkit-enabled VLSI placement
BSD 3-Clause "New" or "Revised" License
681 stars 199 forks source link

Error when running `python dreamplace/Placer.py test/ispd2015/lefdef/mgc_des_perf_a.json` with `shapely >= 2.0` #122

Closed wangzhen0518 closed 1 year ago

wangzhen0518 commented 1 year ago

error info

Traceback (most recent call last):
  File "/home/wangzhen/Project/DREAMPlace/dreamplace/Placer.py", line 174, in <module>
    place(params)
  File "/home/wangzhen/Project/DREAMPlace/dreamplace/Placer.py", line 39, in place
    placedb(params)
  File "/home/wangzhen/Project/DREAMPlace/dreamplace/PlaceDB.py", line 625, in __call__
    self.initialize(params)
  File "/home/wangzhen/Project/DREAMPlace/dreamplace/PlaceDB.py", line 770, in initialize
    virtual_macro_for_fence_region = [
  File "/home/wangzhen/Project/DREAMPlace/dreamplace/PlaceDB.py", line 771, in <listcomp>
    fence_region.slice_non_fence_region(
  File "/home/wangzhen/Project/DREAMPlace/dreamplace/ops/fence_region/fence_region.py", line 172, in slice_non_fence_region
    slices.extend([j.bounds for j in intersect if (isinstance(j, Polygon) and len(j.bounds) == 4)])
TypeError: 'GeometryCollection' object is not iterable

It seems that line 172 in dreamplace/ops/fence_region/fence_region.py needs to be changed to slices.extend([j.bounds for j in **intersect.geoms** if (isinstance(j, Polygon) and len(j.bounds) == 4)]) with shapely >= 2.0.

SivanLaai commented 1 year ago

same error, how do you fixes it, thanks

wangzhen0518 commented 1 year ago

I just modified the code as the end of my description.

It seems that line 172 in dreamplace/ops/fence_region/fence_region.py needs to be changed to slices.extend([j.bounds for j in **intersect.geoms** if (isinstance(j, Polygon) and len(j.bounds) == 4)]) with shapely >= 2.0.

limbo018 commented 1 year ago

Fixed at https://github.com/limbo018/DREAMPlace/commit/5314f9479dd2a128d7beb11c705acbc67d5fbd7f