qiskit-metal
qiskit-metal copied to clipboard
Shapely deprecation warning
Information
- Qiskit Metal version: 0.0.4
- Python version: 3.9.5
- Operating system: Windows 10
What is the current behavior?
Running this tutorial notebook gives me the following 2 types of warnings stating:
ShapelyDeprecationWarning: Setting the 'coords' to mutate a Geometry in place is deprecated, and will not be possible any more in Shapely 2.0 .
ShapelyDeprecationWarning: The array interface is deprecated and will no longer work in Shapely 2.0. Convert the '.coords' to a numpy array instead.
Steps to reproduce the problem
Run the cells in the mentioned notebook in order. Cell 15 gives this warning the first time.
Adding more history. Shapely 1.7.1 gives no warning. Shapely 1.8.0 starts the warning in anticipation to the future 2.0
Options:
- can limit qiskit-metal to only use shapely<1.8.0 (environment.yml and requirements.txt)
- can edit the code in qiskit-metal (and pyEPR?) where the coords are explicitly edited in place and replace it with a self-assignment or some other method.
- other option the developer can come up with.
Thank you @marcolincs I was going to create an issue about it as we discuss before. I hope it will resolve soon :)
#727
Just to have a collection of all the warnings (in order of I think easiest to hardest to fix);
When adding components to design
- The 'cascaded_union()' function is deprecated. Use 'unary_union()' instead.
- Iteration over multi-part geometries is deprecated and will be removed in Shapely 2.0. Use the
geoms
property to access the constituent parts of a multi-part geometry. - Setting the 'coords' to mutate a Geometry in place is deprecated, and will not be possible any more in Shapely 2.0
- The array interface is deprecated and will no longer work in Shapely 2.0. Convert the '.coords' to a numpy array instead.
Ansys Render
- No warnings so far
GDS Render *
Regarding the warnings coming from Pandas:
in https://gis.stackexchange.com/questions/397482/what-does-this-warning-mean-for-shapely-python
Historically, geopandas has used shapely to represent vector geometries. However, shapely is somewhat slow; pygeos is essentially a “vectorized” re-implementation of shapely, and can be much faster. See: https://pygeos.readthedocs.io/en/latest/#relationship-to-shapely You might be mixing shapely and pygeos vector data. E.g. geopandas would like to store geometry via pygeos, but you might be supplying it with shapely geometries. In this case, it might convert the geometry, but due to different versions of GEOS in the background, it has to do more work to go from one or the other. That’s what the warning is telling you.
So, geopandas might be converting the shapely to pygeos, and that is what is causing some of the warnings.
I think we now have a solution and will be uploaded here soon.
@zlatko-minev Waiting for the solution :)
The team here has been working hard on this. We have solved many of the warnings, but there’s still one or two. Maybe @priti can add more
Sent from my iPhone
On Jan 31, 2022, at 11:42 AM, Santhosh M @.***> wrote:
@zlatko-minev Waiting for the solution :)
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.
The team here has been working hard on this. We have solved many of the warnings, but there’s still one or two. Maybe @priti can add more … Sent from my iPhone On Jan 31, 2022, at 11:42 AM, Santhosh M @.***> wrote: @zlatko-minev Waiting for the solution :) — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.
@zlatko-minev , that is correct, this is work in progress. @Santhosh-M31 Thank you for being patient.
Merged, should be closed.